diff options
Diffstat (limited to 'packages/ui/src/headline/index.tsx')
-rw-r--r-- | packages/ui/src/headline/index.tsx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/packages/ui/src/headline/index.tsx b/packages/ui/src/headline/index.tsx index 7eabfcf80..bf3d4418c 100644 --- a/packages/ui/src/headline/index.tsx +++ b/packages/ui/src/headline/index.tsx | |||
@@ -1,8 +1,8 @@ | |||
1 | import { Theme } from '@meetfranz/theme'; | ||
2 | import classnames from 'classnames'; | 1 | import classnames from 'classnames'; |
3 | import React, { Component } from 'react'; | 2 | import React, { Component } from 'react'; |
4 | import injectStyle from 'react-jss'; | 3 | import injectStyle from 'react-jss'; |
5 | 4 | ||
5 | import { Theme } from '../../../theme'; | ||
6 | import { IWithStyle, Omit } from '../typings/generic'; | 6 | import { IWithStyle, Omit } from '../typings/generic'; |
7 | 7 | ||
8 | interface IProps extends IWithStyle { | 8 | interface IProps extends IWithStyle { |
@@ -37,13 +37,7 @@ const styles = (theme: Theme) => ({ | |||
37 | 37 | ||
38 | class HeadlineComponent extends Component<IProps> { | 38 | class HeadlineComponent extends Component<IProps> { |
39 | render() { | 39 | render() { |
40 | const { | 40 | const { classes, level, className, children, id } = this.props; |
41 | classes, | ||
42 | level, | ||
43 | className, | ||
44 | children, | ||
45 | id, | ||
46 | } = this.props; | ||
47 | 41 | ||
48 | return React.createElement( | 42 | return React.createElement( |
49 | `h${level}`, | 43 | `h${level}`, |
@@ -63,7 +57,12 @@ class HeadlineComponent extends Component<IProps> { | |||
63 | 57 | ||
64 | const Headline = injectStyle(styles)(HeadlineComponent); | 58 | const Headline = injectStyle(styles)(HeadlineComponent); |
65 | 59 | ||
66 | const createH = (level: number) => (props: Omit<IProps, 'classes' | 'theme'>) => <Headline level={level} {...props}>{props.children}</Headline>; | 60 | const createH = (level: number) => (props: Omit<IProps, 'classes' | 'theme'>) => |
61 | ( | ||
62 | <Headline level={level} {...props}> | ||
63 | {props.children} | ||
64 | </Headline> | ||
65 | ); | ||
67 | 66 | ||
68 | export const H1 = createH(1); | 67 | export const H1 = createH(1); |
69 | export const H2 = createH(2); | 68 | export const H2 = createH(2); |