mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-16 07:56:22 -05:00
Show results tab even for ongoing
This commit is contained in:
parent
aa75323601
commit
bafa8ab908
|
|
@ -39,9 +39,24 @@
|
|||
}
|
||||
|
||||
.headerScore {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.headerScoreValue {
|
||||
font-size: var(--font-xl);
|
||||
font-weight: var(--weight-extra);
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.headerScoreLive {
|
||||
margin-top: var(--s-1);
|
||||
font-size: var(--font-3xs);
|
||||
font-weight: var(--weight-bold);
|
||||
letter-spacing: 0.1em;
|
||||
color: var(--color-error);
|
||||
}
|
||||
|
||||
.mapEvent {
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ export interface MatchTimelineProps {
|
|||
spChanges?: TimelineSpChanges;
|
||||
/** When true, render only the team + score header (no per-map rows or SP section). */
|
||||
compact?: boolean;
|
||||
/** When true, the match is still in progress; renders a small LIVE label under the score. */
|
||||
isOngoing?: boolean;
|
||||
}
|
||||
|
||||
export function MatchTimeline({
|
||||
|
|
@ -78,10 +80,16 @@ export function MatchTimeline({
|
|||
maps,
|
||||
spChanges,
|
||||
compact = false,
|
||||
isOngoing = false,
|
||||
}: MatchTimelineProps) {
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
<TimelineHeader teams={teams} score={score} maps={maps} />
|
||||
<TimelineHeader
|
||||
teams={teams}
|
||||
score={score}
|
||||
maps={maps}
|
||||
isOngoing={isOngoing}
|
||||
/>
|
||||
{compact
|
||||
? null
|
||||
: maps.map((map, i) => {
|
||||
|
|
@ -110,7 +118,9 @@ function TimelineHeader({
|
|||
teams,
|
||||
score,
|
||||
maps,
|
||||
}: Pick<MatchTimelineProps, "teams" | "score" | "maps">) {
|
||||
isOngoing,
|
||||
}: Pick<MatchTimelineProps, "teams" | "score" | "maps" | "isOngoing">) {
|
||||
const { t } = useTranslation(["q"]);
|
||||
const initialRosters = maps[0]?.rosters;
|
||||
|
||||
return (
|
||||
|
|
@ -133,7 +143,14 @@ function TimelineHeader({
|
|||
) : null}
|
||||
</div>
|
||||
<div className={styles.headerScore}>
|
||||
{score.alpha}-{score.bravo}
|
||||
<span className={styles.headerScoreValue}>
|
||||
{score.alpha}-{score.bravo}
|
||||
</span>
|
||||
{isOngoing ? (
|
||||
<span className={styles.headerScoreLive}>
|
||||
{t("q:match.timeline.live")}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<div className={clsx(styles.headerTeam, styles.headerTeamBravo)}>
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -75,6 +75,10 @@ export function SendouQMatchTabs({ data }: { data: SendouQMatchLoaderData }) {
|
|||
awaitingConfirmation ||
|
||||
(isLocked && lockedVoteVisible));
|
||||
|
||||
const hasReportedMaps = data.match.mapList.some(
|
||||
(m) => m.winnerGroupId !== null,
|
||||
);
|
||||
|
||||
const tabs: Array<"join" | "rosters" | "action" | "result"> = [];
|
||||
if (isLocked) {
|
||||
tabs.push("result", "rosters");
|
||||
|
|
@ -83,6 +87,7 @@ export function SendouQMatchTabs({ data }: { data: SendouQMatchLoaderData }) {
|
|||
tabs.push("rosters");
|
||||
}
|
||||
if (showActionTab) tabs.push("action");
|
||||
if (!isLocked && hasReportedMaps) tabs.push("result");
|
||||
|
||||
const allMembers = [
|
||||
...data.match.groupAlpha.members,
|
||||
|
|
@ -126,12 +131,13 @@ export function SendouQMatchTabs({ data }: { data: SendouQMatchLoaderData }) {
|
|||
close={() => navigate(sendouQMatchPage(data.match.id))}
|
||||
/>
|
||||
<MatchTabs tabs={tabs}>
|
||||
{isLocked ? (
|
||||
{isLocked || hasReportedMaps ? (
|
||||
<MatchResultTab
|
||||
teams={resolveTimelineTeams(data.match, t)}
|
||||
score={{ alpha: alphaWins, bravo: bravoWins }}
|
||||
maps={resolveTimelineMaps(data.match, data.reportedWeapons)}
|
||||
spChanges={resolveTimelineSpChanges(data.match)}
|
||||
isOngoing={!isLocked && hasReportedMaps}
|
||||
>
|
||||
{data.match.cancelRequestedByUserId ? (
|
||||
<p className="text-lighter text-xxs text-center mt-4">
|
||||
|
|
|
|||
|
|
@ -81,12 +81,15 @@ export function TournamentMatchTabs({
|
|||
|
||||
const leagueRoundLocked = isLeagueRoundLocked(tournament, data.match.roundId);
|
||||
|
||||
const hasReportedMaps = data.results.length > 0;
|
||||
|
||||
const tabs = resolveVisibleTabs({
|
||||
matchIsOver: data.matchIsOver,
|
||||
canReportScore,
|
||||
isParticipant,
|
||||
hasCurrentMap: Boolean(currentMap),
|
||||
hasMissingActiveRoster,
|
||||
hasReportedMaps,
|
||||
isPickBanStep,
|
||||
hasPickBanSetup,
|
||||
isAdminEligible,
|
||||
|
|
@ -105,6 +108,7 @@ export function TournamentMatchTabs({
|
|||
bravo: data.match.opponentTwo?.score ?? 0,
|
||||
}}
|
||||
maps={resolveTimelineMaps(data, opponentOneId, opponentTwoId)}
|
||||
isOngoing={!data.matchIsOver && hasReportedMaps}
|
||||
/>
|
||||
) : null}
|
||||
{tabs.includes("join") ? <TournamentMatchJoinTab data={data} /> : null}
|
||||
|
|
@ -384,6 +388,7 @@ function resolveVisibleTabs({
|
|||
isParticipant,
|
||||
hasCurrentMap,
|
||||
hasMissingActiveRoster,
|
||||
hasReportedMaps,
|
||||
isPickBanStep,
|
||||
hasPickBanSetup,
|
||||
isAdminEligible,
|
||||
|
|
@ -394,6 +399,7 @@ function resolveVisibleTabs({
|
|||
isParticipant: boolean;
|
||||
hasCurrentMap: boolean;
|
||||
hasMissingActiveRoster: boolean;
|
||||
hasReportedMaps: boolean;
|
||||
isPickBanStep: boolean;
|
||||
hasPickBanSetup: boolean;
|
||||
isAdminEligible: boolean;
|
||||
|
|
@ -423,6 +429,9 @@ function resolveVisibleTabs({
|
|||
if (isAdminEligible) {
|
||||
tabs.push("admin");
|
||||
}
|
||||
if (!matchIsOver && hasReportedMaps) {
|
||||
tabs.push("result");
|
||||
}
|
||||
|
||||
return tabs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "Loss",
|
||||
"match.timeline.out": "Out",
|
||||
"match.timeline.in": "In",
|
||||
"match.timeline.live": "LIVE",
|
||||
"match.timeline.points": "{{count}}p",
|
||||
"match.timeline.teamSp": "Team SP",
|
||||
"match.waitingForConfirmation": "Waiting for the other team to confirm the result",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@
|
|||
"match.timeline.loss": "",
|
||||
"match.timeline.out": "",
|
||||
"match.timeline.in": "",
|
||||
"match.timeline.live": "",
|
||||
"match.timeline.points": "",
|
||||
"match.timeline.teamSp": "",
|
||||
"match.waitingForConfirmation": "",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user