Блокировка формы во время обработки запроса

This commit is contained in:
SleepWalker
2016-04-02 13:58:54 +03:00
parent 0162d1270f
commit df9283400d
6 changed files with 81 additions and 14 deletions

View File

@@ -102,6 +102,7 @@ export class Form extends Component {
static propTypes = {
id: PropTypes.string, // and id, that uniquely identifies form contents
isLoading: PropTypes.bool,
onSubmit: PropTypes.func,
onInvalid: PropTypes.func,
children: PropTypes.oneOfType([
@@ -112,6 +113,7 @@ export class Form extends Component {
static defaultProps = {
id: 'default',
isLoading: false,
onSubmit() {},
onInvalid() {}
};
@@ -129,11 +131,14 @@ export class Form extends Component {
}
render() {
const {isLoading} = this.props;
return (
<form
className={classNames(
styles.form,
{
[styles.isFormLoading]: isLoading,
[styles.formTouched]: this.state.isTouched
}
)}