Skip to content

Commit

Permalink
feat:버튼 클릭 모달열기 추가#1080
Browse files Browse the repository at this point in the history
  • Loading branch information
greatSweetMango committed Nov 9, 2023
1 parent 4219a6c commit a54da77
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
15 changes: 14 additions & 1 deletion components/admin/tournament/TournamentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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<ITournamentTable>({
Expand Down Expand Up @@ -119,7 +132,7 @@ export default function TournamentList() {
onClick={() => {
setModal({
modalName: 'ADMIN-TOURNAMENT_BRAKET_EDIT',
ITournament: tournament,
tournamentInfo: sampleTournamentInfo,
});
}}
>
Expand Down
11 changes: 11 additions & 0 deletions components/modal/admin/AdminEditTournamentBraket.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styles from 'styles/admin/modal/AdminEditTournamentBraket.module.scss';

export default function AdminEditTournamentBraket() {
return (
<>
<div className={styles.whole}>
<h2>모다림다!</h2>
</div>
</>
);
}
7 changes: 4 additions & 3 deletions components/modal/modalType/AdminModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -30,7 +31,7 @@ export default function AdminModal() {
profile,
item,
coinPolicy,
ITournament,
tournamentInfo,
} = useRecoilValue(modalState);

const content: { [key: string]: JSX.Element | null } = {
Expand Down Expand Up @@ -77,8 +78,8 @@ export default function AdminModal() {
'ADMIN-COINPOLICY_EDIT': coinPolicy ? (
<AdminEditCoinPolicyModal {...coinPolicy} />
) : null,
'ADMIN-TOURNAMENT_BRAKET_EDIT': ITournament ? (
<AdminUserCoinModal intraId='JAEHYUKI' />
'ADMIN-TOURNAMENT_BRAKET_EDIT': tournamentInfo ? (
<AdminEditTournamentBraket {...tournamentInfo} />
) : null,
};

Expand Down
10 changes: 10 additions & 0 deletions styles/admin/modal/AdminEditTournamentBraket.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import 'styles/common.scss';

.whole {
display: flex;
width: 510px;
height: 569px;
flex-direction: column;
background: #ffffff;
border-radius: 9px;
}

0 comments on commit a54da77

Please sign in to comment.