Skip to content

Commit

Permalink
[Fix] 바깥 창 클릭시 하이라이트 제거기능 제거 #1138
Browse files Browse the repository at this point in the history
  • Loading branch information
Junho Jeon committed Dec 8, 2023
1 parent 64f876a commit 85d7734
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions components/tournament/TournamentBraket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ export default function TournamentBraket({
containerSize,
}: TournamentBraketProps) {
const [, setHighLightUser] = useRecoilState(clickedTournamentState);

if (singleEliminationBracketMatchs.length === 0)
return <h1 style={{ color: 'white' }}>Loading...</h1>;
// const [width, height] = useWindowSize();
const finalWidth = containerSize?.width; //Math.max(width - 50, 500);
const finalHeight = containerSize?.height; //Math.max(height - 100, 500);

Expand All @@ -61,7 +61,7 @@ export default function TournamentBraket({
e: React.MouseEvent<HTMLDivElement>
) => {
e.stopPropagation();
setHighLightUser(party.name);
if (party.name !== 'TBD') setHighLightUser(party.name);
}}
matchComponent={TournamentMatch}
options={{
Expand Down
2 changes: 2 additions & 0 deletions components/tournament/TournamentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useSetRecoilState } from 'recoil';
import { BiCalendar } from 'react-icons/bi';
import { MdPeopleAlt } from 'react-icons/md';
import { Modal } from 'types/modalTypes';
import { TournamentInfo } from 'types/tournamentTypes';
import { dateToString } from 'utils/handleTime';
Expand Down Expand Up @@ -51,6 +52,7 @@ export default function TournamentCard({
>
<div className={styles.text}>
<div className={styles.left}>{title}</div>
<MdPeopleAlt /> {player_cnt} / 8
<div className={styles.right}>
<BiCalendar /> {start}
</div>
Expand Down
21 changes: 8 additions & 13 deletions pages/tournament.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { start } from 'repl';
import { Match } from '@g-loot/react-tournament-brackets/dist/src/types';
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { useQuery } from 'react-query';
Expand Down Expand Up @@ -80,19 +81,13 @@ export default function Tournament() {
<h1 className={styles.title}>Tournament</h1>
<div className={styles.tournamentContainer}>
<div className={styles.tournamentText}> 예정된 토너먼트 </div>
<div className={styles.waitTournamentBox}>
{waitTournament?.tournaments.map((tournament) => (
<div className={styles.cardContainer} key={tournament.tournamentId}>
<TournamentCard key={tournament.tournamentId} {...tournament} />
</div>
))}
</div>
<div className={styles.tournamentTextOpen}> 진행중인 토너먼트 </div>
<div
className={styles.openTournamentBox}
ref={containerRef}
onClick={() => sethighLightUser('')}
>
{waitTournament?.tournaments.map((tournament) => (
<div className={styles.cardContainer} key={tournament.tournamentId}>
<TournamentCard key={tournament.tournamentId} {...tournament} />
</div>
))}
<div className={styles.tournamentText}> 진행중인 토너먼트 </div>
<div className={styles.openTournamentBox} ref={containerRef}>
{openInfo.data && openInfo.data.tournaments.length === 0 ? (
<div className={styles.tournamentText}>
진행중인 토너먼트가 없습니다
Expand Down

0 comments on commit 85d7734

Please sign in to comment.