Skip to content

Commit 5426113

Browse files
authored
Merge pull request #297 from boostcampwm-2024/dev-front
[FE] Navbar 토글시 영역이 남아있던 현상 수정
2 parents 3c4217d + 06a7fb4 commit 5426113

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

frontend/src/component/template/NabvarLayout.tsx

+10-6
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@ export default function NavbarLayout() {
1717
}
1818

1919
return (
20-
<div
21-
className='relative h-screen w-[20%] rounded-[11px] bg-lightblue dark:bg-darkblue'
20+
<motion.div
21+
animate={{
22+
width: isNavbarOpen ? '20%' : '0%'
23+
}}
24+
transition={{ duration: 0.3, ease: 'easeInOut' }}
25+
className='relative h-screen rounded-[11px] bg-lightblue dark:bg-darkblue'
2226
onMouseEnter={() => setIsHovered(true)}
2327
onMouseLeave={() => setIsHovered(false)}>
2428
<AnimatePresence>
2529
{isNavbarOpen && (
2630
<motion.div
27-
initial={{ width: 0, opacity: 0, x: -50 }}
28-
animate={{ width: '100%', opacity: 1, x: 0 }}
29-
exit={{ width: 0, opacity: 0, x: -50 }}
31+
initial={{ opacity: 0, x: -50 }}
32+
animate={{ opacity: 1, x: 0 }}
33+
exit={{ opacity: 0, x: -50 }}
3034
transition={{ duration: 0.3, ease: 'easeInOut' }}>
3135
<Navbar />
3236
{isHovered && (
@@ -57,6 +61,6 @@ export default function NavbarLayout() {
5761
<ChevronRight size={20} />
5862
</motion.button>
5963
)}
60-
</div>
64+
</motion.div>
6165
);
6266
}

0 commit comments

Comments
 (0)