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