import withLanguage from 'Components/utils/withLanguage' import withTracker from 'Components/utils/withTracker' import React, { Component } from 'react' import { Trans, translate } from 'react-i18next' import { connect } from 'react-redux' import { nextStepsSelector } from 'Selectors/analyseSelectors' import { noUserInputSelector } from 'Selectors/situationSelectors' import Smiley from './SatisfactionSmiley' @connect(state => ({ conversationStarted: state.conversationStarted, noUserInput: noUserInputSelector(state), nextSteps: nextStepsSelector(state) })) @translate() @withLanguage @withTracker export default class Sondage extends Component { state = { visible: true, showForm: false, askFeedbackTime: 'AFTER_FIRST_ESTIMATE' } handleClose = () => { this.setState({ visible: false }) } onSmileyClick = satisfaction => { this.props.tracker.push(['trackEvent', 'feedback', 'smiley', satisfaction]) this.setState({ showForm: true, satisfaction, visible: false }) } render() { let { satisfaction, showForm, visible } = this.state return (