Skip to content

Commit 392c8cf

Browse files
[WEB-5582] chore: top nav and user menu improvement (#8245)
* chore: user menu code refactor * chore: CustomizeNavigationDialog enhancements
1 parent c390604 commit 392c8cf

File tree

2 files changed

+24
-29
lines changed

2 files changed

+24
-29
lines changed

apps/web/core/components/navigation/customize-navigation-dialog.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,14 @@ export const CustomizeNavigationDialog: FC<TCustomizeNavigationDialogProps> = ob
259259
<div className="space-y-3">
260260
{/* Navigation Mode Radio Buttons */}
261261
<div className="space-y-2">
262-
<label className="flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-custom-background-90 cursor-pointer">
262+
<label className="flex gap-2 px-2 py-1.5 rounded-md hover:bg-custom-background-90 cursor-pointer">
263263
<input
264264
type="radio"
265265
name="navigation-mode"
266266
value="accordion"
267267
checked={projectPreferences.navigationMode === "accordion"}
268268
onChange={() => updateNavigationMode("accordion")}
269-
className="size-4 text-custom-primary-100 focus:ring-custom-primary-100"
269+
className="size-4 text-custom-primary-100 focus:ring-custom-primary-100 mt-1"
270270
/>
271271
<div className="flex-1">
272272
<div className="text-sm text-custom-text-200">{t("accordion_navigation_control")}</div>
@@ -276,14 +276,14 @@ export const CustomizeNavigationDialog: FC<TCustomizeNavigationDialogProps> = ob
276276
</div>
277277
</label>
278278

279-
<label className="flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-custom-background-90 cursor-pointer">
279+
<label className="flex gap-2 px-2 py-1.5 rounded-md hover:bg-custom-background-90 cursor-pointer">
280280
<input
281281
type="radio"
282282
name="navigation-mode"
283283
value="horizontal"
284284
checked={projectPreferences.navigationMode === "horizontal"}
285285
onChange={() => updateNavigationMode("horizontal")}
286-
className="size-4 text-custom-primary-100 focus:ring-custom-primary-100"
286+
className="size-4 text-custom-primary-100 focus:ring-custom-primary-100 mt-1"
287287
/>
288288
<div className="flex-1">
289289
<div className="text-sm text-custom-text-200">{t("horizontal_navigation_bar")}</div>

apps/web/core/components/workspace/sidebar/user-menu-root.tsx

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useState, useEffect } from "react";
22
import { observer } from "mobx-react";
3-
import Link from "next/link";
4-
import { useParams } from "next/navigation";
3+
import { useParams, useRouter } from "next/navigation";
54
// icons
65
import { LogOut, Settings, Settings2 } from "lucide-react";
76
// plane imports
@@ -22,6 +21,8 @@ type Props = {
2221
export const UserMenuRoot = observer(function UserMenuRoot(props: Props) {
2322
const { size = "sm" } = props;
2423
const { workspaceSlug } = useParams();
24+
// router
25+
const router = useRouter();
2526
// store hooks
2627
const { toggleAnySidebarDropdown } = useAppTheme();
2728
const { data: currentUser } = useUser();
@@ -76,22 +77,18 @@ export const UserMenuRoot = observer(function UserMenuRoot(props: Props) {
7677
>
7778
<div className="flex flex-col gap-2">
7879
<span className="px-2 text-custom-sidebar-text-200 truncate">{currentUser?.email}</span>
79-
<Link href={`/${workspaceSlug}/settings/account`}>
80-
<CustomMenu.MenuItem>
81-
<div className="flex w-full items-center gap-2 rounded text-xs">
82-
<Settings className="h-4 w-4 stroke-[1.5]" />
83-
<span>{t("settings")}</span>
84-
</div>
85-
</CustomMenu.MenuItem>
86-
</Link>
87-
<Link href={`/${workspaceSlug}/settings/account/preferences`}>
88-
<CustomMenu.MenuItem>
89-
<div className="flex w-full items-center gap-2 rounded text-xs">
90-
<Settings2 className="h-4 w-4 stroke-[1.5]" />
91-
<span>Preferences</span>
92-
</div>
93-
</CustomMenu.MenuItem>
94-
</Link>
80+
<CustomMenu.MenuItem onClick={() => router.push(`/${workspaceSlug}/settings/account`)}>
81+
<div className="flex w-full items-center gap-2 rounded text-xs">
82+
<Settings className="h-4 w-4 stroke-[1.5]" />
83+
<span>{t("settings")}</span>
84+
</div>
85+
</CustomMenu.MenuItem>
86+
<CustomMenu.MenuItem onClick={() => router.push(`/${workspaceSlug}/settings/account/preferences`)}>
87+
<div className="flex w-full items-center gap-2 rounded text-xs">
88+
<Settings2 className="h-4 w-4 stroke-[1.5]" />
89+
<span>Preferences</span>
90+
</div>
91+
</CustomMenu.MenuItem>
9592
</div>
9693
<div className="my-1 border-t border-custom-border-200" />
9794
<div className={`${isUserInstanceAdmin ? "pb-2" : ""}`}>
@@ -110,13 +107,11 @@ export const UserMenuRoot = observer(function UserMenuRoot(props: Props) {
110107
<>
111108
<div className="my-1 border-t border-custom-border-200" />
112109
<div className="px-1">
113-
<Link href={GOD_MODE_URL}>
114-
<CustomMenu.MenuItem>
115-
<div className="flex w-full items-center justify-center rounded bg-custom-primary-100/20 px-2 py-1 text-xs font-medium text-custom-primary-100 hover:bg-custom-primary-100/30 hover:text-custom-primary-200">
116-
{t("enter_god_mode")}
117-
</div>
118-
</CustomMenu.MenuItem>
119-
</Link>
110+
<CustomMenu.MenuItem onClick={() => router.push(GOD_MODE_URL)}>
111+
<div className="flex w-full items-center justify-center rounded bg-custom-primary-100/20 px-2 py-1 text-xs font-medium text-custom-primary-100 hover:bg-custom-primary-100/30 hover:text-custom-primary-200">
112+
{t("enter_god_mode")}
113+
</div>
114+
</CustomMenu.MenuItem>
120115
</div>
121116
</>
122117
)}

0 commit comments

Comments
 (0)