From f5ec8578dc286d08c50e8b71d72bcca23d2d931f Mon Sep 17 00:00:00 2001 From: JaeHunKang Date: Sun, 8 Jun 2025 04:00:33 +0900 Subject: [PATCH 1/7] =?UTF-8?q?refact:=20=EA=B0=99=EC=9D=B4=EA=B0=80?= =?UTF-8?q?=EC=9A=94=20=EB=A1=9C=EA=B3=A0=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C?= =?UTF-8?q?=20=EB=A9=94=EC=9D=B8=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/home/ui/MainPage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/home/ui/MainPage.tsx b/src/pages/home/ui/MainPage.tsx index c1a40338..a3b476d6 100644 --- a/src/pages/home/ui/MainPage.tsx +++ b/src/pages/home/ui/MainPage.tsx @@ -26,6 +26,11 @@ const MainPage = () => { link: `/event-details/${event.id}`, })); + const handleRefresh = () => { + navigate('/'); + window.location.reload(); + }; + return (
{ /> } leftButtonClassName="sm:text-lg md:text-xl lg:text-2xl font-extrabold font-nexon" - leftButtonClick={() => {}} + leftButtonClick={handleRefresh} leftButtonLabel="같이가요" rightContent={ isLoggedIn ? ( From 30dfe9146f2022267e1ddb92af4717e3f6754d1c Mon Sep 17 00:00:00 2001 From: JaeHunKang Date: Sun, 8 Jun 2025 04:22:20 +0900 Subject: [PATCH 2/7] =?UTF-8?q?refact:=20=ED=95=98=EB=8B=A8=EB=B0=94=20?= =?UTF-8?q?=ED=99=88=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C?= =?UTF-8?q?=20=EB=92=A4=EB=A1=9C=EA=B0=80=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/main/ui/BottomBar.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/widgets/main/ui/BottomBar.tsx b/src/widgets/main/ui/BottomBar.tsx index c724fadb..6484b4d0 100644 --- a/src/widgets/main/ui/BottomBar.tsx +++ b/src/widgets/main/ui/BottomBar.tsx @@ -10,11 +10,7 @@ const BottomBar = () => { key={index} className="flex flex-col justify-center items-center w-24 h-20 cursor-pointer" onClick={() => { - if (location.pathname === item.path) { - navigate(-1); - } else { - navigate(item.path); - } + navigate(item.path); }} > {`${item.label}Icon`} From ea334072b7b645b7c7732a3253c08537fdd5fc60 Mon Sep 17 00:00:00 2001 From: JaeHunKang Date: Sun, 8 Jun 2025 04:41:35 +0900 Subject: [PATCH 3/7] =?UTF-8?q?refact:=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=EA=B0=80=20=EC=97=86?= =?UTF-8?q?=EC=9D=84=20=EC=8B=9C=20enum=EA=B0=92=EC=9D=84=20=ED=95=9C?= =?UTF-8?q?=EA=B5=AD=EC=96=B4=EB=A1=9C=20=EB=B2=88=EC=97=AD=ED=95=B4?= =?UTF-8?q?=EC=84=9C=20=EB=A0=8C=EB=8D=94=EB=A7=81=ED=95=98=EA=B2=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/event/ui/EventList.tsx | 11 +++++++++-- src/pages/home/ui/MainPage.tsx | 7 +------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/features/event/ui/EventList.tsx b/src/features/event/ui/EventList.tsx index 7a965d3d..44566765 100644 --- a/src/features/event/ui/EventList.tsx +++ b/src/features/event/ui/EventList.tsx @@ -16,6 +16,13 @@ interface EventListComponentProps { tag?: TagType; } +const categoryToKorean: Record = { + DEVELOPMENT_STUDY: '개발 스터디', + NETWORKING: '네트워킹', + HACKATHON: '해커톤', + CONFERENCE: '컨퍼런스', +}; + const EventList = ({ category, tag }: EventListComponentProps) => { const navigate = useNavigate(); @@ -58,9 +65,9 @@ const EventList = ({ category, tag }: EventListComponentProps) => { {data?.pages[0]?.items.length === 0 ? (
{tag ? ( -
생성된 이벤트가 없습니다.
+
열린 이벤트가 없습니다.
) : category ? ( -
생성된 {category} 이벤트가 없습니다.
+
열린 {categoryToKorean[category]} 이벤트가 없습니다.
) : null}
) : ( diff --git a/src/pages/home/ui/MainPage.tsx b/src/pages/home/ui/MainPage.tsx index a3b476d6..c1a40338 100644 --- a/src/pages/home/ui/MainPage.tsx +++ b/src/pages/home/ui/MainPage.tsx @@ -26,11 +26,6 @@ const MainPage = () => { link: `/event-details/${event.id}`, })); - const handleRefresh = () => { - navigate('/'); - window.location.reload(); - }; - return (
{ /> } leftButtonClassName="sm:text-lg md:text-xl lg:text-2xl font-extrabold font-nexon" - leftButtonClick={handleRefresh} + leftButtonClick={() => {}} leftButtonLabel="같이가요" rightContent={ isLoggedIn ? ( From 80a50833fa291778be868740a7dd9851e4ed8940 Mon Sep 17 00:00:00 2001 From: JaeHunKang Date: Sun, 8 Jun 2025 04:44:55 +0900 Subject: [PATCH 4/7] =?UTF-8?q?refact:=20=EB=A9=94=EB=89=B4=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EB=B0=8F=20=EB=8F=8B=EB=B3=B4=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/menu/ui/MenuPage.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/pages/menu/ui/MenuPage.tsx b/src/pages/menu/ui/MenuPage.tsx index 770ea081..c58f16c8 100644 --- a/src/pages/menu/ui/MenuPage.tsx +++ b/src/pages/menu/ui/MenuPage.tsx @@ -1,8 +1,6 @@ import { flexColumn } from '../../../../design-system/styles/flex'; import HorizontalCardButton from '../../../../design-system/ui/buttons/HorizontalCardButton'; import { useNavigate } from 'react-router-dom'; - -import searchIcon from '../../../../design-system/icons/Search.svg'; import Header from '../../../../design-system/ui/Header'; import { buttonData } from '../../../shared/types/menuType'; import BottomBar from '../../../widgets/main/ui/BottomBar'; @@ -17,12 +15,7 @@ const MenuPage = () => { return ( <>
navigate('/search')}> - Search Icon - - } + centerContent="메뉴" />
{buttonData.map((button, index) => ( From 03aaee058393e18df95498e1412d720864a11092 Mon Sep 17 00:00:00 2001 From: JaeHunKang Date: Sun, 8 Jun 2025 05:09:07 +0900 Subject: [PATCH 5/7] =?UTF-8?q?refact:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=EC=97=90=EC=84=9C=EB=A7=8C=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=95=84=EC=9B=83=20=EB=B2=84=ED=8A=BC=20=ED=99=9C?= =?UTF-8?q?=EC=84=B1=ED=99=94=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/menu/ui/MenuPage.tsx | 7 +++---- src/shared/types/menuType.ts | 27 ++++++++++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/pages/menu/ui/MenuPage.tsx b/src/pages/menu/ui/MenuPage.tsx index c58f16c8..82937703 100644 --- a/src/pages/menu/ui/MenuPage.tsx +++ b/src/pages/menu/ui/MenuPage.tsx @@ -2,7 +2,7 @@ import { flexColumn } from '../../../../design-system/styles/flex'; import HorizontalCardButton from '../../../../design-system/ui/buttons/HorizontalCardButton'; import { useNavigate } from 'react-router-dom'; import Header from '../../../../design-system/ui/Header'; -import { buttonData } from '../../../shared/types/menuType'; +import { getButtonData } from '../../../shared/types/menuType'; import BottomBar from '../../../widgets/main/ui/BottomBar'; const handleIconClick = (navigate: (path: string) => void, path: string) => { @@ -11,12 +11,11 @@ const handleIconClick = (navigate: (path: string) => void, path: string) => { const MenuPage = () => { const navigate = useNavigate(); + const buttonData = getButtonData(); return ( <> -
+
{buttonData.map((button, index) => (
diff --git a/src/shared/types/menuType.ts b/src/shared/types/menuType.ts index 35043968..06bae778 100644 --- a/src/shared/types/menuType.ts +++ b/src/shared/types/menuType.ts @@ -8,6 +8,7 @@ import SelectedEvent from '../../..//design-system/icons/SelectedEvent.svg'; import SelectedHost from '../../../public/assets/menu/SelectedHost.svg'; import SelectedLogout from '../../../public/assets/menu/SelectedLogout.svg'; import SelectedSetting from '../../../public/assets/menu/SelectedSetting.svg'; +import useAuthStore from '../../app/provider/authStore'; export interface buttonData { iconPath: string; // 아이콘 경로 @@ -16,10 +17,22 @@ export interface buttonData { path: string; // 경로 } -export const buttonData: buttonData[] = [ - { iconPath: Ticket, hoverIconPath: SelectedTicket, label: '구입한 티켓', path: '/menu/myTicket' }, - { iconPath: Host, hoverIconPath: SelectedHost, label: '내 호스트', path: '/menu/myHost' }, - { iconPath: Event, hoverIconPath: SelectedEvent, label: '이벤트 주최하기', path: '/event-creation' }, - { iconPath: Setting, hoverIconPath: SelectedSetting, label: '마이페이지', path: '/menu/myPage' }, - { iconPath: Logout, hoverIconPath: SelectedLogout, label: '로그아웃', path: '/menu/logout' }, -]; +export const getButtonData = (): buttonData[] => { + const isLoggedIn = useAuthStore.getState().isLoggedIn; + + const baseButtons: buttonData[] = [ + { iconPath: Ticket, hoverIconPath: SelectedTicket, label: '구입한 티켓', path: '/menu/myTicket' }, + { iconPath: Host, hoverIconPath: SelectedHost, label: '내 호스트', path: '/menu/myHost' }, + { iconPath: Event, hoverIconPath: SelectedEvent, label: '이벤트 주최하기', path: '/event-creation' }, + { iconPath: Setting, hoverIconPath: SelectedSetting, label: '마이페이지', path: '/menu/myPage' }, + ]; + + if (isLoggedIn) { + return [ + ...baseButtons, + { iconPath: Logout, hoverIconPath: SelectedLogout, label: '로그아웃', path: '/menu/logout' }, + ]; + } + + return baseButtons; +}; From dd2e48ccafd508dde3603678ae1256b2dfdef957 Mon Sep 17 00:00:00 2001 From: JaeHunKang Date: Sun, 8 Jun 2025 05:20:46 +0900 Subject: [PATCH 6/7] =?UTF-8?q?refact:=20=EC=82=AD=EC=A0=9C=EB=90=9C=20?= =?UTF-8?q?=EA=B0=99=EC=9D=B4=EA=B0=80=EC=9A=94=20=EB=A1=9C=EA=B3=A0=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=9E=AC=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/home/ui/MainPage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/home/ui/MainPage.tsx b/src/pages/home/ui/MainPage.tsx index c1a40338..a3b476d6 100644 --- a/src/pages/home/ui/MainPage.tsx +++ b/src/pages/home/ui/MainPage.tsx @@ -26,6 +26,11 @@ const MainPage = () => { link: `/event-details/${event.id}`, })); + const handleRefresh = () => { + navigate('/'); + window.location.reload(); + }; + return (
{ /> } leftButtonClassName="sm:text-lg md:text-xl lg:text-2xl font-extrabold font-nexon" - leftButtonClick={() => {}} + leftButtonClick={handleRefresh} leftButtonLabel="같이가요" rightContent={ isLoggedIn ? ( From dfa4fafa188a655aff0e081a97be2033408e0055 Mon Sep 17 00:00:00 2001 From: JaeHunKang Date: Sun, 8 Jun 2025 17:39:44 +0900 Subject: [PATCH 7/7] =?UTF-8?q?refact:=20=EB=A9=94=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=EB=8A=94=20=EC=83=88?= =?UTF-8?q?=EB=A1=9C=EA=B3=A0=EC=B9=A8,=20=EC=9D=B4=EC=99=B8=EC=9D=98=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=EB=8A=94=20?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=94=94=EB=A0=89=ED=8C=85=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/home/ui/MainPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/home/ui/MainPage.tsx b/src/pages/home/ui/MainPage.tsx index a3b476d6..3e8e6802 100644 --- a/src/pages/home/ui/MainPage.tsx +++ b/src/pages/home/ui/MainPage.tsx @@ -27,8 +27,11 @@ const MainPage = () => { })); const handleRefresh = () => { - navigate('/'); - window.location.reload(); + if (location.pathname === '/') { + window.location.reload(); + } else { + navigate('/'); + } }; return (