Skip to content

Commit 425cb16

Browse files
authored
On account settings, renamed tab "Preferences" into "Password" (#4618)
1 parent 0b2769f commit 425cb16

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

frontend/app/src/pages/profile.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { useAuth } from "@/hooks/useAuth";
22
import { UserProfilePage } from "@/screens/user-profile/user-profile";
3+
import { constructPath } from "@/utils/fetch";
34
import { Navigate } from "react-router-dom";
45

56
export function Component() {
67
const auth = useAuth();
78

89
if (!auth.isAuthenticated) {
9-
return <Navigate to={"/"} />;
10+
return <Navigate to={constructPath("/")} />;
1011
}
1112

1213
return <UserProfilePage />;

frontend/app/src/screens/user-profile/tab-preferences.tsx renamed to frontend/app/src/screens/user-profile/tab-update-password.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type UpdatePasswordFormData = {
1313
confirmPassword: string;
1414
};
1515

16-
export default function TabPreferences() {
16+
export default function TabUpdatePassword() {
1717
const [updateAccountPassword] = useMutation(UPDATE_ACCOUNT_PASSWORD);
1818

1919
const onSubmit = async ({ newPassword }: UpdatePasswordFormData) => {

frontend/app/src/screens/user-profile/user-profile.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import { gql, useQuery } from "@apollo/client";
1212
import { useAtomValue } from "jotai";
1313
import { StringParam, useQueryParam } from "use-query-params";
1414
import NoDataFound from "../errors/no-data-found";
15-
import TabPreferences from "./tab-preferences";
1615
import TabProfile from "./tab-profile";
1716
import TabTokens from "./tab-tokens";
17+
import TabUpdatePassword from "./tab-update-password";
1818

1919
const PROFILE_TABS = {
2020
PROFILE: "profile",
2121
TOKENS: "tokens",
22-
PREFERENCES: "preferences",
22+
PASSWORD: "password",
2323
};
2424

2525
const tabs = [
@@ -32,15 +32,15 @@ const tabs = [
3232
name: PROFILE_TABS.TOKENS,
3333
},
3434
{
35-
label: "Preferences",
36-
name: PROFILE_TABS.PREFERENCES,
35+
label: "Password",
36+
name: PROFILE_TABS.PASSWORD,
3737
},
3838
];
3939

4040
const renderContent = (tab: string | null | undefined) => {
4141
switch (tab) {
42-
case PROFILE_TABS.PREFERENCES:
43-
return <TabPreferences />;
42+
case PROFILE_TABS.PASSWORD:
43+
return <TabUpdatePassword />;
4444
case PROFILE_TABS.TOKENS:
4545
return <TabTokens />;
4646
default:

0 commit comments

Comments
 (0)