import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; import { unfollowAccount, muteAccount, blockAccount, } from 'flavours/glitch/actions/accounts'; import { Button } from 'flavours/glitch/components/button'; const mapStateToProps = () => ({}); class Thanks extends PureComponent { static propTypes = { submitted: PropTypes.bool, onClose: PropTypes.func.isRequired, account: ImmutablePropTypes.record.isRequired, dispatch: PropTypes.func.isRequired, }; handleCloseClick = () => { const { onClose } = this.props; onClose(); }; handleUnfollowClick = () => { const { dispatch, account, onClose } = this.props; dispatch(unfollowAccount(account.get('id'))); onClose(); }; handleMuteClick = () => { const { dispatch, account, onClose } = this.props; dispatch(muteAccount(account.get('id'))); onClose(); }; handleBlockClick = () => { const { dispatch, account, onClose } = this.props; dispatch(blockAccount(account.get('id'))); onClose(); }; render () { const { account, submitted } = this.props; return ( <>
{submitted ?