🐛 Annulation de la tentative de suggestion

pull/523/head
Mael 2019-04-19 18:07:29 +02:00
parent 6655217208
commit 837d595458
2 changed files with 8 additions and 6 deletions

View File

@ -6,7 +6,7 @@ import React, { Component } from 'react'
import { Trans } from 'react-i18next'
import type { Tracker } from 'Components/utils/withTracker'
type Props = { onEnd: () => void, tracker: Tracker }
type Props = { onEnd: () => void, tracker: Tracker, onCancel: () => void }
class FeedbackForm extends Component<Props> {
formRef: ?HTMLFormElement
@ -23,9 +23,6 @@ class FeedbackForm extends Component<Props> {
// $FlowFixMe
body: new FormData(this.formRef)
})
this.handleClose()
}
handleClose = () => {
this.props.onEnd()
}
@ -34,7 +31,7 @@ class FeedbackForm extends Component<Props> {
<ScrollToElement onlyIfNotVisible>
<div style={{ textAlign: 'end' }}>
<button
onClick={this.handleClose}
onClick={() => this.props.onCancel()}
className="ui__ link-button"
style={{ textDecoration: 'none', marginLeft: '0.3rem' }}
aria-label="close">

View File

@ -145,7 +145,12 @@ class PageFeedback extends Component<Props, State> {
)}
{this.state.showForm && (
<Form
onEnd={() => this.setState({ showThanks: true, showForm: false })}
onEnd={() =>
this.setState({ showThanks: false, showForm: false })
}
onCancel={() =>
this.setState({ showThanks: false, showForm: false })
}
/>
)}
</div>