import React from 'react'; import cn from 'classnames'; import styles from './ChangeUsernameDialog.css'; import InputField from './InputField'; import Form from './Form'; import { Button, Dialog } from 'plugin-api/beta/client/components/ui'; class ChangeUsernameDialog extends React.Component { state = { showErrors: false, }; showErrors = () => { this.setState({ showErrors: true, }); }; confirmChanges = async () => { if (this.formHasError()) { this.showErrors(); } else { // await this.props.saveChanges this.props.closeDialog(); } }; formHasError = () => this.props.formData.confirmNewUsername !== this.props.formData.newUsername; render() { return ( ×

Confirm Username Change

You are attempting to change your username. Your new username will appear on all of your past and future comments.

Old Username: {this.props.username} New Username: {this.props.formData.newUsername}
Note: You will not be able to change your username again for 14 days
); } } export default ChangeUsernameDialog;