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 'mastodon/actions/accounts'; import Button from 'mastodon/components/button'; const mapStateToProps = () => ({}); class Thanks extends PureComponent { static propTypes = { submitted: PropTypes.bool, onClose: PropTypes.func.isRequired, account: ImmutablePropTypes.map.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 ?