-
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.
Merge pull request #6 from Team-Ampersand/update/common
🔀 common 폴더 구조 변경
- Loading branch information
Showing
18 changed files
with
84 additions
and
61 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
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
This file was deleted.
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
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
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,33 @@ | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
|
||
interface Props { | ||
href: string; | ||
icon: React.ComponentType<{ color: string }>; | ||
text: string; | ||
isActive: boolean; | ||
} | ||
|
||
const NavItem = ({ href, icon: Icon, text, isActive }: Props) => { | ||
return ( | ||
<Link href={href}> | ||
<div | ||
className={`flex items-center gap-6 rounded-lg px-4 py-3 ${ | ||
isActive | ||
? 'bg-primary-p20 text-primary-p10' | ||
: 'text-natural-n30 bg-background-card' | ||
}`} | ||
> | ||
<Icon color={isActive ? '#6F7AEC' : '#BBBBCC'} /> | ||
<p | ||
className="text-h6" | ||
style={{ color: isActive ? '#6F7AEC' : '#BBBBCC' }} | ||
> | ||
{text} | ||
</p> | ||
</div> | ||
</Link> | ||
); | ||
}; | ||
|
||
export default NavItem; |
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
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
File renamed without changes.
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,38 @@ | ||
'use client'; | ||
|
||
import { usePathname } from 'next/navigation'; | ||
import React from 'react'; | ||
import Logo from '../../atoms/Logo'; | ||
import NavItem from '../../atoms/NavItem'; | ||
import { Book, Music } from '@/assets/svg'; | ||
|
||
const navItems = [ | ||
{ href: '/', icon: Book, text: '예약' }, | ||
{ href: '/music', icon: Music, text: '음악' }, | ||
]; | ||
|
||
const Header = () => { | ||
const pathname = usePathname(); | ||
|
||
return ( | ||
<div className="h-screen max-w-[258px] bg-background-card px-6 py-9"> | ||
<Logo /> | ||
<div className="mt-9 flex h-full w-full flex-col gap-2"> | ||
{navItems.map((item) => { | ||
const isActive = pathname === item.href; | ||
return ( | ||
<NavItem | ||
key={item.href} | ||
href={item.href} | ||
icon={item.icon} | ||
text={item.text} | ||
isActive={isActive} | ||
/> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Header; |
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