From a84927c07aaccc5d7fb21e230a47457f131ad07f Mon Sep 17 00:00:00 2001 From: hyeonjin6530 Date: Sat, 31 May 2025 19:29:14 +0900 Subject: [PATCH 01/10] =?UTF-8?q?refactor:=20=EB=AA=A8=EB=B0=94=EC=9D=BC?= =?UTF-8?q?=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20->=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mobile/admin/dashboard/page.tsx | 5 ++- src/app/mobile/admin/notification/page.tsx | 5 ++- src/app/mobile/history/page.tsx | 5 ++- src/app/mobile/layout.tsx | 42 ++++++++++++++++++++++ src/app/mobile/main/page.tsx | 5 ++- src/app/mobile/notification/page.tsx | 5 ++- src/app/mobile/privacy-policy/page.tsx | 5 ++- src/components/mobile/layout/index.tsx | 31 ---------------- 8 files changed, 54 insertions(+), 49 deletions(-) create mode 100644 src/app/mobile/layout.tsx delete mode 100644 src/components/mobile/layout/index.tsx diff --git a/src/app/mobile/admin/dashboard/page.tsx b/src/app/mobile/admin/dashboard/page.tsx index 8afcfe7..42b229d 100644 --- a/src/app/mobile/admin/dashboard/page.tsx +++ b/src/app/mobile/admin/dashboard/page.tsx @@ -1,7 +1,6 @@ 'use client'; import { useState, useEffect } from 'react'; -import MobileLayout from '@/components/mobile/layout'; import Header from '@/components/mobile/Header'; import Dropdown from '@/components/mobile/Dropdown'; import useDropdown from '@/hooks/useDropdown'; @@ -104,7 +103,7 @@ export default function Dashboard() { }; return ( - +
@@ -171,6 +170,6 @@ export default function Dashboard() { hideDropdown={hideDropdown} positionClasses="top-[80px] right-5" /> - +
); } diff --git a/src/app/mobile/admin/notification/page.tsx b/src/app/mobile/admin/notification/page.tsx index 61084ab..3c8f229 100644 --- a/src/app/mobile/admin/notification/page.tsx +++ b/src/app/mobile/admin/notification/page.tsx @@ -1,7 +1,6 @@ 'use client'; import { useEffect, useState } from 'react'; -import MobileLayout from '@/components/mobile/layout'; import NotificationItem from '@/components/mobile/NotificationItem'; import Header from '@/components/mobile/Header'; import { elapsedTime } from '@/utils/elapsedTime'; @@ -32,7 +31,7 @@ export default function Notification() { }; return ( - +
{notificationDetail?.length === 0 ? (
@@ -53,6 +52,6 @@ export default function Notification() { /> )) )} - +
); } diff --git a/src/app/mobile/history/page.tsx b/src/app/mobile/history/page.tsx index b884577..1d9ce7c 100644 --- a/src/app/mobile/history/page.tsx +++ b/src/app/mobile/history/page.tsx @@ -1,7 +1,6 @@ 'use client'; import { useEffect, useState, useMemo } from 'react'; -import MobileLayout from '@/components/mobile/layout'; import Header from '@/components/mobile/Header'; import ReturnItem from '@/app/mobile/history/_components/ReturnItem'; import RentalItem from '@/app/mobile/history/_components/RentalItem'; @@ -194,7 +193,7 @@ export default function UserRentalList() { ); return ( - +
{/* 반납이 필요한 물품 */} @@ -287,6 +286,6 @@ export default function UserRentalList() {
© wink
-
+ ); } diff --git a/src/app/mobile/layout.tsx b/src/app/mobile/layout.tsx new file mode 100644 index 0000000..a26f7be --- /dev/null +++ b/src/app/mobile/layout.tsx @@ -0,0 +1,42 @@ +'use client'; + +import useAuthRedirect from '@/hooks/useAuthRedirect'; +import React, { useEffect } from 'react'; +import { usePathname } from 'next/navigation'; + +export default function MobileLayout({ + children, +}: { + children: React.ReactNode; +}) { + const pathname = usePathname(); + + // 제외할 경로 목록 + const excludedRoutes = ['/mobile/sign-in', '/mobile/sign-up']; + + const isExcluded = excludedRoutes.includes(pathname); + + useAuthRedirect(); + + useEffect(() => { + if (!isExcluded) { + const originalBgColor = document.body.style.backgroundColor; + document.body.style.backgroundColor = '#F3F4F6'; + + return () => { + document.body.style.backgroundColor = originalBgColor; + }; + } + }, [isExcluded]); + + if (isExcluded) { + // 레이아웃 없이 children만 렌더링 + return children; + } + + return ( +
+
{children}
+
+ ); +} diff --git a/src/app/mobile/main/page.tsx b/src/app/mobile/main/page.tsx index 2a1897f..a752d80 100644 --- a/src/app/mobile/main/page.tsx +++ b/src/app/mobile/main/page.tsx @@ -1,7 +1,6 @@ 'use client'; import { useEffect, useState } from 'react'; -import MobileLayout from '@/components/mobile/layout'; import MainHeader from '@/app/mobile/main/_components/MainHeader'; import Carousel from '@/app/mobile/main/_components/Carousel'; import WelfareItem from '@/app/mobile/main/_components/WelfareItem'; @@ -77,7 +76,7 @@ export default function MobileMain() { }; return ( - +
@@ -129,6 +128,6 @@ export default function MobileMain() { onCloseAction={() => setIsBottomSheetOpen(false)} item={selectedItem} /> - +
); } diff --git a/src/app/mobile/notification/page.tsx b/src/app/mobile/notification/page.tsx index 5ebe2d3..a1a0e8f 100644 --- a/src/app/mobile/notification/page.tsx +++ b/src/app/mobile/notification/page.tsx @@ -2,7 +2,6 @@ import { useState, useEffect } from 'react'; import { useRouter } from 'next/navigation'; -import MobileLayout from '@/components/mobile/layout'; import { userNotificationGet, readNotificationPatch, @@ -50,7 +49,7 @@ export default function Notification() { }; return ( - +
{notificationDetail?.length === 0 ? (
@@ -84,6 +83,6 @@ export default function Notification() { ))}
)} - +
); } diff --git a/src/app/mobile/privacy-policy/page.tsx b/src/app/mobile/privacy-policy/page.tsx index 4b80c03..60772dc 100644 --- a/src/app/mobile/privacy-policy/page.tsx +++ b/src/app/mobile/privacy-policy/page.tsx @@ -1,12 +1,11 @@ 'use client'; -import MobileLayout from '@/components/mobile/layout'; import Header from '@/components/mobile/Header'; import privacyPolicy from './privacyPolicyData'; export default function UserRentalList() { return ( - +
{/* 반납이 필요한 물품 */} @@ -42,6 +41,6 @@ export default function UserRentalList() {
© wink
- +
); } diff --git a/src/components/mobile/layout/index.tsx b/src/components/mobile/layout/index.tsx deleted file mode 100644 index 2fe616b..0000000 --- a/src/components/mobile/layout/index.tsx +++ /dev/null @@ -1,31 +0,0 @@ -'use client'; - -import useAuthRedirect from '@/hooks/useAuthRedirect'; -import React, { useEffect } from 'react'; - -interface MobileLayoutProps { - children: React.ReactNode; -} - -export default function MobileLayout({ children }: MobileLayoutProps) { - useAuthRedirect(); - - useEffect(() => { - // 기존 body 배경색 저장 - const originalBgColor = document.body.style.backgroundColor; - - // MobileLayout이 마운트될 때 배경색 적용(모바일에서만 적용하기 위함) - document.body.style.backgroundColor = '#F3F4F6'; - - return () => { - // MobileLayout이 언마운트될 때 원래 배경색 복구 - document.body.style.backgroundColor = originalBgColor; - }; - }, []); - - return ( -
-
{children}
-
- ); -} From e5fd59bd563084d4c8304f8db2239c7093861cda Mon Sep 17 00:00:00 2001 From: hyeonjin6530 Date: Sat, 31 May 2025 19:31:04 +0900 Subject: [PATCH 02/10] =?UTF-8?q?style:=20padding=20bottom=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mobile/main/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/mobile/main/page.tsx b/src/app/mobile/main/page.tsx index a752d80..ca7bf29 100644 --- a/src/app/mobile/main/page.tsx +++ b/src/app/mobile/main/page.tsx @@ -78,7 +78,7 @@ export default function MobileMain() { return (
-
+
From 834bb4f8e393316d882d53452ed4c44c54c3df94 Mon Sep 17 00:00:00 2001 From: hyeonjin6530 Date: Sat, 31 May 2025 19:44:33 +0900 Subject: [PATCH 03/10] =?UTF-8?q?feat:=20=EC=82=AC=EC=9D=B4=EB=93=9C?= =?UTF-8?q?=EB=A9=94=EB=89=B4=EC=97=90=20=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=ED=99=88=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=95=98=EB=8A=94=20=ED=95=AD=EB=AA=A9=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/icons/side-menu/admin-homepage.svg | 120 ++++++++++++++++++ src/components/mobile/SidebarMenu/index.tsx | 7 + 2 files changed, 127 insertions(+) create mode 100644 public/assets/icons/side-menu/admin-homepage.svg diff --git a/public/assets/icons/side-menu/admin-homepage.svg b/public/assets/icons/side-menu/admin-homepage.svg new file mode 100644 index 0000000..beccd3c --- /dev/null +++ b/public/assets/icons/side-menu/admin-homepage.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/mobile/SidebarMenu/index.tsx b/src/components/mobile/SidebarMenu/index.tsx index 6a9c60c..6d2ccb5 100644 --- a/src/components/mobile/SidebarMenu/index.tsx +++ b/src/components/mobile/SidebarMenu/index.tsx @@ -8,6 +8,7 @@ import IconAdminDashboard from 'public/assets/icons/side-menu/admin-dashboard.sv import IconAdminAlarm from 'public/assets/icons/side-menu/admin-alarm.svg'; import IconLogout from 'public/assets/icons/side-menu/logout.svg'; import IconPrivacyPolicy from 'public/assets/icons/side-menu/privacy-policy.svg'; +import IconAdminHomepage from 'public/assets/icons/side-menu/admin-homepage.svg'; import { useRouter } from 'next/navigation'; interface SidebarProps { @@ -22,6 +23,7 @@ const menuItems = [ { icon: IconUserAlarm, label: '알림', href: '/mobile/notification' }, ]; +// TODO: 관리자 홈페이지 링크 변경 const adminItems = [ { icon: IconAdminDashboard, @@ -33,6 +35,11 @@ const adminItems = [ label: '관리자 알림', href: '/mobile/admin/notification', }, + { + icon: IconAdminHomepage, + label: '관리자 홈페이지', + href: '/mobile/admin/notification', + }, ]; export default function Sidebar({ From a86e02b8a102502aa1319a078361ff07c57a0ac6 Mon Sep 17 00:00:00 2001 From: hyeonjin6530 Date: Sat, 31 May 2025 19:53:49 +0900 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=ED=99=88=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=83=88=EC=B0=BD=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=97=B4=EB=A6=AC=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/mobile/SidebarMenu/index.tsx | 30 ++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/components/mobile/SidebarMenu/index.tsx b/src/components/mobile/SidebarMenu/index.tsx index 6d2ccb5..cb71a16 100644 --- a/src/components/mobile/SidebarMenu/index.tsx +++ b/src/components/mobile/SidebarMenu/index.tsx @@ -38,7 +38,7 @@ const adminItems = [ { icon: IconAdminHomepage, label: '관리자 홈페이지', - href: '/mobile/admin/notification', + href: 'https://www.billilge.site/desktop/login', }, ]; @@ -103,17 +103,23 @@ export default function Sidebar({ {role === 'ADMIN' && ( <>
    - {adminItems.map(({ icon: Icon, label, href }) => ( -
  • - - - {label} - -
  • - ))} + {adminItems.map(({ icon: Icon, label, href }) => { + const isExternal = label === '관리자 홈페이지'; + + return ( +
  • + + + {label} + +
  • + ); + })}
{/* 두 번째 구분선 */} From 8dff80851e981cddf5783daa5896c7fe36a7f820 Mon Sep 17 00:00:00 2001 From: hyeonjin6530 Date: Sun, 1 Jun 2025 01:44:42 +0900 Subject: [PATCH 05/10] =?UTF-8?q?feat:=20=EA=B3=B5=EC=A7=80=EC=82=AC?= =?UTF-8?q?=ED=95=AD=20=ED=8C=9D=EC=97=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mobile/main/page.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/mobile/main/page.tsx b/src/app/mobile/main/page.tsx index ca7bf29..2bd834b 100644 --- a/src/app/mobile/main/page.tsx +++ b/src/app/mobile/main/page.tsx @@ -50,7 +50,7 @@ export default function MobileMain() { requestNotificationPermission(); // "다시 보지 않기" 플래그가 없으면 팝업 표시 - if (!localStorage.getItem('popUpDismissed2')) { + if (!localStorage.getItem('popUpDismissed3')) { setShowPopUp(true); } }, []); @@ -112,11 +112,11 @@ export default function MobileMain() { {showPopUp && ( setShowPopUp(false)} onClickOther={() => { - localStorage.setItem('popUpDismissed2', 'true'); + localStorage.setItem('popUpDismissed3', 'true'); setShowPopUp(false); }} /> From 042b4da1e6e175633535309757ff470c2606939f Mon Sep 17 00:00:00 2001 From: hyeonjin6530 Date: Sun, 1 Jun 2025 01:51:54 +0900 Subject: [PATCH 06/10] =?UTF-8?q?feat:=20=ED=95=99=EC=83=9D=ED=9A=8C?= =?UTF-8?q?=EB=B9=84=20=EB=82=A9=EB=B6=80=EC=8B=9C=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EC=98=86=EC=97=90=20=EC=B2=B4=ED=81=AC=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/icons/icon-fee-check.svg | 89 +++++++++++++++++++ .../main/_components/MainHeader/index.tsx | 6 +- src/utils/loginHandler.ts | 14 ++- 3 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 public/assets/icons/icon-fee-check.svg diff --git a/public/assets/icons/icon-fee-check.svg b/public/assets/icons/icon-fee-check.svg new file mode 100644 index 0000000..467d061 --- /dev/null +++ b/public/assets/icons/icon-fee-check.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/mobile/main/_components/MainHeader/index.tsx b/src/app/mobile/main/_components/MainHeader/index.tsx index b46936b..6a5006f 100644 --- a/src/app/mobile/main/_components/MainHeader/index.tsx +++ b/src/app/mobile/main/_components/MainHeader/index.tsx @@ -5,6 +5,7 @@ import Sidebar from '@/components/mobile/SidebarMenu/index'; import { useEffect, useState } from 'react'; import IconAlarm from 'public/assets/icons/icon-alarm.svg'; import IconHamburger from 'public/assets/icons/icon-hamburger.svg'; +import IconFeeCheck from 'public/assets/icons/icon-fee-check.svg'; import { getNotificationCount } from '@/apis/notification'; export default function MainHeader() { @@ -15,6 +16,7 @@ export default function MainHeader() { name: string; id: string; role: string; + isFeePaid: boolean; } | null>(null); useEffect(() => { @@ -40,8 +42,8 @@ export default function MainHeader() { return ( <>
-
- {user?.name}님 +
+ {user?.name}님{user?.isFeePaid ? : null}