diff options
Diffstat (limited to 'packages/forms/src/wrapper/index.tsx')
-rw-r--r-- | packages/forms/src/wrapper/index.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/forms/src/wrapper/index.tsx b/packages/forms/src/wrapper/index.tsx index 633cc4c99..87e2c6513 100644 --- a/packages/forms/src/wrapper/index.tsx +++ b/packages/forms/src/wrapper/index.tsx | |||
@@ -1,3 +1,4 @@ | |||
1 | import classnames from 'classnames'; | ||
1 | import { observer } from 'mobx-react'; | 2 | import { observer } from 'mobx-react'; |
2 | import React, { Component } from 'react'; | 3 | import React, { Component } from 'react'; |
3 | import injectStyle from 'react-jss'; | 4 | import injectStyle from 'react-jss'; |
@@ -7,22 +8,27 @@ import styles from './styles'; | |||
7 | 8 | ||
8 | interface IProps extends IWithStyle { | 9 | interface IProps extends IWithStyle { |
9 | children: React.ReactNode; | 10 | children: React.ReactNode; |
11 | className?: string; | ||
10 | } | 12 | } |
11 | 13 | ||
12 | @observer | 14 | @observer |
13 | class Wrapper extends Component<IProps> { | 15 | class WrapperComponent extends Component<IProps> { |
14 | render() { | 16 | render() { |
15 | const { | 17 | const { |
16 | children, | 18 | children, |
17 | classes, | 19 | classes, |
20 | className, | ||
18 | } = this.props; | 21 | } = this.props; |
19 | 22 | ||
20 | return ( | 23 | return ( |
21 | <div className={classes.container}> | 24 | <div className={classnames({ |
25 | [`${classes.container}`]: true, | ||
26 | [`${className}`]: className, | ||
27 | })}> | ||
22 | {children} | 28 | {children} |
23 | </div> | 29 | </div> |
24 | ); | 30 | ); |
25 | } | 31 | } |
26 | } | 32 | } |
27 | 33 | ||
28 | export default injectStyle(styles)(Wrapper); | 34 | export const Wrapper = injectStyle(styles)(WrapperComponent); |