Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
feat(ui): add navbar theme toggle (#8244)
Andrew Huang873f708c7195
diff --git a/frontend/src/components/v3/platform/ThemeProvider/ThemeProvider.tsx b/frontend/src/components/v3/platform/ThemeProvider/ThemeProvider.tsxindex 74a5ad5da3..99b66ec666 100644--- a/frontend/src/components/v3/platform/ThemeProvider/ThemeProvider.tsx+++ b/frontend/src/components/v3/platform/ThemeProvider/ThemeProvider.tsx@@ -6,7 +6,7 @@ import { isDarkAuthPath } from "./auth-theme";export type Theme = "dark" | "light" | "system";export type ResolvedTheme = Exclude<Theme, "system">;-export type ThemeChangeSource = "command-menu" | "profile-menu";+export type ThemeChangeSource = "command-menu" | "navbar-toggle" | "profile-menu";type ThemeContextValue = {theme: Theme;diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsxindex 9123e9208e..120bd19add 100644--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx@@ -155,7 +155,7 @@ export const INFISICAL_SUPPORT_OPTIONS = [export const Navbar = () => {const { user } = useUser();- const { theme, setTheme } = useTheme();+ const { theme, resolvedTheme, setTheme } = useTheme();const { subscription } = useSubscription();const { currentOrg, isSubOrganization } = useOrganization();const { config: serverConfig } = useServerConfig();@@ -711,6 +711,22 @@ export const Navbar = () => {</DropdownMenu><AnnouncementNavButton /><NotificationDropdown />+ <Tooltip>+ <TooltipTrigger asChild>+ <IconButton+ variant="outline"+ size="sm"+ className="hidden sm:inline-flex"+ aria-label={`Switch to ${resolvedTheme === "dark" ? "light" : "dark"} theme`}+ onClick={() => setTheme(resolvedTheme === "dark" ? "light" : "dark", "navbar-toggle")}+ >+ {resolvedTheme === "dark" ? <Sun /> : <Moon />}+ </IconButton>+ </TooltipTrigger>+ <TooltipContent side="bottom">+ Switch to {resolvedTheme === "dark" ? "light" : "dark"} theme+ </TooltipContent>+ </Tooltip><DropdownMenu modal={false}><DropdownMenuTrigger asChild><IconButton variant="outline" size="sm" aria-label="User menu">diff --git a/frontend/src/lib/analytics/events.ts b/frontend/src/lib/analytics/events.tsindex c506be1d6d..e6c0418c66 100644--- a/frontend/src/lib/analytics/events.ts+++ b/frontend/src/lib/analytics/events.ts@@ -44,7 +44,7 @@ export type OrganizationAnalyticsEventMap = {export type OrganizationAnalyticsEvent = keyof OrganizationAnalyticsEventMap;export type ThemePreferenceChangedProperties = {- source: "command-menu" | "profile-menu";+ source: "command-menu" | "navbar-toggle" | "profile-menu";theme: "dark" | "light" | "system";resolvedTheme: "dark" | "light";};