From d328c9e61bb9df8b1c12f37930645790099ad0a0 Mon Sep 17 00:00:00 2001
From: Ed L
Date: Tue, 4 Jan 2022 13:26:42 +0000
Subject: [PATCH] feat(profile): add link to username settings (#364)
---
src/pages/settings/panes/Profile.tsx | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/pages/settings/panes/Profile.tsx b/src/pages/settings/panes/Profile.tsx
index b13c97af..8112277b 100644
--- a/src/pages/settings/panes/Profile.tsx
+++ b/src/pages/settings/panes/Profile.tsx
@@ -1,5 +1,6 @@
import { Markdown } from "@styled-icons/boxicons-logos";
import { observer } from "mobx-react-lite";
+import { useHistory } from "react-router-dom";
import { Profile as ProfileI } from "revolt-api/types/Users";
import styles from "./Panes.module.scss";
@@ -21,11 +22,13 @@ import AutoComplete, {
useAutoComplete,
} from "../../../components/common/AutoComplete";
import Button from "../../../components/ui/Button";
+import Tip from "../../../components/ui/Tip";
export const Profile = observer(() => {
const status = useContext(StatusContext);
const translate = useTranslation();
const client = useClient();
+ const history = useHistory();
const [profile, setProfile] = useState(undefined);
@@ -49,6 +52,10 @@ export const Profile = observer(() => {
if (!changed) setChanged(true);
}
+ function switchPage(to: string) {
+ history.replace(`/settings/${to}`);
+ }
+
const {
onChange,
onKeyUp,
@@ -193,6 +200,12 @@ export const Profile = observer(() => {
+
+ Want to change your username?{" "}
+ switchPage("account")}>
+ Head over to your account settings.
+
+
);
});