diff --git a/src/app/mypage/page.tsx b/src/app/mypage/page.tsx index 1f13b12..9c9acc2 100644 --- a/src/app/mypage/page.tsx +++ b/src/app/mypage/page.tsx @@ -1,6 +1,6 @@ import { auth } from '@/auth' -import MainMenu from '@/components/HamburgerMenu/Menu/MainMenu' -import ServiceMenu from '@/components/HamburgerMenu/Menu/Service' +import MenuLink from '@/components/Menu/MenuLink' +import ExternalLinkContainer from '@/components/Menu/ExternalLinkContainer' import Header from '@/components/Header' import PinIcon from 'public/icons/sketchIcons-4.svg' import ClipIcon from 'public/icons/sketchIcons-paperclip.svg' @@ -26,19 +26,19 @@ const MyPage = async () => {
- } text="프로필 수정" linkTo="/mypage/profileEdit" /> - } text="내 보드 목록" linkTo="/mypage/boards" />
- +
) diff --git a/src/components/HamburgerMenu/index.tsx b/src/components/HamburgerMenu/index.tsx index 875b27c..a134ccf 100644 --- a/src/components/HamburgerMenu/index.tsx +++ b/src/components/HamburgerMenu/index.tsx @@ -3,7 +3,7 @@ import HamburgerIcon from 'public/icons/hamburger.svg' import { useState } from 'react' import Drawer from './Drawer' -import Menu from './Menu' +import Menu from '../Menu' import { DrawerProvider } from './DrawerContext' const Hamburger = ({ diff --git a/src/components/HamburgerMenu/Menu/Service.tsx b/src/components/Menu/ExternalLinkContainer.tsx similarity index 70% rename from src/components/HamburgerMenu/Menu/Service.tsx rename to src/components/Menu/ExternalLinkContainer.tsx index 9791e42..845669f 100644 --- a/src/components/HamburgerMenu/Menu/Service.tsx +++ b/src/components/Menu/ExternalLinkContainer.tsx @@ -1,32 +1,35 @@ import Link from 'next/link' import { twMerge } from 'tailwind-merge' -const Menu = ({ text, linkTo }: { text: string; linkTo: string }) => ( +const ExternalLink = ({ text, linkTo }: { text: string; linkTo: string }) => ( {text} ) -const ServiceMenu = ({ +const ExternalLinkContainer = ({ className = '', }: { className?: React.ComponentProps<'div'>['className'] }) => (
- - - - +
) -export default ServiceMenu +export default ExternalLinkContainer diff --git a/src/components/HamburgerMenu/Menu/MainMenu.tsx b/src/components/Menu/MenuLink.tsx similarity index 71% rename from src/components/HamburgerMenu/Menu/MainMenu.tsx rename to src/components/Menu/MenuLink.tsx index fd72c35..3348eba 100644 --- a/src/components/HamburgerMenu/Menu/MainMenu.tsx +++ b/src/components/Menu/MenuLink.tsx @@ -1,25 +1,22 @@ import Link from 'next/link' import { ReactNode } from 'react' -const MainMenu = ({ +const MenuLink = ({ icon, text, linkTo, - onClick = () => {}, }: { icon: ReactNode text: string linkTo: string - onClick?: React.ComponentProps<'a'>['onClick'] }) => ( {icon} {text} ) -export default MainMenu +export default MenuLink diff --git a/src/components/HamburgerMenu/Menu/index.tsx b/src/components/Menu/index.tsx similarity index 84% rename from src/components/HamburgerMenu/Menu/index.tsx rename to src/components/Menu/index.tsx index a74de0d..151cb33 100644 --- a/src/components/HamburgerMenu/Menu/index.tsx +++ b/src/components/Menu/index.tsx @@ -6,10 +6,10 @@ import PersonIcon from 'public/icons/person.svg' import PinIcon from 'public/icons/pinFilled.svg' import PolaroidIcon from 'public/icons/polaroid.svg' import { useState } from 'react' -import Modal from '../../Modal' -import { useDrawer } from '../DrawerContext' -import MainMenu from './MainMenu' -import ServiceMenu from './Service' +import Modal from '../Modal' +import { useDrawer } from '../HamburgerMenu/DrawerContext' +import MenuLink from './MenuLink' +import ExternalLinkContainer from './ExternalLinkContainer' const Profile = () => { const { data: session, status } = useSession() @@ -66,23 +66,22 @@ const Menu = () => {
- } - text="POLABO 메인" - linkTo="/" +
{ if (pathName === '/') { setClose() } }} - /> + > + } text="POLABO 메인" linkTo="/" /> +
{status === 'authenticated' && ( - } text="마이페이지" linkTo="/mypage" /> + } text="마이페이지" linkTo="/mypage" /> )}
- + {status === 'authenticated' && }