Skip to content

Commit

Permalink
[Refactor] stale time 프롭 추가 및 fallback text 제거 #1203
Browse files Browse the repository at this point in the history
  • Loading branch information
Clearsu committed Jan 4, 2024
1 parent 74ccebf commit 6ef6406
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions components/tournament/UserTournamentBracket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import styles from 'styles/tournament/UserTournamentBracket.module.scss';

interface UserTournamentBracketProps {
tournamentId: number | undefined;
fallbackText?: string;
queryStaleTime: number;
}

export default function UserTournamentBraket({
tournamentId,
fallbackText,
queryStaleTime,
}: UserTournamentBracketProps) {
const setError = useSetRecoilState(errorState);
const [ref, size] = useComponentSize<HTMLDivElement>();
Expand All @@ -37,7 +37,7 @@ export default function UserTournamentBraket({
() => fetchTournamentGames(),
{
enabled: !!tournamentId, // tournamentId가 undefined가 아닐 때만 작동하도록
staleTime: 86400000, // 하루
staleTime: queryStaleTime,
}
);

Expand All @@ -49,13 +49,11 @@ export default function UserTournamentBraket({
<div ref={ref} className={styles.bracketContainer}>
{isLoading ? (
<LoadingSpinner />
) : tournamentId ? (
) : (
<TournamentBraket
singleEliminationBracketMatchs={bracketMatches}
containerSize={size}
/>
) : (
<div className={styles.noTournamentText}>{fallbackText}</div>
)}
</div>
);
Expand Down

0 comments on commit 6ef6406

Please sign in to comment.