From 5157bea2b70158b047ed452d13b38810f2ed387f Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Thu, 10 Sep 2026 17:38:27 -0400 Subject: [PATCH] cosmetic adjustments --- src/components/LocaleSwitcherSelect.tsx | 44 +++++++--------- src/components/OrgSelector.tsx | 10 +--- src/components/OrgsTable.tsx | 32 ++++-------- src/components/ProfileIcon.tsx | 68 ++++++++++++++----------- 4 files changed, 68 insertions(+), 86 deletions(-) diff --git a/src/components/LocaleSwitcherSelect.tsx b/src/components/LocaleSwitcherSelect.tsx index b6f65aa7c..6fa76783c 100644 --- a/src/components/LocaleSwitcherSelect.tsx +++ b/src/components/LocaleSwitcherSelect.tsx @@ -1,19 +1,18 @@ "use client"; import { - DropdownMenu, - DropdownMenuContent, DropdownMenuItem, - DropdownMenuTrigger + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger } from "@app/components/ui/dropdown-menu"; -import { Button } from "@app/components/ui/button"; -import { Check, Globe, Languages } from "lucide-react"; -import clsx from "clsx"; +import { Check, Languages } from "lucide-react"; import { useTransition } from "react"; import { Locale } from "@/i18n/config"; import { setUserLocale } from "@/services/locale"; import { createApiClient } from "@app/lib/api"; import { useEnvContext } from "@app/hooks/useEnvContext"; +import { cn } from "@app/lib/cn"; type Props = { defaultValue: string; @@ -43,23 +42,18 @@ export default function LocaleSwitcherSelect({ const selected = items.find((item) => item.value === defaultValue); return ( - - - - - + + + + {selected?.label ?? label} + + {items.map((item) => ( {item.label} ))} - - + + ); } diff --git a/src/components/OrgSelector.tsx b/src/components/OrgSelector.tsx index 9742fdb90..3f5a38e8a 100644 --- a/src/components/OrgSelector.tsx +++ b/src/components/OrgSelector.tsx @@ -27,15 +27,7 @@ export function OrgSelector({ const selectedOrg = orgs?.find((org) => org.orgId === orgId); const picker = ( - +
sortableHeader("name", t("name")) }, + { + accessorKey: "orgId", + friendlyName: t("orgId"), + header: () => {t("orgId")} + }, { accessorKey: "createdAt", friendlyName: t("createdAt"), @@ -141,11 +146,6 @@ export default function OrgsTable({ ); } }, - { - accessorKey: "orgId", - friendlyName: t("orgId"), - header: () => {t("orgId")} - }, { accessorKey: "subnet", friendlyName: t("subnet"), @@ -164,31 +164,19 @@ export default function OrgsTable({ accessorKey: "userCount", friendlyName: t("users"), header: () => {t("users")}, - cell: ({ row }) => ( - - {row.original.userCount} - - ) + cell: ({ row }) => {row.original.userCount} }, { accessorKey: "siteCount", friendlyName: t("sites"), header: () => {t("sites")}, - cell: ({ row }) => ( - - {row.original.siteCount} - - ) + cell: ({ row }) => {row.original.siteCount} }, { accessorKey: "resourceCount", friendlyName: t("resources"), header: () => {t("resources")}, - cell: ({ row }) => ( - - {row.original.resourceCount} - - ) + cell: ({ row }) => {row.original.resourceCount} }, { @@ -205,7 +193,6 @@ export default function OrgsTable({ setIsDeleteModalOpen(true); }} variant="outline" - className="text-red-400 focus:text-destructive " > {t("delete")} @@ -288,8 +275,7 @@ export default function OrgsTable({ rowCount={rowCount} columnVisibility={{ subnet: false, - utilitySubnet: false, - orgId: false + utilitySubnet: false }} enableColumnVisibility stickyLeftColumn="name" diff --git a/src/components/ProfileIcon.tsx b/src/components/ProfileIcon.tsx index 92266916f..cf1d845d8 100644 --- a/src/components/ProfileIcon.tsx +++ b/src/components/ProfileIcon.tsx @@ -9,13 +9,16 @@ import { DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger, DropdownMenuTrigger } from "@app/components/ui/dropdown-menu"; import { useEnvContext } from "@app/hooks/useEnvContext"; import { toast } from "@app/hooks/useToast"; import { formatAxiosError } from "@app/lib/api"; import { getUserDisplayName } from "@app/lib/getUserDisplayName"; -import { Laptop, LogOut, Moon, Sun, Smartphone, Trash2 } from "lucide-react"; +import { Check, Laptop, Moon, Sun, Trash2 } from "lucide-react"; import { useTheme } from "next-themes"; import { useRouter } from "next/navigation"; import Link from "next/link"; @@ -149,42 +152,49 @@ export default function ProfileIcon() { > {t("changePassword")} - )} setOpenViewDevices(true)}> - {t("viewDevices") || "View Devices"} {t("theme")} - {(["light", "dark", "system"] as const).map( - (themeOption) => ( - handleThemeChange(themeOption)} - > - {themeOption === "light" && ( - - )} - {themeOption === "dark" && ( - - )} - {themeOption === "system" && ( - - )} - - {t(themeOption)} - - {userTheme === themeOption && ( - - - - )} - - ) - )} + + + {userTheme === "light" && ( + + )} + {userTheme === "dark" && ( + + )} + {userTheme === "system" && ( + + )} + {t(userTheme)} + + + {(["light", "dark", "system"] as const).map( + (themeOption) => ( + + handleThemeChange(themeOption) + } + className="flex items-center gap-2" + > + {userTheme === themeOption && ( + + )} + + {t(themeOption)} + + + ) + )} + + + {t("language")} {user?.type === UserType.Internal && !user?.serverAdmin && (