-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
618b66c
commit 9e24d68
Showing
7 changed files
with
10,733 additions
and
12,764 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import { | ||
SubNav, | ||
SubNavTitle, | ||
SubNavActions, | ||
SubNavSubtitle | ||
} from '@/components/sub-nav' | ||
import { SidebarNav } from '@/components/sidebar-nav' | ||
import { Main } from '@/components/main' | ||
import type { PropsWithChildren } from 'react' | ||
import { MainNav } from '@/components/teams/main-nav' | ||
import DefaultLayout from '@/components/default-layout' | ||
|
||
type PageProps = { | ||
children?: React.ReactNode | ||
export interface NextPageProps<TeamSlug = string> { | ||
params: { team: TeamSlug } | ||
searchParams?: { [key: string]: string | string[] | undefined } | ||
} | ||
|
||
export default function Layout({ children }: PageProps) { | ||
export default function Layout({ | ||
params, | ||
children | ||
}: PropsWithChildren<NextPageProps>) { | ||
return ( | ||
<> | ||
<DefaultLayout>{children}</DefaultLayout> | ||
<DefaultLayout | ||
fallback={<MainNav teamId={params.team} className="mx-6" />} | ||
> | ||
{children} | ||
</DefaultLayout> | ||
</> | ||
) | ||
} |
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,57 @@ | ||
import Link from 'next/link' | ||
import { headers } from 'next/headers' | ||
import { cn } from '@/lib/utils' | ||
import { buttonVariants } from '@/components/ui/button' | ||
|
||
export interface MainNavProps extends React.HTMLAttributes<HTMLElement> { | ||
teamId: string | ||
} | ||
|
||
export function MainNav({ className, teamId, ...props }: MainNavProps) { | ||
const headerList = headers() | ||
const pathname = headerList.get('x-pathname') | ||
|
||
const nav = [ | ||
{ | ||
name: 'Dashboard', | ||
link: `/team/${teamId}/dashboard` | ||
}, | ||
{ | ||
name: 'Workloads', | ||
link: `/team/${teamId}/workloads` | ||
}, | ||
{ | ||
name: 'Solutions', | ||
link: `/team/${teamId}/solutions` | ||
}, | ||
{ | ||
name: 'Lenses', | ||
link: `/team/${teamId}/lenses` | ||
}, | ||
{ | ||
name: 'Profiles', | ||
link: `/team/${teamId}/profiles` | ||
} | ||
] | ||
|
||
return ( | ||
<nav | ||
className={cn('flex items-center space-x-4 lg:space-x-6', className)} | ||
{...props} | ||
> | ||
{nav.map((item, idx) => ( | ||
<Link | ||
key={idx} | ||
href={item.link} | ||
className={cn( | ||
buttonVariants({ variant: 'ghost' }), | ||
'hover:bg-transparent hover:bg-muted hover:rounded', | ||
'justify-start' | ||
)} | ||
> | ||
{item.name} | ||
</Link> | ||
))} | ||
</nav> | ||
) | ||
} |