|
1 | 1 | 'use client'; |
2 | 2 |
|
| 3 | +import { updateSidebarState } from '@/actions/sidebar'; |
3 | 4 | import Chat from '@/components/ai/chat'; |
4 | 5 | import { CheckoutCompleteDialog } from '@/components/dialogs/checkout-complete-dialog'; |
5 | 6 | import { NotificationBell } from '@/components/notifications/notification-bell'; |
6 | 7 | import { OrganizationSwitcher } from '@/components/organization-switcher'; |
7 | | -import { updateSidebarState } from '@/actions/sidebar'; |
8 | 8 | import { SidebarProvider, useSidebar } from '@/context/sidebar-context'; |
9 | 9 | import { authClient } from '@/utils/auth-client'; |
10 | | -import { |
11 | | - CertificateCheck, |
12 | | - Logout, |
13 | | - Settings, |
14 | | -} from '@carbon/icons-react'; |
| 10 | +import { CertificateCheck, Logout, Settings } from '@carbon/icons-react'; |
15 | 11 | import { |
16 | 12 | DropdownMenu, |
17 | 13 | DropdownMenuContent, |
@@ -40,16 +36,16 @@ import { |
40 | 36 | HStack, |
41 | 37 | Logo, |
42 | 38 | Text, |
43 | | - ThemeToggle, |
| 39 | + ThemeSwitcher, |
44 | 40 | } from '@trycompai/design-system'; |
45 | 41 | import { useAction } from 'next-safe-action/hooks'; |
46 | 42 | import { useTheme } from 'next-themes'; |
47 | 43 | import Link from 'next/link'; |
48 | 44 | import { usePathname, useRouter } from 'next/navigation'; |
49 | 45 | import { Suspense, useCallback, useRef } from 'react'; |
50 | 46 | import { SettingsSidebar } from '../settings/components/SettingsSidebar'; |
51 | | -import { AppSidebar } from './AppSidebar'; |
52 | 47 | import { getAppShellSearchGroups } from './app-shell-search-groups'; |
| 48 | +import { AppSidebar } from './AppSidebar'; |
53 | 49 | import { ConditionalOnboardingTracker } from './ConditionalOnboardingTracker'; |
54 | 50 |
|
55 | 51 | interface AppShellWrapperProps { |
@@ -94,7 +90,7 @@ function AppShellWrapperContent({ |
94 | 90 | isOnlyAuditor, |
95 | 91 | user, |
96 | 92 | }: AppShellWrapperContentProps) { |
97 | | - const { resolvedTheme, setTheme } = useTheme(); |
| 93 | + const { theme, resolvedTheme, setTheme } = useTheme(); |
98 | 94 | const pathname = usePathname(); |
99 | 95 | const router = useRouter(); |
100 | 96 | const { isCollapsed, setIsCollapsed } = useSidebar(); |
@@ -144,7 +140,11 @@ function AppShellWrapperContent({ |
144 | 140 | /> |
145 | 141 | </Link> |
146 | 142 | <span className="pl-3 pr-1 text-muted-foreground">/</span> |
147 | | - <OrganizationSwitcher organizations={organizations} organization={organization} logoUrls={logoUrls} /> |
| 143 | + <OrganizationSwitcher |
| 144 | + organizations={organizations} |
| 145 | + organization={organization} |
| 146 | + logoUrls={logoUrls} |
| 147 | + /> |
148 | 148 | </HStack> |
149 | 149 | } |
150 | 150 | centerContent={<CommandSearch groups={searchGroups} placeholder="Search..." />} |
@@ -182,10 +182,12 @@ function AppShellWrapperContent({ |
182 | 182 | <DropdownMenuSeparator /> |
183 | 183 | <div className="flex items-center justify-between px-2 py-1.5"> |
184 | 184 | <Text size="sm">Theme</Text> |
185 | | - <ThemeToggle |
| 185 | + <ThemeSwitcher |
186 | 186 | size="sm" |
187 | | - isDark={resolvedTheme === 'dark'} |
188 | | - onChange={(isDark) => setTheme(isDark ? 'dark' : 'light')} |
| 187 | + value={(theme ?? 'system') as 'light' | 'dark' | 'system'} |
| 188 | + defaultValue="system" |
| 189 | + onChange={(value) => setTheme(value)} |
| 190 | + showSystem |
189 | 191 | /> |
190 | 192 | </div> |
191 | 193 | <DropdownMenuSeparator /> |
|
0 commit comments