Web: People/Components: Added handling of the cancel button
This commit is contained in:
parent
ea9f691e1a
commit
5df3850527
@ -60,13 +60,16 @@ class SectionBodyContent extends React.PureComponent{
|
||||
}
|
||||
|
||||
onBackClick = () => {
|
||||
const {profile, settings} = this.props
|
||||
|
||||
this.props.history.push(`${settings.homepage}/edit/${profile.userName}`)
|
||||
this.returnToEditor();
|
||||
}
|
||||
|
||||
onCloseAvatarEditor = () => {
|
||||
console.log("onCloseAvatarEditor")
|
||||
onCancel = () => {
|
||||
this.returnToEditor();
|
||||
}
|
||||
|
||||
returnToEditor = () => {
|
||||
const {profile, settings} = this.props
|
||||
this.props.history.push(`${settings.homepage}/edit/${profile.userName}`)
|
||||
}
|
||||
|
||||
onSaveAvatar = (isUpdate, result) => {
|
||||
@ -181,6 +184,7 @@ class SectionBodyContent extends React.PureComponent{
|
||||
visible={true}
|
||||
onClose={this.onCloseAvatarEditor}
|
||||
onSave={this.onSaveAvatar}
|
||||
onCancel={this.onCancel}
|
||||
onLoadFile={this.onLoadFileAvatar}
|
||||
headerLabel={t("EditPhoto")}
|
||||
selectNewPhotoLabel={t("selectNewPhotoLabel")}
|
||||
|
@ -71,6 +71,10 @@ class AvatarEditor extends React.Component {
|
||||
this.saveAvatar();
|
||||
};
|
||||
|
||||
onCancelButtonClick = () => {
|
||||
this.props.onCancel();
|
||||
}
|
||||
|
||||
saveAvatar = () => {
|
||||
if (!this.state.existImage) {
|
||||
this.props.onSave(this.state.existImage);
|
||||
@ -206,7 +210,7 @@ class AvatarEditor extends React.Component {
|
||||
label={cancelButtonLabel}
|
||||
primary={false}
|
||||
size="big"
|
||||
onClick={this.onSaveButtonClick}
|
||||
onClick={this.onCancelButtonClick}
|
||||
/>
|
||||
</StyledButtonsWrapper>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user