From 47872b4964f1c6a972f024b4f8c9ed379f75be91 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 8 Oct 2024 13:56:37 +0900 Subject: [PATCH 1/9] =?UTF-8?q?Feat:=20=EB=8C=80=ED=9A=8C=20=EC=A2=85?= =?UTF-8?q?=EB=A3=8C=ED=95=98=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=A1=B0?= =?UTF-8?q?=EA=B1=B4=20=EB=B3=80=EA=B2=BD,=20=EC=83=81=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=ED=95=98=EA=B8=B0=20url=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/agenda/Form/AgendaResultForm.tsx | 33 ++++++++++++++++--- components/agenda/agendaDetail/AgendaInfo.tsx | 6 +--- pages/agenda/detail/host/index.tsx | 28 +++++++++++----- pages/agenda/detail/host/result.tsx | 20 +++++++---- .../agenda/Form/AgendaResultForm.module.scss | 26 +++++++++++++++ .../pages/agendakey/host/result.module.scss | 6 ++++ utils/agenda/getAgendaSnackBarInfo.ts | 4 +++ 7 files changed, 97 insertions(+), 26 deletions(-) diff --git a/components/agenda/Form/AgendaResultForm.tsx b/components/agenda/Form/AgendaResultForm.tsx index fd6cf2932..a4dabbc2b 100644 --- a/components/agenda/Form/AgendaResultForm.tsx +++ b/components/agenda/Form/AgendaResultForm.tsx @@ -1,4 +1,5 @@ -import React, { useState, useEffect, useRef } from 'react'; +import router from 'next/router'; +import React, { useEffect, useRef } from 'react'; import { AddElementBtn, DragBtn, @@ -178,7 +179,11 @@ const AgendaResultForm = ({ }); return ( -
+

- {award_idx} + {award_idx + 1} {': '}

@@ -245,7 +250,7 @@ const AgendaResultForm = ({ id='newAwardInput' ref={newAwardInputRef} type='text' - placeholder='추가할 상을 입력해주세요...' + placeholder='상을 입력해주세요.' onKeyUp={addAwardEnter} /> @@ -254,7 +259,25 @@ const AgendaResultForm = ({

- +
+ + +
); }; diff --git a/components/agenda/agendaDetail/AgendaInfo.tsx b/components/agenda/agendaDetail/AgendaInfo.tsx index a69f4c848..10cf58930 100644 --- a/components/agenda/agendaDetail/AgendaInfo.tsx +++ b/components/agenda/agendaDetail/AgendaInfo.tsx @@ -28,10 +28,6 @@ const subscribeTeam = ({ router, agendaKey }: CallbackProps) => { router.push(`/agenda/detail/team/create?agenda_key=${agendaKey}`); }; -const submitResults = ({ router, agendaKey }: CallbackProps) => { - router.push(`/agenda/detail/host/result?agenda_key=${agendaKey}`); -}; - export default function AgendaInfo({ agendaData, isHost, @@ -99,7 +95,7 @@ export default function AgendaInfo({ switch (agendaData.agendaStatus) { case AgendaStatus.CONFIRM: - return isHost ? { text: '결과입력', callback: submitResults } : null; + return isHost ? { text: '주최자 관리', callback: hostMode } : null; case AgendaStatus.OPEN: if (isHost) { // 주최자 diff --git a/pages/agenda/detail/host/index.tsx b/pages/agenda/detail/host/index.tsx index db42ba343..dfab0ba6b 100644 --- a/pages/agenda/detail/host/index.tsx +++ b/pages/agenda/detail/host/index.tsx @@ -20,6 +20,7 @@ const ModifyAgenda = () => { const { sendRequest } = useFetchRequest(); const { openModal } = useModal(); const agendaStatus = agendaData?.agendaStatus; + const agendaIsRanking = agendaData?.isRanking; const setSnackbar = useSetRecoilState(toastState); const handleClick = (description: string, onProceed: () => void) => { @@ -70,9 +71,14 @@ const ModifyAgenda = () => { const resultAgenda = () => { if (agendaStatus && agendaStatus === AgendaStatus.CONFIRM) { - handleClick('행사를 상 입력 없이 종료하시겠습니까?', () => { - sendRequest('PATCH', 'finish', {}, { agenda_key: agendaKey }); - router.push(`/agenda/detail?agenda_key=${agendaKey}`); + handleClick('행사를 종료하시겠습니까?', () => { + sendRequest( + 'PATCH', + 'finish', + { awards: [] }, + { agenda_key: agendaKey } + ); + window.location.href = `/agenda/detail?agenda_key=${agendaKey}`; }); } else { setSnackbar({ @@ -86,7 +92,7 @@ const ModifyAgenda = () => { const resultFormAgenda = () => { if (agendaStatus && agendaStatus === AgendaStatus.CONFIRM) { - handleClick('행사 종료 후 상 입력을 하시겠습니까?', () => { + handleClick('행사 종료 및 상 입력을 하시겠습니까?', () => { router.push(`/agenda/detail/host/result?agenda_key=${agendaKey}`); }); } else { @@ -111,6 +117,7 @@ const ModifyAgenda = () => { if (!agendaKey) { return ; } + console.log('data', agendaData); return ( <>
@@ -150,11 +157,14 @@ const ModifyAgenda = () => { 행사가 진행 중인 상태에서만 행사를 종료할 수 있습니다.
- - + {agendaIsRanking ? ( + + ) : ( + + )}
diff --git a/pages/agenda/detail/host/result.tsx b/pages/agenda/detail/host/result.tsx index 29a03ea51..f3471c5ad 100644 --- a/pages/agenda/detail/host/result.tsx +++ b/pages/agenda/detail/host/result.tsx @@ -24,7 +24,7 @@ function checkAwardSubmitable(awardList: AwardListProps[]) { const awardedTeams: { [key: string]: string } = {}; awardList.forEach((awardInfo) => { if (awardInfo.teams.length === 0) { - throw new Error(awardInfo.award + '상에 팀이 없습니다.'); + throw new Error(awardInfo.award + '에 팀이 없습니다.'); } awardInfo.teams.forEach((team) => { if (awardedTeams[team]) { @@ -59,7 +59,7 @@ function parseData(awardList: AwardListProps[]) { Data.push({ awardName: awardInfo.award, teamName: team, - awardPriority: key, + awardPriority: key + 1, }); }); }); @@ -118,15 +118,21 @@ const SubmitAgendaResult = () => { } const msg = awardlistToString(awardList); + openModal({ type: 'proceedCheck', title: '결과 제출 전 확인', description: msg + '\n결과를 제출하시겠습니까?', - onProceed: () => { - instanceInAgenda.patch(`/confirm?agenda_key=${agenda_key}`, { - awards: Data, - }); - closeModal(); + onProceed: async () => { + try { + await instanceInAgenda.patch(`/finish?agenda_key=${agenda_key}`, { + awards: Data, + }); + closeModal(); + window.location.href = `/agenda/detail?agenda_key=${agenda_key}`; + } catch (error) { + return error; + } }, }); }; diff --git a/styles/agenda/Form/AgendaResultForm.module.scss b/styles/agenda/Form/AgendaResultForm.module.scss index 2257141b0..1205493c1 100644 --- a/styles/agenda/Form/AgendaResultForm.module.scss +++ b/styles/agenda/Form/AgendaResultForm.module.scss @@ -106,3 +106,29 @@ outline: none; box-shadow: 0 0 5px 5px var(--highlight-yellow); } + +.formBtn { + display: flex; + height: 1rem; + flex: 1; + padding: 0.5rem; + margin: 0 0.5rem; + cursor: pointer; + user-select: none; + border-radius: $radius-small; + justify-content: center; + align-items: center; + &.submit { + @include textButton('submit', 'highlight'); + } + &.cancel { + @include textButton('cancel', 'default'); + } +} + +.buttonContainer { + display: flex; + margin: 1em 2rem; + gap: 1rem; + justify-content: space-between; +} diff --git a/styles/agenda/pages/agendakey/host/result.module.scss b/styles/agenda/pages/agendakey/host/result.module.scss index cbe1397c1..f0a52ddc2 100644 --- a/styles/agenda/pages/agendakey/host/result.module.scss +++ b/styles/agenda/pages/agendakey/host/result.module.scss @@ -1 +1,7 @@ @import 'styles/agenda/common.scss'; + +.container { + display: flex; + width: 100%; + padding: 0rem 4rem; +} diff --git a/utils/agenda/getAgendaSnackBarInfo.ts b/utils/agenda/getAgendaSnackBarInfo.ts index 4bb6d0f8b..e237ce89e 100644 --- a/utils/agenda/getAgendaSnackBarInfo.ts +++ b/utils/agenda/getAgendaSnackBarInfo.ts @@ -46,6 +46,10 @@ export default function getAgendaSnackBarInfo( severity: 'success', message: '대회가 성공적으로 확정되었습니다.', }, + '/finish': { + severity: 'success', + message: '결과가 성공적으로 등록되었습니다.', + }, '/cancel': { severity: 'info', message: '대회가 취소되었습니다.', From 152149c1649307723194deab25a57b1e6e1cbf96 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 8 Oct 2024 15:16:46 +0900 Subject: [PATCH 2/9] =?UTF-8?q?Feat:=20index=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=20=ED=99=94=EC=82=B4=ED=91=9C=20=EC=B6=94=EA=B0=80=20=EB=B0=8F?= =?UTF-8?q?=20css=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/agenda/Home/AgendaInfo.tsx | 10 ++++++++-- pages/index.tsx | 21 ++++++++++++++------- styles/agenda/Home/AgendaInfo.module.scss | 6 ++++-- styles/index.module.scss | 13 +++++++++++++ 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/components/agenda/Home/AgendaInfo.tsx b/components/agenda/Home/AgendaInfo.tsx index b21000e5d..854ffb109 100644 --- a/components/agenda/Home/AgendaInfo.tsx +++ b/components/agenda/Home/AgendaInfo.tsx @@ -1,4 +1,5 @@ import Image from 'next/image'; +import router from 'next/router'; import { AgendaDataProps } from 'types/agenda/agendaDetail/agendaTypes'; import { showPeriod } from 'utils/handleTime'; import AgendaTags from 'components/agenda/utils/AgendaTags'; @@ -19,8 +20,13 @@ const AgendaInfo = ({
현재 모집 중인 행사가 없습니다.
-
Agenda 페이지 이동
- +
Agenda 가기
+ { + router.push('/agenda'); + }} + />
); diff --git a/pages/index.tsx b/pages/index.tsx index f2638220b..50cf2693c 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -2,6 +2,7 @@ import Image from 'next/image'; import { useRouter } from 'next/router'; import type { NextPage } from 'next'; import PageController from 'components/agenda/utils/PageController'; +import RightArrow from 'public/image/agenda/ChevronRight.svg'; import PingpongIcon from 'public/image/takgu/ping-pong.svg'; import styles from 'styles/index.module.scss'; @@ -14,12 +15,18 @@ const Index: NextPage = () => { return (
-

handleNavigation('/agenda')} - > - Agenda -

+
+

handleNavigation('/agenda')} + > + Agenda +

+ handleNavigation('/agenda')} + /> +
@@ -62,7 +69,7 @@ const Index: NextPage = () => {

handleNavigation('/takgu')} + // onClick={() => handleNavigation('/outer')} > Outer match

diff --git a/styles/agenda/Home/AgendaInfo.module.scss b/styles/agenda/Home/AgendaInfo.module.scss index 5b50dea4a..ddd61fddd 100644 --- a/styles/agenda/Home/AgendaInfo.module.scss +++ b/styles/agenda/Home/AgendaInfo.module.scss @@ -9,6 +9,7 @@ justify-content: center; align-items: center; gap: 2rem; + @include text('default'); } .emptyContent { @@ -17,13 +18,14 @@ justify-content: center; align-items: center; gap: 0.5rem; + @include text('tab'); } .arrowIcon { position: absolute; right: -2rem; - width: 1.5rem; - height: 1.5rem; + width: 1.2rem; + height: 1.2rem; } .agendaInfoContainer { diff --git a/styles/index.module.scss b/styles/index.module.scss index 4dc5ee2ba..e0f7d953f 100644 --- a/styles/index.module.scss +++ b/styles/index.module.scss @@ -20,6 +20,12 @@ cursor: pointer; } +.titleWarp { + display: flex; + align-items: center; + gap: 0.5rem; +} + .container { @include container(1); width: calc(100% - 2rem); @@ -66,3 +72,10 @@ .pingpong { grid-area: pingpong; } + +.arrowIcon { + width: 1.2rem; + height: 1.2rem; + pointer-events: auto; + cursor: pointer; +} From b9d839086ce60f6c600fe65dcdafeb5ca9bced2c Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Tue, 8 Oct 2024 16:47:01 +0900 Subject: [PATCH 3/9] =?UTF-8?q?Fix:=20=EC=A7=80=EC=9B=90=ED=95=98=EA=B8=B0?= =?UTF-8?q?=20layout=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/TakguLayout.tsx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Layout/TakguLayout.tsx b/Layout/TakguLayout.tsx index bd9d5c344..db0cd20e2 100644 --- a/Layout/TakguLayout.tsx +++ b/Layout/TakguLayout.tsx @@ -1,7 +1,6 @@ +import { useRouter } from 'next/router'; import { useRecoilValue } from 'recoil'; import { openCurrentMatchState } from 'utils/recoil/takgu/match'; -import AdminReject from 'components/admin/AdminReject'; -import AdminLayout from 'components/admin/Layout'; import CurrentMatch from 'components/takgu/Layout/CurrentMatch'; import Footer from 'components/takgu/Layout/Footer'; import Header from 'components/takgu/Layout/Header'; @@ -16,7 +15,6 @@ import useGetUserSeason from 'hooks/takgu/Layout/useGetUserSeason'; import useLiveCheck from 'hooks/takgu/Layout/useLiveCheck'; import useSetAfterGameModal from 'hooks/takgu/Layout/useSetAfterGameModal'; import { useUser } from 'hooks/takgu/Layout/useUser'; -import useAxiosResponse from 'hooks/useAxiosResponse'; import styles from 'styles/takgu/Layout/Layout.module.scss'; import PlayButton from '../components/takgu/Layout/PlayButton'; import UserLayout from '../components/takgu/Layout/UserLayout'; @@ -30,9 +28,9 @@ type TakguLayoutProps = { function TakguLayout({ children }: TakguLayoutProps) { const user = useUser(); const presentPath = usePathname(); + const path = useRouter().pathname; const openCurrentMatch = useRecoilValue(openCurrentMatchState); - // useAxiosResponse(); useGetUserSeason(presentPath); useSetAfterGameModal(); useLiveCheck(presentPath); @@ -41,14 +39,10 @@ function TakguLayout({ children }: TakguLayoutProps) { if (!user || !user.intraId) return null; switch (true) { - case presentPath.includes('takgu/admin'): - if (!user.isAdmin) return ; - return {children}; - - case presentPath.includes('takgu/recruit'): + case path.includes('takgu/recruit'): return {children}; - case presentPath === 'takgu/statistics' && user.isAdmin: + case path.includes('takgu/statistics') && user.isAdmin: return ( @@ -86,10 +80,8 @@ function TakguLayout({ children }: TakguLayoutProps) { const TakguAppLayout = ({ children }: TakguLayoutProps) => { return ( <> - - {children} - - + {children} + ); From 19f47afb8701e59e50aaad3f2f3c0d5fd8efd915 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Thu, 10 Oct 2024 10:16:59 +0900 Subject: [PATCH 4/9] =?UTF-8?q?Fix:=20=EC=9D=B8=EB=8D=B1=EC=8A=A4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=AF=B8=EC=A7=80=201:1=EA=B3=A0?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index.tsx | 20 ++++++++++++-------- styles/index.module.scss | 10 ++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/pages/index.tsx b/pages/index.tsx index 50cf2693c..f15e94bb2 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -41,13 +41,15 @@ const Index: NextPage = () => { className={styles.container} onClick={() => handleNavigation('/agenda/ticket')} > - ticket +
+ ticket +
@@ -61,7 +63,9 @@ const Index: NextPage = () => { className={styles.container} onClick={() => handleNavigation('/takgu')} > - +
+ +
diff --git a/styles/index.module.scss b/styles/index.module.scss index e0f7d953f..c3485c97e 100644 --- a/styles/index.module.scss +++ b/styles/index.module.scss @@ -79,3 +79,13 @@ pointer-events: auto; cursor: pointer; } + +.imageWarpper { + position: relative; + padding: 0.5rem; + overflow: hidden; + cursor: pointer; + @media screen and (max-width: 961px) { + padding: 1rem; + } +} From 4629048eb058fc289dd73c6c1ba5a49eca98e236 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Thu, 10 Oct 2024 10:18:13 +0900 Subject: [PATCH 5/9] =?UTF-8?q?Feat:=20=ED=97=A4=EB=8D=94=20=EB=B0=8F=20?= =?UTF-8?q?=EB=A9=94=EB=89=B4=EB=B0=94=20=EC=9C=84=EC=B9=98=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/agenda/Layout/AgendaHeader.tsx | 9 ++-- components/agenda/Layout/MenuBar.tsx | 18 ++++--- .../takgu/Layout/MenuBar/MenuBarElement.tsx | 11 ++-- styles/agenda/Layout/Header.module.scss | 9 +++- styles/agenda/Layout/MenuBar.module.scss | 52 +++++++++++++++++-- 5 files changed, 79 insertions(+), 20 deletions(-) diff --git a/components/agenda/Layout/AgendaHeader.tsx b/components/agenda/Layout/AgendaHeader.tsx index 78dd01617..ffbc04d8f 100644 --- a/components/agenda/Layout/AgendaHeader.tsx +++ b/components/agenda/Layout/AgendaHeader.tsx @@ -29,15 +29,16 @@ export default function AgendaHeader() {
+ HeaderState?.setOpenMenuBarState(!menu)} + /> +
- HeaderState?.setOpenMenuBarState(!menu)} - />
diff --git a/components/agenda/Layout/MenuBar.tsx b/components/agenda/Layout/MenuBar.tsx index 28075efd8..4fc01ee09 100644 --- a/components/agenda/Layout/MenuBar.tsx +++ b/components/agenda/Layout/MenuBar.tsx @@ -40,16 +40,20 @@ const MenuBar = ({ headerstate }: { headerstate: HeaderContextState }) => { headerstate.openMenuState ? styles.active : styles.inactive }`} > - +
+ +
+ {/* */} +
@@ -58,6 +62,8 @@ const MenuBar = ({ headerstate }: { headerstate: HeaderContextState }) => { +
+
{user?.isAdmin ? ( <> diff --git a/components/takgu/Layout/MenuBar/MenuBarElement.tsx b/components/takgu/Layout/MenuBar/MenuBarElement.tsx index 7fe74b20f..da800cd07 100644 --- a/components/takgu/Layout/MenuBar/MenuBarElement.tsx +++ b/components/takgu/Layout/MenuBar/MenuBarElement.tsx @@ -179,11 +179,12 @@ export const AdminMenu = () => { {isAdmin && (
- + + +
)}
diff --git a/styles/agenda/Layout/Header.module.scss b/styles/agenda/Layout/Header.module.scss index 8676290cb..b20b2e382 100644 --- a/styles/agenda/Layout/Header.module.scss +++ b/styles/agenda/Layout/Header.module.scss @@ -18,8 +18,11 @@ padding: 1rem; font-size: $font-size-l; - justify-content: space-between; + gap: 1rem; align-items: center; + @media screen and (min-width: 481px) { + gap: 1.5rem; + } } .logo { @@ -36,11 +39,15 @@ height: 100%; flex: 2; gap: 2rem; + // justify-content: center; justify-content: flex-start; align-items: center; } .menuIcon { + // position: absolute; + // left: 2; + z-index: 2; width: 1.5rem; height: 1.5rem; cursor: pointer; diff --git a/styles/agenda/Layout/MenuBar.module.scss b/styles/agenda/Layout/MenuBar.module.scss index 8a5c24370..5da906425 100644 --- a/styles/agenda/Layout/MenuBar.module.scss +++ b/styles/agenda/Layout/MenuBar.module.scss @@ -1,4 +1,5 @@ @import 'styles/agenda/common.scss'; + .container { position: fixed; top: 4rem; @@ -11,13 +12,13 @@ background: var(--menubar-bg); } .inactive { - right: calc(max(25vw, 200px) * -1); + left: calc(max(25vw, 200px) * -1); box-shadow: none; transition: all 0.5s; } .active { - right: 0; - box-shadow: -1px 0 6px 0 var(--color-text); + left: 0; // 변경 + box-shadow: 1px 0 6px 0 var(--color-text); transition: all 0.5s; } @@ -28,6 +29,7 @@ width: 100vw; height: 100vh; } + .button { display: flex; width: 100%; @@ -58,9 +60,17 @@ font-size: $font-size-s; color: var(--color-text); } + + h3 { + margin: 0; + margin-bottom: 1rem; + font-size: $font-size-s; + color: var(--color-text); + } p, h1, - h2 { + h2, + h3 { @include hoverAction; } } @@ -78,3 +88,37 @@ .activebg { z-index: 300; } + +.row { + display: flex; + justify-content: flex-start; + align-items: center; + margin: 0.5rem 0; +} + +.icon { + display: inline-flex; + width: 1.2rem; + height: 1.2rem; + margin-left: 0.5rem; + pointer-events: auto; + cursor: pointer; + align-items: center; + @include hoverAction; +} +.profile { + display: flex; + width: 100%; + width: 4.5rem; + height: 1.2rem; + flex-direction: column; + padding: 0.5rem; + margin: 0; + margin: 1rem 0.2rem; + border: var(--default-border); + border-radius: $radius-medium; + // box-shadow: var(--default-box-shadow); + border-radius: $radius-extra-small; + justify-content: center; + align-items: center; +} From cb6b085cec20fa81393e436297698ec5e781bf79 Mon Sep 17 00:00:00 2001 From: irenee-14 Date: Thu, 10 Oct 2024 10:46:11 +0900 Subject: [PATCH 6/9] =?UTF-8?q?Fix:=20=EB=AA=A8=EB=8B=AC=20=ED=98=B8?= =?UTF-8?q?=EC=B6=9C=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/TakguLayout.tsx | 24 ++++++++++++++---------- utils/recoil/agenda/modalState.ts | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Layout/TakguLayout.tsx b/Layout/TakguLayout.tsx index db0cd20e2..ea2c1a20c 100644 --- a/Layout/TakguLayout.tsx +++ b/Layout/TakguLayout.tsx @@ -25,7 +25,7 @@ type TakguLayoutProps = { children: React.ReactNode; }; -function TakguLayout({ children }: TakguLayoutProps) { +const TakguLayout = ({ children }: TakguLayoutProps) => { const user = useUser(); const presentPath = usePathname(); const path = useRouter().pathname; @@ -38,18 +38,20 @@ function TakguLayout({ children }: TakguLayoutProps) { if (!user || !user.intraId) return null; - switch (true) { - case path.includes('takgu/recruit'): + const renderContent = () => { + if (path.includes('takgu/recruit')) { return {children}; + } - case path.includes('takgu/statistics') && user.isAdmin: + if (path.includes('takgu/statistics') && user.isAdmin) { return ( ); + } - case presentPath.includes('takgu'): + if (presentPath.includes('takgu')) { return ( <> @@ -65,12 +67,15 @@ function TakguLayout({ children }: TakguLayoutProps) { {children}