Fix <EnquiryFormControlled /> Alert
This commit is contained in:
parent
077784b97d
commit
b55a6e4f7c
2 changed files with 8 additions and 3 deletions
|
|
@ -39,5 +39,6 @@
|
|||
.EnquiryForm--Alert {
|
||||
background: whitesmoke;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ class Form extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
resetForm = () => {
|
||||
this.setState({ ...this.initialState })
|
||||
resetForm = customState => {
|
||||
this.setState({ ...this.initialState, ...customState })
|
||||
this.inputs.forEach(input => {
|
||||
delete input.dataset.touched
|
||||
})
|
||||
|
|
@ -75,7 +75,11 @@ class Form extends Component {
|
|||
throw new Error('Network error')
|
||||
}
|
||||
})
|
||||
.then(this.resetForm)
|
||||
.then(
|
||||
this.resetForm({
|
||||
alert: 'Thanks for your enquiry, we will get back to you soon.'
|
||||
})
|
||||
)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
this.setState({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue