fix: hide tournament code state from bracket
This commit is contained in:
1 parent
e12f182e7f
commit
9decc6866f
1 file changed
-29
@@ -2450,18 +2450,6 @@ function formatDoubleEliminationMatchState(
|
|||||||
return "대기";
|
return "대기";
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDoubleEliminationCodeState(state?: string) {
|
|
||||||
if (!state) return null;
|
|
||||||
const labels: Record<string, string> = {
|
|
||||||
reserved: "코드 발급",
|
|
||||||
used: "코드 사용",
|
|
||||||
released: "코드 해제",
|
|
||||||
expired: "코드 만료",
|
|
||||||
voided: "코드 폐기",
|
|
||||||
};
|
|
||||||
return labels[state] ?? state;
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatDoubleEliminationCompletionType(
|
function formatDoubleEliminationCompletionType(
|
||||||
completedBy?: ApiDoubleEliminationBracketMatch["completedBy"],
|
completedBy?: ApiDoubleEliminationBracketMatch["completedBy"],
|
||||||
) {
|
) {
|
||||||
@@ -2509,11 +2497,6 @@ function DoubleEliminationBracketSection({
|
|||||||
layoutNodeById.has(connector.fromBracketMatchId) &&
|
layoutNodeById.has(connector.fromBracketMatchId) &&
|
||||||
layoutNodeById.has(connector.toBracketMatchId),
|
layoutNodeById.has(connector.toBracketMatchId),
|
||||||
);
|
);
|
||||||
const codeByBracketMatchId = new Map(
|
|
||||||
match.tournamentCodes
|
|
||||||
.filter((slot) => slot.bracketMatchId)
|
|
||||||
.map((slot) => [slot.bracketMatchId as string, slot]),
|
|
||||||
);
|
|
||||||
const seriesByBracketMatchId = new Map(
|
const seriesByBracketMatchId = new Map(
|
||||||
(match.result?.seriesResults ?? [])
|
(match.result?.seriesResults ?? [])
|
||||||
.filter((series) => series.bracketMatchId)
|
.filter((series) => series.bracketMatchId)
|
||||||
@@ -2661,10 +2644,6 @@ function DoubleEliminationBracketSection({
|
|||||||
seriesResult={seriesByBracketMatchId.get(
|
seriesResult={seriesByBracketMatchId.get(
|
||||||
bracketMatch.bracketMatchId,
|
bracketMatch.bracketMatchId,
|
||||||
)}
|
)}
|
||||||
codeState={
|
|
||||||
codeByBracketMatchId.get(bracketMatch.bracketMatchId)
|
|
||||||
?.state
|
|
||||||
}
|
|
||||||
canManage={canManage}
|
canManage={canManage}
|
||||||
busy={busy}
|
busy={busy}
|
||||||
onWalkover={onWalkover}
|
onWalkover={onWalkover}
|
||||||
@@ -2758,7 +2737,6 @@ function DoubleEliminationBracketCard({
|
|||||||
bracketMatch,
|
bracketMatch,
|
||||||
seedNumberByTeamIndex,
|
seedNumberByTeamIndex,
|
||||||
seriesResult,
|
seriesResult,
|
||||||
codeState,
|
|
||||||
canManage,
|
canManage,
|
||||||
busy,
|
busy,
|
||||||
onWalkover,
|
onWalkover,
|
||||||
@@ -2770,7 +2748,6 @@ function DoubleEliminationBracketCard({
|
|||||||
bracketMatch: ApiDoubleEliminationBracketMatch;
|
bracketMatch: ApiDoubleEliminationBracketMatch;
|
||||||
seedNumberByTeamIndex: Map<number, number>;
|
seedNumberByTeamIndex: Map<number, number>;
|
||||||
seriesResult?: DoubleEliminationSeriesResult;
|
seriesResult?: DoubleEliminationSeriesResult;
|
||||||
codeState?: string;
|
|
||||||
canManage: boolean;
|
canManage: boolean;
|
||||||
busy: boolean;
|
busy: boolean;
|
||||||
onWalkover: (bracketMatchId: string, winnerTeamIndex: number) => void;
|
onWalkover: (bracketMatchId: string, winnerTeamIndex: number) => void;
|
||||||
@@ -2782,7 +2759,6 @@ function DoubleEliminationBracketCard({
|
|||||||
canManage &&
|
canManage &&
|
||||||
bracketMatch.state === "ready" &&
|
bracketMatch.state === "ready" &&
|
||||||
Boolean(bracketMatch.teamAIndex && bracketMatch.teamBIndex);
|
Boolean(bracketMatch.teamAIndex && bracketMatch.teamBIndex);
|
||||||
const codeStateLabel = formatDoubleEliminationCodeState(codeState);
|
|
||||||
const completionTypeLabel = formatDoubleEliminationCompletionType(
|
const completionTypeLabel = formatDoubleEliminationCompletionType(
|
||||||
bracketMatch.completedBy,
|
bracketMatch.completedBy,
|
||||||
);
|
);
|
||||||
@@ -2865,11 +2841,6 @@ function DoubleEliminationBracketCard({
|
|||||||
bracketMatch.bracketSide
|
bracketMatch.bracketSide
|
||||||
] ?? bracketMatch.bracketSide}
|
] ?? bracketMatch.bracketSide}
|
||||||
</span>
|
</span>
|
||||||
{codeStateLabel && (
|
|
||||||
<span className="shrink-0 border border-base-content/10 px-1 text-[10px] font-bold text-base-content/45">
|
|
||||||
{codeStateLabel}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{completionTypeLabel && (
|
{completionTypeLabel && (
|
||||||
<span className="shrink-0 border border-accent/25 bg-accent/10 px-1 text-[10px] font-black text-accent">
|
<span className="shrink-0 border border-accent/25 bg-accent/10 px-1 text-[10px] font-black text-accent">
|
||||||
{completionTypeLabel}
|
{completionTypeLabel}
|
||||||
|
|||||||
Reference in new issue
Block a user