-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-5582] chore: top nav and user menu improvement #8245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||||
| import { useState, useEffect } from "react"; | ||||||
| import { observer } from "mobx-react"; | ||||||
| import Link from "next/link"; | ||||||
| import { useParams } from "next/navigation"; | ||||||
| import { useParams, useRouter } from "next/navigation"; | ||||||
| // icons | ||||||
| import { LogOut, Settings, Settings2 } from "lucide-react"; | ||||||
| // plane imports | ||||||
|
|
@@ -22,6 +21,8 @@ type Props = { | |||||
| export const UserMenuRoot = observer(function UserMenuRoot(props: Props) { | ||||||
| const { size = "sm" } = props; | ||||||
| const { workspaceSlug } = useParams(); | ||||||
| // router | ||||||
| const router = useRouter(); | ||||||
| // store hooks | ||||||
| const { toggleAnySidebarDropdown } = useAppTheme(); | ||||||
| const { data: currentUser } = useUser(); | ||||||
|
|
@@ -76,22 +77,18 @@ export const UserMenuRoot = observer(function UserMenuRoot(props: Props) { | |||||
| > | ||||||
| <div className="flex flex-col gap-2"> | ||||||
| <span className="px-2 text-custom-sidebar-text-200 truncate">{currentUser?.email}</span> | ||||||
| <Link href={`/${workspaceSlug}/settings/account`}> | ||||||
| <CustomMenu.MenuItem> | ||||||
| <div className="flex w-full items-center gap-2 rounded text-xs"> | ||||||
| <Settings className="h-4 w-4 stroke-[1.5]" /> | ||||||
| <span>{t("settings")}</span> | ||||||
| </div> | ||||||
| </CustomMenu.MenuItem> | ||||||
| </Link> | ||||||
| <Link href={`/${workspaceSlug}/settings/account/preferences`}> | ||||||
| <CustomMenu.MenuItem> | ||||||
| <div className="flex w-full items-center gap-2 rounded text-xs"> | ||||||
| <Settings2 className="h-4 w-4 stroke-[1.5]" /> | ||||||
| <span>Preferences</span> | ||||||
| </div> | ||||||
| </CustomMenu.MenuItem> | ||||||
| </Link> | ||||||
| <CustomMenu.MenuItem onClick={() => router.push(`/${workspaceSlug}/settings/account`)}> | ||||||
| <div className="flex w-full items-center gap-2 rounded text-xs"> | ||||||
| <Settings className="h-4 w-4 stroke-[1.5]" /> | ||||||
| <span>{t("settings")}</span> | ||||||
| </div> | ||||||
| </CustomMenu.MenuItem> | ||||||
| <CustomMenu.MenuItem onClick={() => router.push(`/${workspaceSlug}/settings/account/preferences`)}> | ||||||
| <div className="flex w-full items-center gap-2 rounded text-xs"> | ||||||
| <Settings2 className="h-4 w-4 stroke-[1.5]" /> | ||||||
| <span>Preferences</span> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use translation for "Preferences" label. Line 89 hardcodes "Preferences" while line 83 uses Apply this diff to use translation: - <span>Preferences</span>
+ <span>{t("preferences")}</span>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| </div> | ||||||
| </CustomMenu.MenuItem> | ||||||
| </div> | ||||||
| <div className="my-1 border-t border-custom-border-200" /> | ||||||
| <div className={`${isUserInstanceAdmin ? "pb-2" : ""}`}> | ||||||
|
|
@@ -110,13 +107,11 @@ export const UserMenuRoot = observer(function UserMenuRoot(props: Props) { | |||||
| <> | ||||||
| <div className="my-1 border-t border-custom-border-200" /> | ||||||
| <div className="px-1"> | ||||||
| <Link href={GOD_MODE_URL}> | ||||||
| <CustomMenu.MenuItem> | ||||||
| <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"> | ||||||
| {t("enter_god_mode")} | ||||||
| </div> | ||||||
| </CustomMenu.MenuItem> | ||||||
| </Link> | ||||||
| <CustomMenu.MenuItem onClick={() => router.push(GOD_MODE_URL)}> | ||||||
| <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"> | ||||||
| {t("enter_god_mode")} | ||||||
| </div> | ||||||
| </CustomMenu.MenuItem> | ||||||
| </div> | ||||||
| </> | ||||||
| )} | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: makeplane/plane
Length of output: 4286
🏁 Script executed:
Repository: makeplane/plane
Length of output: 86
🏁 Script executed:
Repository: makeplane/plane
Length of output: 529
🏁 Script executed:
Repository: makeplane/plane
Length of output: 2208
🏁 Script executed:
Repository: makeplane/plane
Length of output: 719
🏁 Script executed:
Repository: makeplane/plane
Length of output: 41
🏁 Script executed:
Repository: makeplane/plane
Length of output: 104
🏁 Script executed:
Repository: makeplane/plane
Length of output: 2461
🏁 Script executed:
Repository: makeplane/plane
Length of output: 1631
🏁 Script executed:
Repository: makeplane/plane
Length of output: 1003
🏁 Script executed:
Repository: makeplane/plane
Length of output: 93
🏁 Script executed:
Repository: makeplane/plane
Length of output: 81
🏁 Script executed:
Repository: makeplane/plane
Length of output: 41
🏁 Script executed:
Repository: makeplane/plane
Length of output: 16068
🏁 Script executed:
Repository: makeplane/plane
Length of output: 1232
🏁 Script executed:
Repository: makeplane/plane
Length of output: 388
Add type guards for
workspaceSlugand translate the "Preferences" label.workspaceSlugfromuseParams()is potentiallyundefinedunder strict null checks (strictNullChecks: truein tsconfig). This would result in navigating to/${undefined}/settings/account. Add a guard or assertion (seequick-actions.tsxfor the pattern in this codebase). Additionally, the "Preferences" label on line 89 is hardcoded while "settings" on line 83 is translated—apply the samet()call for consistency.🤖 Prompt for AI Agents