-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve app navigation with new sidebar (#66)
- Loading branch information
1 parent
4abe970
commit 0908a8c
Showing
83 changed files
with
6,764 additions
and
7,421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import DefaultPage from './destinations/page'; | ||
|
||
export default DefaultPage; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,20 @@ | ||
import { AppNavigation } from '@/components'; | ||
import { api } from '@ds-project/api/rsc'; | ||
import { getMetadata } from '@/lib/metadata'; | ||
import { getShowReleasesFlag } from '@/lib/flags'; | ||
|
||
import type { ReactNode } from 'react'; | ||
import { AppLayout } from '@/modules/app-layout'; | ||
|
||
export const metadata = getMetadata({ title: 'Dashboard' }); | ||
|
||
export default async function RootLayout({ | ||
children, | ||
connections, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
connections: ReactNode; | ||
}>) { | ||
const projects = await api.projects.getAll(); | ||
// const tabsSegment = useSelectedLayoutSegment('tabs'); | ||
// const projects = await api.projects.getAll(); | ||
const user = await api.users.getCurrent(); | ||
const showReleases = await getShowReleasesFlag(); | ||
// const showReleases = await getShowReleasesFlag(); | ||
|
||
return ( | ||
<> | ||
<header className="sticky top-0 w-full"> | ||
<AppNavigation | ||
className="px-2 pt-2" | ||
projects={projects} | ||
email={user.email} | ||
showReleases={showReleases} | ||
/> | ||
</header> | ||
<main className="flex min-h-screen w-full flex-col items-center"> | ||
{children} | ||
</main> | ||
</> | ||
); | ||
return <AppLayout email={user.email}>{connections}</AppLayout>; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
'use client'; | ||
|
||
import { shapes } from '@dicebear/collection'; | ||
import { createAvatar } from '@dicebear/core'; | ||
import { | ||
Avatar, | ||
AvatarFallback, | ||
AvatarImage, | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuLabel, | ||
DropdownMenuSeparator, | ||
DropdownMenuTrigger, | ||
LucideIcons, | ||
SidebarMenuButton, | ||
} from '@ds-project/components'; | ||
import Link from 'next/link'; | ||
import { useMemo } from 'react'; | ||
|
||
interface AccountMenuProps { | ||
email: string; | ||
} | ||
|
||
export function AccountMenu({ email }: AccountMenuProps) { | ||
const avatarUri = useMemo(() => { | ||
const avatar = createAvatar(shapes, { | ||
seed: email, | ||
}); | ||
|
||
return avatar.toDataUri(); | ||
}, [email]); | ||
|
||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<SidebarMenuButton | ||
size="lg" | ||
className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground" | ||
> | ||
<Avatar className="size-8 rounded-lg"> | ||
{/* TODO: improve alt description, perhaps with user name when we ask for it */} | ||
<AvatarImage src={avatarUri} alt={'User avatar'} /> | ||
<AvatarFallback className="rounded-lg">CN</AvatarFallback> | ||
</Avatar> | ||
<div className="grid flex-1 text-left text-sm leading-tight"> | ||
<span className="truncate font-semibold">{email}</span> | ||
<span className="truncate text-xs">{email}</span> | ||
</div> | ||
<LucideIcons.ChevronsUpDown className="ml-auto size-4" /> | ||
</SidebarMenuButton> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent | ||
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg" | ||
side="bottom" | ||
align="end" | ||
sideOffset={4} | ||
> | ||
<DropdownMenuLabel className="p-0 font-normal"> | ||
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm"> | ||
<Avatar className="size-8 rounded-lg"> | ||
{/* TODO: improve alt description, perhaps with user name when we ask for it */} | ||
<AvatarImage src={avatarUri} alt={'User avatar'} /> | ||
<AvatarFallback className="rounded-lg">CN</AvatarFallback> | ||
</Avatar> | ||
<div className="grid flex-1 text-left text-sm leading-tight"> | ||
<span className="truncate font-semibold">{email}</span> | ||
<span className="truncate text-xs">{email}</span> | ||
</div> | ||
</div> | ||
</DropdownMenuLabel> | ||
<DropdownMenuSeparator /> | ||
<DropdownMenuItem asChild> | ||
<Link href="/"> | ||
<LucideIcons.Home className="mr-2" /> | ||
Home | ||
</Link> | ||
</DropdownMenuItem> | ||
<DropdownMenuItem asChild> | ||
<Link href="/auth/logout"> | ||
<LucideIcons.LogOut className="mr-2" /> | ||
Log out | ||
</Link> | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { | ||
Separator, | ||
SidebarInset, | ||
SidebarProvider, | ||
SidebarTrigger, | ||
} from '@ds-project/components'; | ||
import { BreadcrumbNav } from './breadcrumb-nav'; | ||
import { AppSidebar } from './app-sidebar'; | ||
|
||
export function AppLayout({ | ||
children, | ||
email, | ||
}: { | ||
children: React.ReactNode; | ||
email: string; | ||
}) { | ||
return ( | ||
<SidebarProvider> | ||
<AppSidebar email={email} /> | ||
<SidebarInset> | ||
<header className="flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12"> | ||
<div className="flex items-center gap-2 px-4"> | ||
<SidebarTrigger className="-ml-1" /> | ||
<Separator orientation="vertical" className="mr-2 h-4" /> | ||
<BreadcrumbNav /> | ||
</div> | ||
</header> | ||
<div className="p-4">{children}</div> | ||
</SidebarInset> | ||
</SidebarProvider> | ||
); | ||
} |
Oops, something went wrong.