Last active
October 14, 2024 20:30
-
-
Save sturmenta/2dc2006ee17a8529fc63535b82626721 to your computer and use it in GitHub Desktop.
Sidebar for mobile and desktop using shadcn-ui
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
"use client" | |
import { WithSidebar } from "@/components/with-sidebar" | |
export const Dashboard = () => { | |
return ( | |
<WithSidebar | |
sidebarContent={SidebarContent} | |
mobileDashboardHeader={CustomHeader}> | |
<div className="p-10"> | |
<p>dashboard</p> | |
</div> | |
</WithSidebar> | |
) | |
} | |
const CustomHeader = () => { | |
return ( | |
<div className="flex px-4"> | |
<span className="text-2xl font-extrabold">Floop</span> | |
</div> | |
) | |
} | |
const SidebarContent = () => { | |
return ( | |
<div> | |
<CustomHeader /> | |
<div className="mt-6"> | |
{["Inicio", "Preguntas"].map((item, index) => ( | |
<a | |
key={index} | |
href="#" | |
className="block rounded px-4 py-2.5 transition duration-200 hover:bg-cyan-900"> | |
{item} | |
</a> | |
))} | |
</div> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
video preview:
Screen.Recording.2023-11-28.at.17.09.05.mov