mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
feat(profile): add link to username settings (#364)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { Markdown } from "@styled-icons/boxicons-logos";
|
import { Markdown } from "@styled-icons/boxicons-logos";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
import { useHistory } from "react-router-dom";
|
||||||
import { Profile as ProfileI } from "revolt-api/types/Users";
|
import { Profile as ProfileI } from "revolt-api/types/Users";
|
||||||
|
|
||||||
import styles from "./Panes.module.scss";
|
import styles from "./Panes.module.scss";
|
||||||
@@ -21,11 +22,13 @@ import AutoComplete, {
|
|||||||
useAutoComplete,
|
useAutoComplete,
|
||||||
} from "../../../components/common/AutoComplete";
|
} from "../../../components/common/AutoComplete";
|
||||||
import Button from "../../../components/ui/Button";
|
import Button from "../../../components/ui/Button";
|
||||||
|
import Tip from "../../../components/ui/Tip";
|
||||||
|
|
||||||
export const Profile = observer(() => {
|
export const Profile = observer(() => {
|
||||||
const status = useContext(StatusContext);
|
const status = useContext(StatusContext);
|
||||||
const translate = useTranslation();
|
const translate = useTranslation();
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
|
const history = useHistory();
|
||||||
|
|
||||||
const [profile, setProfile] = useState<undefined | ProfileI>(undefined);
|
const [profile, setProfile] = useState<undefined | ProfileI>(undefined);
|
||||||
|
|
||||||
@@ -49,6 +52,10 @@ export const Profile = observer(() => {
|
|||||||
if (!changed) setChanged(true);
|
if (!changed) setChanged(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function switchPage(to: string) {
|
||||||
|
history.replace(`/settings/${to}`);
|
||||||
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
onChange,
|
onChange,
|
||||||
onKeyUp,
|
onKeyUp,
|
||||||
@@ -193,6 +200,12 @@ export const Profile = observer(() => {
|
|||||||
<Text id="app.special.modals.actions.save" />
|
<Text id="app.special.modals.actions.save" />
|
||||||
</Button>
|
</Button>
|
||||||
</p>
|
</p>
|
||||||
|
<Tip>
|
||||||
|
<span>Want to change your username?</span>{" "}
|
||||||
|
<a onClick={() => switchPage("account")}>
|
||||||
|
Head over to your account settings.
|
||||||
|
</a>
|
||||||
|
</Tip>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user