aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ui/headline
diff options
context:
space:
mode:
authorLibravatar muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com>2022-10-25 12:51:28 +0530
committerLibravatar GitHub <noreply@github.com>2022-10-25 07:21:28 +0000
commitf79727a8632490f11c1423773fdd6adfb6337a7b (patch)
treea80943f4e4e571359c8104341a3957f6e763dce4 /src/components/ui/headline
parentadd balajiv113 as a contributor for code (#701) [skip ci] (diff)
downloadferdium-app-f79727a8632490f11c1423773fdd6adfb6337a7b.tar.gz
ferdium-app-f79727a8632490f11c1423773fdd6adfb6337a7b.tar.zst
ferdium-app-f79727a8632490f11c1423773fdd6adfb6337a7b.zip
Transform 'AuthLayoutContainer' component hierarchy to tsx (#699)
Co-authored-by: Muhamed <> Co-authored-by: Vijay A <vraravam@users.noreply.github.com>
Diffstat (limited to 'src/components/ui/headline')
-rw-r--r--src/components/ui/headline/index.tsx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/components/ui/headline/index.tsx b/src/components/ui/headline/index.tsx
index b5a5f695f..bebd8adcf 100644
--- a/src/components/ui/headline/index.tsx
+++ b/src/components/ui/headline/index.tsx
@@ -1,16 +1,22 @@
1import classnames from 'classnames'; 1import classnames from 'classnames';
2import { Component, createElement, ReactNode } from 'react'; 2import {
3 Component,
4 createElement,
5 MouseEventHandler,
6 ReactElement,
7 ReactNode,
8} from 'react';
3import injectStyle, { WithStylesProps } from 'react-jss'; 9import injectStyle, { WithStylesProps } from 'react-jss';
4 10
5import { Theme } from '../../../themes'; 11import { Theme } from '../../../themes';
6import { Omit } from '../typings/generic'; 12import { Omit } from '../typings/generic';
7 13
8interface IProps extends WithStylesProps<typeof styles> { 14interface IProps extends WithStylesProps<typeof styles> {
15 children: ReactNode;
9 level?: number; 16 level?: number;
10 className?: string; 17 className?: string;
11 children: string | ReactNode;
12 id?: string; 18 id?: string;
13 onClick?: () => void; 19 onClick?: MouseEventHandler<HTMLButtonElement>;
14} 20}
15 21
16const styles = (theme: Theme) => ({ 22const styles = (theme: Theme) => ({
@@ -40,7 +46,7 @@ const styles = (theme: Theme) => ({
40}); 46});
41 47
42class HeadlineComponent extends Component<IProps> { 48class HeadlineComponent extends Component<IProps> {
43 render() { 49 render(): ReactElement {
44 const { classes, level, className, children, id, onClick } = this.props; 50 const { classes, level, className, children, id, onClick } = this.props;
45 51
46 return createElement( 52 return createElement(
@@ -61,7 +67,6 @@ class HeadlineComponent extends Component<IProps> {
61} 67}
62 68
63const Headline = injectStyle(styles, { injectTheme: true })(HeadlineComponent); 69const Headline = injectStyle(styles, { injectTheme: true })(HeadlineComponent);
64
65const createH = (level: number) => (props: Omit<IProps, 'classes'>) => 70const createH = (level: number) => (props: Omit<IProps, 'classes'>) =>
66 ( 71 (
67 <Headline level={level} {...props}> 72 <Headline level={level} {...props}>