import React from 'react'; import PropTypes from 'prop-types'; import cn from 'classnames'; import { Button } from 'plugin-api/beta/client/components/ui'; import styles from './DeleteMyAccountStep.css'; import InputField from './InputField'; import { t } from 'plugin-api/beta/client/services'; const initialState = { showError: false, }; class DeleteMyAccountStep3 extends React.Component { state = initialState; phrase = 'delete'; showError = () => { this.setState({ showError: true, }); }; clear = () => { this.setState(initialState); }; deleteAndContinue = async () => { if (this.formHasError()) { this.showError(); return; } await this.props.requestAccountDeletion(); this.clear(); this.props.goToNextStep(); }; formHasError = () => !this.props.formData.confirmPhrase || this.props.formData.confirmPhrase !== this.phrase; render() { return (
{t('delete_request.step_3.description')}