Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/app/(app)/(with-navbar)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Navbar } from '@/widgets';
import NavbarPortal from '@/widgets/navbar/NavbarPortal';

export default function Layout({
children,
Expand All @@ -8,7 +8,7 @@ export default function Layout({
return (
<div className={'w-full'}>
{children}
<Navbar />
<NavbarPortal />
</div>
);
}
2 changes: 1 addition & 1 deletion frontend/src/widgets/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Navigation() {
return (
<div
className={
'bg-white w-full max-w-[430px] min-w-[320px] py-[34px] fixed bottom-0 flex justify-around pt-1 '
'bg-white w-full max-w-[430px] min-w-[320px] py-[34px] fixed bottom-0 flex justify-around pt-1 z-100'
}
style={{
// 모바일에서 안전 영역 고려
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/widgets/navbar/NavbarPortal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client';

import { useEffect, useState } from 'react';
import { createPortal } from 'react-dom';
import { Navbar } from '@/widgets';

export default function NavbarPortal() {
const [mounted, setMounted] = useState(false);

useEffect(() => {
setMounted(true);
return () => setMounted(false);
}, []);

return mounted ? createPortal(<Navbar />, document.body) : null;
}