Skip to content

Commit 5de1901

Browse files
committed
✨ feat : Creating a navbar component and applying it to the entire layout
- To create the functionality of the navbar, we created the navbar component. - You have added the created component to the overall layout. Related issue: YJU-OKURA#33
1 parent b3ecbe7 commit 5de1901

File tree

2 files changed

+134
-1
lines changed

2 files changed

+134
-1
lines changed

src/app/layout.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type {Metadata} from 'next';
22
import {Inter} from 'next/font/google';
33
import './globals.css';
4+
import Navbar from '../components/navbar';
45

56
const inter = Inter({subsets: ['latin']});
67

@@ -12,7 +13,14 @@ export const metadata: Metadata = {
1213
export default function RootLayout({children}: {children: React.ReactNode}) {
1314
return (
1415
<html lang="en">
15-
<body className={inter.className}>{children}</body>
16+
<body className={inter.className}>
17+
<div className="flex">
18+
<div className="w-1/6">
19+
<Navbar />
20+
</div>
21+
<div className="w-5/6">{children}</div>
22+
</div>
23+
</body>
1624
</html>
1725
);
1826
}

src/components/navbar.tsx

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
import Image from 'next/image';
2+
import Link from 'next/link';
3+
import {
4+
book,
5+
door,
6+
group,
7+
moreHoriz,
8+
moreVert,
9+
mypage,
10+
search,
11+
} from '@/public/svgs/navbar';
12+
import {user} from '@/public/images/navbar';
13+
14+
export default function Navbar() {
15+
return (
16+
<div className="w-full h-screen bg-gray-50 px-6 ">
17+
{/* Profile */}
18+
<div className="w-full h-12 flex items-center justify-between box-content py-1">
19+
<div className="flex items-center">
20+
<Image
21+
src={user}
22+
width={10}
23+
height={10}
24+
alt="userImage"
25+
className="w-8 h-8 rounded-lg"
26+
/>
27+
<div className="mx-2 ">Name</div>
28+
</div>
29+
<button className="w-8 h-8 rounded-lg float-end">
30+
<Image src={moreVert} alt="icon" width={30} height={30}></Image>
31+
</button>
32+
</div>
33+
<div className="h-px bg-zinc-300"></div>
34+
<div className="h-8"></div>
35+
36+
{/* Pages */}
37+
<div className="w-full">
38+
<div className="text-zinc-400 mb-4">Pages</div>
39+
<ul className="w-full">
40+
<li className="w-full flex mb-3 py-1">
41+
<Image
42+
src={group}
43+
alt="icon"
44+
width={30}
45+
height={30}
46+
className="w-6 h-6 mr-3"
47+
></Image>
48+
<Link href="/" className="">
49+
Group
50+
</Link>
51+
</li>
52+
<li className="w-full flex mb-3 py-1">
53+
<Image
54+
src={mypage}
55+
alt="icon"
56+
width={30}
57+
height={30}
58+
className="w-6 h-6 mr-3"
59+
></Image>
60+
<Link href="/" className="">
61+
MyPage
62+
</Link>
63+
</li>
64+
{/* Billing Page - 보류 */}
65+
{/* <li className="w-full flex my-2 py-2">
66+
<div className="w-6 h-6 bg-gray-600 mr-3"></div>
67+
<Link href="/" className="">
68+
Billing
69+
</Link>
70+
</li> */}
71+
</ul>
72+
</div>
73+
<div className="h-8"></div>
74+
{/* Prompt */}
75+
<div className="w-full h-1/2">
76+
<div className="text-zinc-400 mb-4">Prompt</div>
77+
{/* prompt - search */}
78+
<div className="w-full flex bg-white items-center mb-3 px-1">
79+
<Image
80+
src={search}
81+
alt="icon"
82+
width={20}
83+
height={20}
84+
className="w-5 h-5 opacity-50"
85+
/>
86+
<input
87+
type="text"
88+
className="w-full p-1 border-0 outline-none"
89+
placeholder="Search"
90+
/>
91+
</div>
92+
{/* Prompt - list */}
93+
<ul>
94+
<li className="flex mb-3 py-1 items-center">
95+
<Image
96+
src={book}
97+
alt="prompt"
98+
width={15}
99+
height={15}
100+
className="w-6 h-6 mr-3"
101+
></Image>
102+
<div className="flex w-full items-center justify-between">
103+
<Link href="/" className="">
104+
prompt1
105+
</Link>
106+
<Image src={moreHoriz} alt="icon" width={30} height={30}></Image>
107+
</div>
108+
</li>
109+
</ul>
110+
</div>
111+
112+
{/* group exit */}
113+
<div className="flex absolute bottom-14">
114+
<Image
115+
src={door}
116+
alt="icon"
117+
width={30}
118+
height={30}
119+
className="w-6 h-6 mr-2"
120+
></Image>
121+
<div>그룹 나가기</div>
122+
</div>
123+
</div>
124+
);
125+
}

0 commit comments

Comments
 (0)