Skip to content

Commit 2b69307

Browse files
getting navigation to work
1 parent 819aea2 commit 2b69307

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

web/apps/labelstudio/src/components/SidebarMenu/SidebarMenu.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
&__navigation {
77
width: calc(var(--menu-sidebar-width) + 1px);
88
display: flex;
9+
10+
& .main-menu {
11+
background: var(--sand_100);
12+
13+
&__item{
14+
background: var(--sand_100);
15+
16+
&_active{
17+
background: var(--sand_200);
18+
pointer-events: all;
19+
}
20+
}
21+
}
922
}
1023

1124
&__content {

web/libs/core/src/pages/AccountSettings/AccountSettings.tsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
import { useMemo } from "react";
22
import { Redirect } from "react-router-dom";
3-
import { useAPI } from "../../../../../apps/labelstudio/src/providers/ApiProvider";
4-
import { useCurrentUser } from "../../../../../apps/labelstudio/src/providers/CurrentUser";
5-
// import { SidebarMenu } from "../../../../../apps/labelstudio/src/components/SidebarMenu/SidebarMenu";
3+
import { SidebarMenu } from "/apps/labelstudio/src/components/SidebarMenu/SidebarMenu";
64
import styles from "./AccountSettings.module.scss";
75
import { accountSettingsSections } from "./sections";
86
import { Card } from "@humansignal/ui";
97

108
export const AccountSettingsPage = () => {
11-
const api = useAPI();
12-
const { user } = useCurrentUser();
139
const menuItems = useMemo(
14-
() => accountSettingsSections.map(({ title, id }) => ({ title, path: `#${id}` })),
10+
() =>
11+
accountSettingsSections.map(({ title, id }) => ({
12+
title,
13+
path: () => {
14+
if (!window?.location) return;
15+
window.location.hash = `#${id}`;
16+
},
17+
})),
1518
[accountSettingsSections],
1619
);
1720

1821
return (
1922
<div className={styles.accountSettings}>
20-
{/* <SidebarMenu menuItems={menuItems} path={AccountSettingsPage.path}> */}
21-
<div className={styles.accountSettings__content}>
22-
{accountSettingsSections?.map(({ component: Section, id }: any) => (
23-
<Card key={id}>
24-
<Section />
25-
</Card>
26-
))}
27-
</div>
28-
{/* </SidebarMenu> */}
23+
<SidebarMenu menuItems={menuItems} path={AccountSettingsPage.path}>
24+
<div className={styles.accountSettings__content}>
25+
{accountSettingsSections?.map(({ component: Section, id }: any) => (
26+
<Card key={id}>
27+
<Section />
28+
</Card>
29+
))}
30+
</div>
31+
</SidebarMenu>
2932
</div>
3033
);
3134
};

0 commit comments

Comments
 (0)