diff options
author | 2022-10-25 12:51:28 +0530 | |
---|---|---|
committer | 2022-10-25 07:21:28 +0000 | |
commit | f79727a8632490f11c1423773fdd6adfb6337a7b (patch) | |
tree | a80943f4e4e571359c8104341a3957f6e763dce4 /src/components/ui/headline | |
parent | add balajiv113 as a contributor for code (#701) [skip ci] (diff) | |
download | ferdium-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.tsx | 15 |
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 @@ | |||
1 | import classnames from 'classnames'; | 1 | import classnames from 'classnames'; |
2 | import { Component, createElement, ReactNode } from 'react'; | 2 | import { |
3 | Component, | ||
4 | createElement, | ||
5 | MouseEventHandler, | ||
6 | ReactElement, | ||
7 | ReactNode, | ||
8 | } from 'react'; | ||
3 | import injectStyle, { WithStylesProps } from 'react-jss'; | 9 | import injectStyle, { WithStylesProps } from 'react-jss'; |
4 | 10 | ||
5 | import { Theme } from '../../../themes'; | 11 | import { Theme } from '../../../themes'; |
6 | import { Omit } from '../typings/generic'; | 12 | import { Omit } from '../typings/generic'; |
7 | 13 | ||
8 | interface IProps extends WithStylesProps<typeof styles> { | 14 | interface 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 | ||
16 | const styles = (theme: Theme) => ({ | 22 | const styles = (theme: Theme) => ({ |
@@ -40,7 +46,7 @@ const styles = (theme: Theme) => ({ | |||
40 | }); | 46 | }); |
41 | 47 | ||
42 | class HeadlineComponent extends Component<IProps> { | 48 | class 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 | ||
63 | const Headline = injectStyle(styles, { injectTheme: true })(HeadlineComponent); | 69 | const Headline = injectStyle(styles, { injectTheme: true })(HeadlineComponent); |
64 | |||
65 | const createH = (level: number) => (props: Omit<IProps, 'classes'>) => | 70 | const createH = (level: number) => (props: Omit<IProps, 'classes'>) => |
66 | ( | 71 | ( |
67 | <Headline level={level} {...props}> | 72 | <Headline level={level} {...props}> |