43e384554c
• Remove: - React, PureComponent global import and added those imports to files directly
39 lines
700 B
JavaScript
39 lines
700 B
JavaScript
import React from 'react'
|
|
import Text from './text'
|
|
|
|
export default class Form extends React.PureComponent {
|
|
|
|
static propTypes = {
|
|
children: PropTypes.any,
|
|
errorMessage: PropTypes.string,
|
|
onSubmit: PropTypes.func.isRequired,
|
|
}
|
|
|
|
componentDidUpdate (prevProps) {
|
|
|
|
}
|
|
|
|
render() {
|
|
const {
|
|
children,
|
|
errorMessage,
|
|
onSubmit,
|
|
} = this.props
|
|
|
|
return (
|
|
<form onSubmit={onSubmit} className={_s.default}>
|
|
{
|
|
!!errorMessage &&
|
|
<Text color='danger' className={_s.my10}>
|
|
{errorMessage}
|
|
</Text>
|
|
}
|
|
<div className={_s.default}>
|
|
{children}
|
|
</div>
|
|
</form>
|
|
)
|
|
}
|
|
|
|
}
|