From 5506234dd98eb5b8db49e382293be6e70e4f4e88 Mon Sep 17 00:00:00 2001 From: kimjaehyuk Date: Thu, 9 Nov 2023 19:08:28 +0900 Subject: [PATCH 01/14] =?UTF-8?q?feat:=ED=86=A0=EB=84=88=EB=A8=BC=ED=8A=B8?= =?UTF-8?q?=20=EB=AA=A8=EB=8B=AC=ED=83=80=EC=9E=85=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/admin/tournament/TournamentList.tsx | 18 ++++++++++++++++-- .../modal/admin/AdminEditTournamentBraket.tsx | 0 components/modal/modalType/AdminModal.tsx | 4 ++++ types/modalTypes.ts | 5 ++++- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 components/modal/admin/AdminEditTournamentBraket.tsx diff --git a/components/admin/tournament/TournamentList.tsx b/components/admin/tournament/TournamentList.tsx index 2f79fdefd..a78f1ef74 100644 --- a/components/admin/tournament/TournamentList.tsx +++ b/components/admin/tournament/TournamentList.tsx @@ -1,5 +1,6 @@ import dynamic from 'next/dynamic'; import { useCallback, useEffect, useState } from 'react'; +import { useSetRecoilState } from 'recoil'; import { Paper, Table, @@ -12,6 +13,7 @@ import { ITournament, ITournamentTable, } from 'types/admin/adminTournamentTypes'; +import { modalState } from 'utils/recoil/modal'; import { tableFormat } from 'constants/admin/table'; import { AdminEmptyItem, @@ -44,6 +46,7 @@ const smapleTournamentList: ITournament[] = Array.from({ length: 10 }, () => ({ })); export default function TournamentList() { + const setModal = useSetRecoilState(modalState); const [tournamentInfo, setTournamentInfo] = useState({ tournamentList: [], totalPage: 0, @@ -106,11 +109,22 @@ export default function TournamentList() {
+
diff --git a/components/modal/admin/AdminEditTournamentBraket.tsx b/components/modal/admin/AdminEditTournamentBraket.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/components/modal/modalType/AdminModal.tsx b/components/modal/modalType/AdminModal.tsx index 148590a3a..896a5e963 100644 --- a/components/modal/modalType/AdminModal.tsx +++ b/components/modal/modalType/AdminModal.tsx @@ -30,6 +30,7 @@ export default function AdminModal() { profile, item, coinPolicy, + ITournament, } = useRecoilValue(modalState); const content: { [key: string]: JSX.Element | null } = { @@ -76,6 +77,9 @@ export default function AdminModal() { 'ADMIN-COINPOLICY_EDIT': coinPolicy ? ( ) : null, + 'ADMIN-TOURNAMENT_BRAKET_EDIT': ITournament ? ( + + ) : null, }; if (!modalName) return null; diff --git a/types/modalTypes.ts b/types/modalTypes.ts index 27906a532..0d46989e7 100644 --- a/types/modalTypes.ts +++ b/types/modalTypes.ts @@ -11,6 +11,7 @@ import { MatchMode } from 'types/mainType'; import { ISeason } from 'types/seasonTypes'; import { StoreManualMode } from 'types/storeTypes'; import { ICoin } from 'types/userTypes'; +import { ITournament } from './admin/adminTournamentTypes'; type EventModal = 'WELCOME' | 'ANNOUNCEMENT'; @@ -44,7 +45,8 @@ type AdminModal = | 'ITEM_EDIT' | 'ITEM_DELETE' | 'COINPOLICY_EDIT' - | 'CHECK_SEND_NOTI'; + | 'CHECK_SEND_NOTI' + | 'TOURNAMENT_BRAKET_EDIT'; type ModalName = | null @@ -129,4 +131,5 @@ export interface Modal { isAttended?: boolean; totalCoin?: ICoin; randomItem?: IRandomItem; + ITournament?: ITournament; } From a54da778ffad9b47ddd64a857f32a5df970c4c17 Mon Sep 17 00:00:00 2001 From: kimjaehyuk Date: Thu, 9 Nov 2023 20:05:42 +0900 Subject: [PATCH 02/14] =?UTF-8?q?feat:=EB=B2=84=ED=8A=BC=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EB=AA=A8=EB=8B=AC=EC=97=B4=EA=B8=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80#1080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/admin/tournament/TournamentList.tsx | 15 ++++++++++++++- .../modal/admin/AdminEditTournamentBraket.tsx | 11 +++++++++++ components/modal/modalType/AdminModal.tsx | 7 ++++--- .../modal/AdminEditTournamentBraket.module.scss | 10 ++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 styles/admin/modal/AdminEditTournamentBraket.module.scss diff --git a/components/admin/tournament/TournamentList.tsx b/components/admin/tournament/TournamentList.tsx index a78f1ef74..b3eeff10c 100644 --- a/components/admin/tournament/TournamentList.tsx +++ b/components/admin/tournament/TournamentList.tsx @@ -13,6 +13,7 @@ import { ITournament, ITournamentTable, } from 'types/admin/adminTournamentTypes'; +import { TournamentInfo } from 'types/modalTypes'; import { modalState } from 'utils/recoil/modal'; import { tableFormat } from 'constants/admin/table'; import { @@ -45,6 +46,18 @@ const smapleTournamentList: ITournament[] = Array.from({ length: 10 }, () => ({ tournamentType: 'CUSTOM', })); +const sampleTournamentInfo: TournamentInfo = { + tournametId: 1, + title: '샘플 토너먼트 이름', + contents: '샘플 토너먼트 내용', + startDate: '13:00', + status: '종료', + type: 'CUSTOM', + winnerId: '1', + winnerImage: 'https://avatars.githubusercontent.com/u/93255519?v=4', + endDate: '15:00', +}; + export default function TournamentList() { const setModal = useSetRecoilState(modalState); const [tournamentInfo, setTournamentInfo] = useState({ @@ -119,7 +132,7 @@ export default function TournamentList() { onClick={() => { setModal({ modalName: 'ADMIN-TOURNAMENT_BRAKET_EDIT', - ITournament: tournament, + tournamentInfo: sampleTournamentInfo, }); }} > diff --git a/components/modal/admin/AdminEditTournamentBraket.tsx b/components/modal/admin/AdminEditTournamentBraket.tsx index e69de29bb..e6d6709af 100644 --- a/components/modal/admin/AdminEditTournamentBraket.tsx +++ b/components/modal/admin/AdminEditTournamentBraket.tsx @@ -0,0 +1,11 @@ +import styles from 'styles/admin/modal/AdminEditTournamentBraket.module.scss'; + +export default function AdminEditTournamentBraket() { + return ( + <> +
+

모다림다!

+
+ + ); +} diff --git a/components/modal/modalType/AdminModal.tsx b/components/modal/modalType/AdminModal.tsx index 896a5e963..645f14cdb 100644 --- a/components/modal/modalType/AdminModal.tsx +++ b/components/modal/modalType/AdminModal.tsx @@ -15,6 +15,7 @@ import AdminUserCoinModal from 'components/modal/admin/AdminUserCoinModal'; import DeletePenaltyModal from 'components/modal/admin/DeletePenaltyModal'; import DetailModal from 'components/modal/admin/DetailModal'; import AdminSeasonEdit from 'components/modal/admin/SeasonEdit'; +import AdminEditTournamentBraket from '../admin/AdminEditTournamentBraket'; export default function AdminModal() { const { @@ -30,7 +31,7 @@ export default function AdminModal() { profile, item, coinPolicy, - ITournament, + tournamentInfo, } = useRecoilValue(modalState); const content: { [key: string]: JSX.Element | null } = { @@ -77,8 +78,8 @@ export default function AdminModal() { 'ADMIN-COINPOLICY_EDIT': coinPolicy ? ( ) : null, - 'ADMIN-TOURNAMENT_BRAKET_EDIT': ITournament ? ( - + 'ADMIN-TOURNAMENT_BRAKET_EDIT': tournamentInfo ? ( + ) : null, }; diff --git a/styles/admin/modal/AdminEditTournamentBraket.module.scss b/styles/admin/modal/AdminEditTournamentBraket.module.scss new file mode 100644 index 000000000..da816fa93 --- /dev/null +++ b/styles/admin/modal/AdminEditTournamentBraket.module.scss @@ -0,0 +1,10 @@ +@import 'styles/common.scss'; + +.whole { + display: flex; + width: 510px; + height: 569px; + flex-direction: column; + background: #ffffff; + border-radius: 9px; +} From 97ac55155b5b4f55693f0b748a555deff87bd654 Mon Sep 17 00:00:00 2001 From: kimjaehyuk Date: Fri, 10 Nov 2023 13:45:28 +0900 Subject: [PATCH 03/14] =?UTF-8?q?fix:=20ITournament=20TournamentInfo=20?= =?UTF-8?q?=ED=95=84=EB=93=9C=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/tournament/TournamentList.tsx | 11 +++-------- .../modal/admin/AdminEditTournamentBraket.tsx | 19 +++++++++++++++++-- constants/admin/table.ts | 2 +- types/admin/adminTournamentTypes.ts | 2 +- types/modalTypes.ts | 2 +- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/components/admin/tournament/TournamentList.tsx b/components/admin/tournament/TournamentList.tsx index b3eeff10c..78bb0f8c3 100644 --- a/components/admin/tournament/TournamentList.tsx +++ b/components/admin/tournament/TournamentList.tsx @@ -31,7 +31,8 @@ const Quill = dynamic(() => import('react-quill'), { }); const tableTitle: { [key: string]: string } = { - tournamentName: '토너먼트 이름', + title: '토너먼트 이름', + content: '토너먼트 내용', startTime: '시작 시간', endTime: '종료 시간', tournamentType: '토너먼트 타입', @@ -39,7 +40,7 @@ const tableTitle: { [key: string]: string } = { }; const smapleTournamentList: ITournament[] = Array.from({ length: 10 }, () => ({ - tournamentName: '샘플토너먼트제목', + title: '샘플토너먼트제목', content: '샘플내용', startTime: new Date(), endTime: new Date(), @@ -121,12 +122,6 @@ export default function TournamentList() { )}
- +
+ ) : ( + tournament[ + columnName as keyof ITournament + ]?.toString() + )}
); } )} - -
- -
-
) ) From 678e7e951c9d1461bc722805ccfe17200304acca Mon Sep 17 00:00:00 2001 From: kimjaehyuk Date: Wed, 22 Nov 2023 17:23:25 +0900 Subject: [PATCH 11/14] =?UTF-8?q?[Fix]=20AdminEditTournamentBraket=20props?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0=20#1080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/modal/modalType/AdminModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/modal/modalType/AdminModal.tsx b/components/modal/modalType/AdminModal.tsx index 645f14cdb..fc80cda86 100644 --- a/components/modal/modalType/AdminModal.tsx +++ b/components/modal/modalType/AdminModal.tsx @@ -79,7 +79,7 @@ export default function AdminModal() { ) : null, 'ADMIN-TOURNAMENT_BRAKET_EDIT': tournamentInfo ? ( - + ) : null, }; From 572308b6836af4bd9c1fd655ee2fad9d21bf8ece Mon Sep 17 00:00:00 2001 From: kimjaehyuk Date: Wed, 22 Nov 2023 17:23:58 +0900 Subject: [PATCH 12/14] =?UTF-8?q?[Fix]=20dynamic=20import=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EB=AA=85=EC=8B=9C=20#1080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tournament/TournamentBraket.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/tournament/TournamentBraket.tsx b/components/tournament/TournamentBraket.tsx index 2f3d011eb..a8bd81e6a 100644 --- a/components/tournament/TournamentBraket.tsx +++ b/components/tournament/TournamentBraket.tsx @@ -1,4 +1,8 @@ import dynamic from 'next/dynamic'; +import { + SVGViewer as StaticSVGViewer, + SingleEliminationBracket as StaticSingleEliminationBracket, +} from '@g-loot/react-tournament-brackets'; import { Match } from '@g-loot/react-tournament-brackets/dist/src/types'; import React from 'react'; import TournamentMatch from 'components/tournament/TournamentMatch'; @@ -7,7 +11,9 @@ if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') { import('@g-loot/react-tournament-brackets'); } -const SingleEliminationBracket = dynamic( +const SingleEliminationBracket = dynamic< + React.ComponentProps +>( () => { return import('@g-loot/react-tournament-brackets').then( (mod) => mod.SingleEliminationBracket @@ -16,7 +22,7 @@ const SingleEliminationBracket = dynamic( { ssr: false } ); -const SVGViewer = dynamic( +const SVGViewer = dynamic>( () => { return import('@g-loot/react-tournament-brackets').then( (mod) => mod.SVGViewer From b8f3b734f5c13cc386526227ad3ca94dd1925f9e Mon Sep 17 00:00:00 2001 From: kimjaehyuk Date: Wed, 22 Nov 2023 17:41:26 +0900 Subject: [PATCH 13/14] =?UTF-8?q?[Fix]=20=EA=B5=AC=EB=B2=84=EC=A0=84=20Tou?= =?UTF-8?q?rnamentInfo=20=EC=82=AD=EC=A0=9C=20#1080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/admin/tournament/TournamentList.tsx | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/components/admin/tournament/TournamentList.tsx b/components/admin/tournament/TournamentList.tsx index 540706b59..cfb11a9d4 100644 --- a/components/admin/tournament/TournamentList.tsx +++ b/components/admin/tournament/TournamentList.tsx @@ -48,22 +48,6 @@ const smapleTournamentList: ITournament[] = Array.from({ length: 10 }, () => ({ count: 7, })); -const sampleTournamentInfo: TournamentInfo = { - tournamentId: 1, - title: '샘플 토너먼트 이름', - contents: '샘플 토너먼트 내용', - startTime: new Date(), - status: '종료', - type: 'CUSTOM', - winnerUser: { - id: 1, - intraId: 'username', - statusMessage: 'statusMessage', - roleType: 'USER', - }, - endTime: new Date(), -}; - export default function TournamentList() { const setModal = useSetRecoilState(modalState); const [tournamentInfo, setTournamentInfo] = useState({ @@ -125,7 +109,6 @@ export default function TournamentList() { onClick={() => { setModal({ modalName: 'ADMIN-TOURNAMENT_BRAKET_EDIT', - tournamentInfo: sampleTournamentInfo, }); }} > From b48303f71e35dea0bc43e0d7816b5907a91d51f3 Mon Sep 17 00:00:00 2001 From: kimjaehyuk Date: Wed, 22 Nov 2023 18:14:08 +0900 Subject: [PATCH 14/14] =?UTF-8?q?[Fix]=20=EA=B5=AC=EB=B2=84=EC=A0=84=20Tou?= =?UTF-8?q?rnamentInfo=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/modal/modalType/AdminModal.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/modal/modalType/AdminModal.tsx b/components/modal/modalType/AdminModal.tsx index fc80cda86..0c8432432 100644 --- a/components/modal/modalType/AdminModal.tsx +++ b/components/modal/modalType/AdminModal.tsx @@ -78,9 +78,7 @@ export default function AdminModal() { 'ADMIN-COINPOLICY_EDIT': coinPolicy ? ( ) : null, - 'ADMIN-TOURNAMENT_BRAKET_EDIT': tournamentInfo ? ( - - ) : null, + 'ADMIN-TOURNAMENT_BRAKET_EDIT': , }; if (!modalName) return null;