Skip to content

Commit 54bb65e

Browse files
committed
ui(reorgainze width sidebar) feat(dashboard v5)
1 parent 41b7faa commit 54bb65e

File tree

7 files changed

+48
-3
lines changed

7 files changed

+48
-3
lines changed

app/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
@tailwind components;
33
@tailwind utilities;
44

5+
::root {
6+
--w-sidebar: 80px;
7+
}
8+
59
.no-scrollbar::-webkit-scrollbar {
610
display: none;
711
}

app/v5/layout.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Sidebar from "@/components/v1/sidebar";
2+
import type { Metadata } from "next";
3+
4+
export const metadata: Metadata = {
5+
title: "Dashboard Layout V5",
6+
description: "Generated by create next app",
7+
};
8+
9+
export default function RootLayout({
10+
children,
11+
}: Readonly<{
12+
children: React.ReactNode;
13+
}>) {
14+
return (
15+
<html lang="en">
16+
<body>
17+
<main className="main-wrapper">
18+
<Sidebar />
19+
<main className="main-content">{children}</main>
20+
<Sidebar />
21+
</main>
22+
</body>
23+
</html>
24+
);
25+
}

app/v5/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function Page() {
2+
return (
3+
<div className="flex flex-col gap-2">
4+
{Array.from({ length: 10 }).map((_, id) => {
5+
return <div key={id} className="h-96 w-full bg-dark-300 rounded-md" />;
6+
})}
7+
</div>
8+
);
9+
}

components/v1/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default function Sidebar() {
22
return (
3-
<div className="min-w-[80px] md:w-[240px] lg:min-w-[280px] h-dvh transition-all bg-dark-500 p-3">
3+
<div className="min-w-[var(--w-sidebar)] md:w-[240px] lg:min-w-[280px] h-dvh transition-all bg-dark-500 p-3">
44
sidebar
55
</div>
66
);

components/v2/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default function Sidebar() {
22
return (
3-
<div className="min-w-[80px] md:w-[240px] lg:min-w-[280px] h-dvh transition-all bg-dark-500 p-3">
3+
<div className="min-w-[var(--w-sidebar)] md:w-[240px] lg:min-w-[280px] h-dvh transition-all bg-dark-500 p-3">
44
sidebar
55
</div>
66
);

components/v3/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default function Sidebar() {
4040
<div className="relative w-fit" ref={refOutside}>
4141
<CloseOpen isOpen={isOpen} setIsOpen={setIsOpen} />
4242
<div
43-
className={cn(`${styles.sidebarWithOpenClose} !h-[calc(100vh-25px)] rounded-lg` , {
43+
className={cn(`${styles.sidebarWithOpenClose} !h-svh rounded-lg`, {
4444
[styles.sidebarWithOpenCloseActive]: !isOpen,
4545
})}
4646
>

components/v5/sidebar.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Sidebar() {
2+
return (
3+
<div className="min-w-[var(--w-sidebar)] md:w-[240px] lg:min-w-[280px] h-dvh transition-all bg-dark-500 p-3">
4+
sidebar
5+
</div>
6+
);
7+
}

0 commit comments

Comments
 (0)