-
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
Showing
13 changed files
with
386 additions
and
15 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,58 @@ | ||
import { | ||
Breadcrumb, | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbList, | ||
BreadcrumbSeparator | ||
} from "@/components/ui/breadcrumb"; | ||
import { | ||
Tabs, | ||
TabsContent, | ||
TabsList, | ||
TabsTrigger | ||
} from "@/components/ui/tabs"; | ||
import { Code } from "bright"; | ||
|
||
const ContentAccordionPage = () => { | ||
return ( | ||
<div> | ||
<section className="w-full space-y-2"> | ||
<Breadcrumb> | ||
<BreadcrumbList> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink href="#">Docs</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
<BreadcrumbSeparator /> | ||
<BreadcrumbItem> | ||
<BreadcrumbLink href="#">Gluons</BreadcrumbLink> | ||
</BreadcrumbItem> | ||
</BreadcrumbList> | ||
</Breadcrumb> | ||
<h1 className="text-4xl font-semibold">ContentAccordion</h1> | ||
</section> | ||
<section className="flex h-full w-full py-10 m-auto items-center justify-start"> | ||
<Tabs defaultValue="preview" className="w-full"> | ||
<TabsList> | ||
<TabsTrigger value="preview">Preview</TabsTrigger> | ||
<TabsTrigger value="code">Code</TabsTrigger> | ||
</TabsList> | ||
<TabsContent value="preview" className="w-full border rounded-md p-10"> | ||
preview | ||
</TabsContent> | ||
<TabsContent value="code"> | ||
<Code | ||
lang="tsx" | ||
title="HoverGrid.tsx" | ||
lineNumbers | ||
className="w-full border rounded-md" | ||
> | ||
{`import React from "react";`} | ||
</Code> | ||
</TabsContent> | ||
</Tabs> | ||
</section> | ||
</div> | ||
) | ||
} | ||
|
||
export default ContentAccordionPage; |
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,32 @@ | ||
import type { Metadata } from "next"; | ||
import { Inter } from "next/font/google"; | ||
import "@/styles/globals.css"; | ||
import { cn } from "@/lib/utils"; | ||
import { ThemeProvider } from "@/components/providers/theme-provider"; | ||
import { SiteHeader } from "@/components/site-header"; | ||
import { Sidebar } from "@/components/sidebar"; | ||
import { Container } from "@/components/container"; | ||
|
||
const inter = Inter({ subsets: ["latin"] }); | ||
|
||
export const metadata: Metadata = { | ||
title: "Create Next App", | ||
description: "Generated by create next app", | ||
}; | ||
|
||
export default function BlocksLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
return ( | ||
<main> | ||
<div className="pt-16 h-full flex flex-row gap-4"> | ||
<Sidebar /> | ||
<Container> | ||
{children} | ||
</Container> | ||
</div> | ||
</main> | ||
); | ||
} |
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,41 @@ | ||
"use client"; | ||
|
||
import { useEffect } from "react"; | ||
import { useMediaQuery } from "usehooks-ts"; | ||
|
||
import { useSidebar } from "@/hooks/use-sidebar-store"; | ||
import { cn } from "@/lib/utils"; | ||
|
||
|
||
|
||
interface ContainerProps { | ||
children: React.ReactNode; | ||
}; | ||
|
||
export const Container = ({ | ||
children | ||
}: ContainerProps) => { | ||
const matches = useMediaQuery("(max-width: 1024px)"); | ||
const { | ||
collapsed, | ||
onCollapse, | ||
onExpand, | ||
} = useSidebar((state) => state); | ||
|
||
useEffect(() => { | ||
if (matches) { | ||
onCollapse(); | ||
} else { | ||
onExpand(); | ||
} | ||
}, [matches, onCollapse, onExpand]); | ||
|
||
return ( | ||
<div className={cn( | ||
"flex-1 p-8 overflow-auto", | ||
collapsed ? "ml-0" : "lg:ml-48" | ||
)}> | ||
{children} | ||
</div> | ||
) | ||
}; |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"use client"; | ||
|
||
// BACKLOG: Use localStorage to store open/collapsed state of sidebar | ||
// import { useLocalStorage } from "usehooks-ts"; | ||
// import { NavItem } from "./nav-item"; | ||
import { Wrapper } from "./wrapper"; | ||
// import { Toggle } from "./toggle"; | ||
// import { Navigation } from "./navigation"; | ||
// import { Footer } from "./footer"; | ||
import { useTheme } from "next-themes"; | ||
|
||
interface SidebarProps { | ||
storageKey?: string; | ||
}; | ||
|
||
export const Sidebar = ({ | ||
storageKey, | ||
}: SidebarProps) => { | ||
const { theme } = useTheme(); | ||
return ( | ||
<Wrapper> | ||
{/* <Toggle /> | ||
<Navigation /> | ||
<Footer /> */} | ||
Aside | ||
</Wrapper> | ||
); | ||
}; |
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,25 @@ | ||
"use client"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
import { useSidebar } from "@/hooks/use-sidebar-store"; | ||
|
||
interface WrapperProps { | ||
children: React.ReactNode; | ||
}; | ||
|
||
export const Wrapper = ({ | ||
children, | ||
}: WrapperProps) => { | ||
const { collapsed } = useSidebar((state) => state); | ||
|
||
return ( | ||
<aside | ||
className={cn( | ||
"fixed container py-8 left-0 flex flex-col w-48 h-full bg-background border-r", | ||
collapsed && "hidden" | ||
)} | ||
> | ||
{children} | ||
</aside> | ||
) | ||
}; |
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,13 @@ | ||
import { create } from "zustand"; | ||
|
||
interface SidebarStore { | ||
collapsed: boolean; | ||
onExpand: () => void; | ||
onCollapse: () => void; | ||
}; | ||
|
||
export const useSidebar = create<SidebarStore>((set) => ({ | ||
collapsed: false, | ||
onExpand: () => set(() => ({ collapsed: false })), | ||
onCollapse: () => set(() => ({ collapsed: true })), | ||
})); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.