Change username when it changes.

This commit is contained in:
gaba
2017-02-21 16:36:50 -08:00
parent 5d0730b4d5
commit 1b79a10580
3 changed files with 6 additions and 4 deletions
@@ -11,7 +11,8 @@ import I18n from 'coral-framework/modules/i18n/i18n';
import translations from '../translations';
const lang = new I18n(translations);
const CreateUsernameDialog = ({open, handleClose, offset, formData, handleSubmitUsername, handleChange, ...props}) => (
const CreateUsernameDialog = ({open, handleClose, offset, formData, handleSubmitUsername, handleChange, ...props}) => {
return (
<Dialog
className={styles.dialogusername}
id="createUsernameDialog"
@@ -31,7 +32,7 @@ const CreateUsernameDialog = ({open, handleClose, offset, formData, handleSubmit
<p className={styles.yourusername}>{lang.t('createdisplay.yourusername')}</p>
<FakeComment
className={styles.fakeComment}
username="Pepe"
username={formData.username}
created_at={Date.now()}
body={lang.t('createdisplay.fakecommentbody')}
/>
@@ -54,6 +55,7 @@ const CreateUsernameDialog = ({open, handleClose, offset, formData, handleSubmit
</div>
</div>
</Dialog>
);
);
};
export default CreateUsernameDialog;
@@ -39,7 +39,6 @@ class FakeComment extends React.Component {
onClick={() => {}}
parentCommentId={'commentID'}
currentUserId={{}}
banned={false}
/>
</div>
<div className="commentActionsRight">
@@ -29,6 +29,7 @@ class ChangeUsernameContainer extends Component {
constructor(props) {
super(props);
this.initialState.formData.username = props.user.username;
this.state = this.initialState;
this.handleChange = this.handleChange.bind(this);
this.handleSubmitUsername = this.handleSubmitUsername.bind(this);