Skip to content

Commit b249358

Browse files
committed
feat: cleanup sidebar
1 parent 6eceeb4 commit b249358

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

apps/dashboard/app/demo/layout.tsx

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,34 @@
22

33
import {
44
BugIcon,
5-
ClockIcon,
65
FunnelIcon,
76
GlobeIcon,
87
HouseIcon,
98
InfoIcon,
109
ListIcon,
1110
MapPinIcon,
1211
TargetIcon,
12+
UserIcon,
1313
UsersIcon,
1414
XIcon,
1515
} from '@phosphor-icons/react';
16+
import { useAtom } from 'jotai';
1617
import Link from 'next/link';
1718
import { usePathname } from 'next/navigation';
1819
import { useCallback, useEffect, useState } from 'react';
20+
import { toast } from 'sonner';
1921
import { Logo } from '@/components/layout/logo';
2022
import { ThemeToggle } from '@/components/layout/theme-toggle';
2123
import { UserMenu } from '@/components/layout/user-menu';
2224
import { NotificationsPopover } from '@/components/notifications/notifications-popover';
2325
import { Button } from '@/components/ui/button';
2426
import { ScrollArea } from '@/components/ui/scroll-area';
2527
import { cn } from '@/lib/utils';
28+
import {
29+
dynamicQueryFiltersAtom,
30+
isAnalyticsRefreshingAtom,
31+
} from '@/stores/jotai/filterAtoms';
32+
import { AnalyticsToolbar } from '@/app/(main)/websites/[id]/_components/analytics-toolbar';
2633

2734
const DEMO_WEBSITE_ID = 'OXmNQsViBT-FOS_wZCTHc';
2835
const DEMO_WEBSITE_URL = 'https://www.databuddy.cc';
@@ -39,7 +46,7 @@ const demoNavigation = [
3946
},
4047
{
4148
name: 'Sessions',
42-
icon: ClockIcon,
49+
icon: UserIcon,
4350
href: `/demo/${DEMO_WEBSITE_ID}/sessions`,
4451
highlight: true,
4552
},
@@ -234,11 +241,39 @@ interface MainLayoutProps {
234241
}
235242

236243
export default function MainLayout({ children }: MainLayoutProps) {
244+
const [isRefreshing, setIsRefreshing] = useAtom(isAnalyticsRefreshingAtom);
245+
const [selectedFilters, setSelectedFilters] = useAtom(dynamicQueryFiltersAtom);
246+
247+
const handleRefresh = async () => {
248+
setIsRefreshing(true);
249+
try {
250+
// Simulate refresh for demo
251+
await new Promise(resolve => setTimeout(resolve, 1000));
252+
toast.success('Demo data refreshed');
253+
} catch {
254+
toast.error('Failed to refresh data');
255+
} finally {
256+
setIsRefreshing(false);
257+
}
258+
};
259+
237260
return (
238261
<div className="h-screen overflow-hidden bg-gradient-to-br from-background to-muted/20 text-foreground">
239262
<Sidebar />
240263
<main className="relative h-screen pt-16 md:pl-64">
241-
<div className="h-[calc(100vh-4rem)] overflow-y-scroll">{children}</div>
264+
<div className="h-[calc(100vh-4rem)] overflow-y-scroll">
265+
<div className="mx-auto max-w-[1600px] p-3 sm:p-4 lg:p-6">
266+
{/* Analytics toolbar for demo */}
267+
<AnalyticsToolbar
268+
isRefreshing={isRefreshing}
269+
onFiltersChange={setSelectedFilters}
270+
onRefresh={handleRefresh}
271+
selectedFilters={selectedFilters}
272+
/>
273+
274+
{children}
275+
</div>
276+
</div>
242277
</main>
243278
</div>
244279
);

apps/dashboard/components/layout/navigation/navigation-item.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ export function NavigationItem({
6969
<Icon
7070
aria-hidden="true"
7171
className={cn(
72-
'h-5 w-5 transition-colors duration-200',
72+
'h-4 w-4 transition-colors duration-200',
7373
isActive
7474
? 'text-primary'
7575
: 'not-dark:text-primary group-hover:text-primary'
7676
)}
77-
size={32}
7877
weight="duotone"
7978
/>
8079
</span>

0 commit comments

Comments
 (0)