Fix my account page UI

This commit is contained in:
Yang Luo 2024-03-08 15:18:18 +08:00
parent 0108b58db4
commit 3527e070a0

View File

@ -999,7 +999,7 @@ class UserEditPage extends React.Component {
<Card size="small" title={ <Card size="small" title={
(this.props.account === null) ? i18next.t("user:User Profile") : ( (this.props.account === null) ? i18next.t("user:User Profile") : (
<div> <div>
{this.state.mode === "add" ? i18next.t("user:New User") : i18next.t("user:Edit User")}&nbsp;&nbsp;&nbsp;&nbsp; {this.state.mode === "add" ? i18next.t("user:New User") : (this.isSelf() ? i18next.t("account:My Account") : i18next.t("user:Edit User"))}&nbsp;&nbsp;&nbsp;&nbsp;
<Button onClick={() => this.submitUserEdit(false)}>{i18next.t("general:Save")}</Button> <Button onClick={() => this.submitUserEdit(false)}>{i18next.t("general:Save")}</Button>
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitUserEdit(true)}>{i18next.t("general:Save & Exit")}</Button> <Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitUserEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteUser()}>{i18next.t("general:Cancel")}</Button> : null} {this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteUser()}>{i18next.t("general:Cancel")}</Button> : null}
@ -1094,7 +1094,9 @@ class UserEditPage extends React.Component {
} }
} }
} else { } else {
this.props.history.push(`/users/${this.state.user.owner}/${this.state.user.name}`); if (location.pathname !== "/account") {
this.props.history.push(`/users/${this.state.user.owner}/${this.state.user.name}`);
}
} }
} else { } else {
if (exitAfterSave) { if (exitAfterSave) {