Alternating pool code for tournaments

This commit is contained in:
Kalle
2023-10-11 21:49:51 +03:00
parent 69db988ef5
commit 6b5a12ba04
9 changed files with 49 additions and 33 deletions

View File

@@ -79,15 +79,30 @@ export function ScoreReporter({
) : null,
showFullInfos ? (
<>
{t("tournament:match.pass", { pass: resolveRoomPass(data.match.id) })}
{t("tournament:match.pass")}{" "}
<span className="text-theme font-bold">
{resolveRoomPass(data.match.id)}
</span>
</>
) : null,
showFullInfos ? (
<>
{t("tournament:match.pool", {
code: HACKY_resolvePoolCode(parentRouteData.event),
})}
</>
<span>
{t("tournament:match.pool")}{" "}
{
HACKY_resolvePoolCode({
event: parentRouteData.event,
matchId: data.match.id,
}).prefix
}
<span className="text-theme font-bold">
{
HACKY_resolvePoolCode({
event: parentRouteData.event,
matchId: data.match.id,
}).lastDigit
}
</span>
</span>
) : null,
<>
{t("tournament:match.score", {

View File

@@ -141,10 +141,17 @@ export function checkSourceIsValid({
return false;
}
export function HACKY_resolvePoolCode(event: TournamentLoaderData["event"]) {
if (event.name.includes("In The Zone")) return "ITZ";
export function HACKY_resolvePoolCode({
event,
matchId,
}: {
event: TournamentLoaderData["event"];
matchId: number;
}) {
const prefix = event.name.includes("In The Zone") ? "ITZ" : "PN";
const lastDigit = matchId % 10;
return "PICNIC";
return { prefix, lastDigit };
}
export function bracketSubscriptionKey(tournamentId: number) {

View File

@@ -22,7 +22,8 @@
border-end-start-radius: var(--rounded);
color: var(--tournaments-text);
column-gap: var(--s-8);
font-size: var(--fonts-xs);
font-size: var(--fonts-xsm);
letter-spacing: 0.3px;
}
.tournament-bracket__infos__label {

View File

@@ -87,10 +87,7 @@ import {
import type { TournamentLoaderData } from "./to.$id";
import { FormWithConfirm } from "~/components/FormWithConfirm";
import { deleteTeam } from "../queries/deleteTeam.server";
import {
HACKY_resolvePoolCode,
findMapPoolByTeamId,
} from "~/features/tournament-bracket";
import { findMapPoolByTeamId } from "~/features/tournament-bracket";
import { Popover } from "~/components/Popover";
export const handle: SendouRouteHandle = {
@@ -471,7 +468,6 @@ function CheckIn({
endDate: Date;
checkedIn?: boolean;
}) {
const data = useOutletContext<TournamentLoaderData>();
const { t, i18n } = useTranslation(["tournament"]);
const isMounted = useIsMounted();
const fetcher = useFetcher();
@@ -510,9 +506,7 @@ function CheckIn({
if (checkedIn) {
return (
<div className="text-center text-xs">
{t("tournament:pre.checkIn.checkedIn", {
pool: HACKY_resolvePoolCode(data.event),
})}
{t("tournament:pre.checkIn.checkedIn")}
</div>
);
}

View File

@@ -22,7 +22,7 @@
"pre.checkIn.over": "Check-in is over",
"pre.checkIn.cant": "Complete the previous steps before checking in",
"pre.checkIn.button": "Check in",
"pre.checkIn.checkedIn": "Your team is checked in. Please join the Pool: {{pool}}",
"pre.checkIn.checkedIn": "Your team is checked in",
"pre.info.header": "Team info",
"pre.info.unregister": "Unregister",
@@ -115,8 +115,8 @@
"bracket.standings.showMore": "Show more",
"match.hosts": "{{teamName}} hosts",
"match.pass": "Pass {{pass}}",
"match.pool": "Pool {{code}}",
"match.pass": "Pass",
"match.pool": "Pool",
"match.score": "{{scoreOne}}-{{scoreTwo}} (Best of {{bestOf}})",
"match.action.undoLastScore": "Undo last score",
"match.action.reopenMatch": "Reopen match",

View File

@@ -22,7 +22,7 @@
"pre.checkIn.over": "L'enregistrement est fini",
"pre.checkIn.cant": "Complétez les étapes précédentes avant de vous enregistrer",
"pre.checkIn.button": "S'enregistrer",
"pre.checkIn.checkedIn": "Votre équipe est enregistrée. Veuillez rejoindre le canal: {{pool}}",
"pre.checkIn.checkedIn": "Votre équipe est enregistrée",
"pre.info.header": "Info équipe",
"pre.info.unregister": "Se désinscrire",
@@ -115,8 +115,8 @@
"bracket.standings.showMore": "Montrer plus",
"match.hosts": "{{teamName}} héberge",
"match.pass": "MdP {{pass}}",
"match.pool": "Canal {{code}}",
"match.pass": "MdP",
"match.pool": "Canal}",
"match.score": "{{scoreOne}}-{{scoreTwo}} (Meilleur de {{bestOf}})",
"match.action.undoLastScore": "Annuler le dernier score",
"match.action.reopenMatch": "Rouvrir le match",

View File

@@ -22,7 +22,6 @@
"pre.checkIn.over": "צ'ק-אין נגמר",
"pre.checkIn.cant": "השלימו את השלבים הקודמים לפני צ'ק-אין",
"pre.checkIn.button": "צ'ק אין",
"pre.checkIn.checkedIn": "הצוות שלכם עשה צ'ק-אין. בבקשה הצטרפו לפול: {{pool}}",
"pre.info.header": "מידע על הצוות",
"pre.info.unregister": "ביטול הרשמה",
@@ -115,8 +114,8 @@
"bracket.standings.showMore": "הראו יותר",
"match.hosts": "{{teamName}} מארחים",
"match.pass": "סיסמה {{pass}}",
"match.pool": "פול {{code}}",
"match.pass": "סיסמה",
"match.pool": "פול",
"match.score": "{{scoreOne}}-{{scoreTwo}} (הטוב מ-{{bestOf}})",
"match.action.undoLastScore": "בטלו את התוצאה האחרונה",
"match.action.reopenMatch": "פתיחה מחדש של הקרב",

View File

@@ -22,7 +22,7 @@
"pre.checkIn.over": "チェックインは終了しました",
"pre.checkIn.cant": "チェックインするための入力を完了してください",
"pre.checkIn.button": "チェックイン",
"pre.checkIn.checkedIn": "チームのチェックインが完了しました。プールに参加してください: {{pool}}",
"pre.checkIn.checkedIn": "チームのチェックインが完了しました",
"pre.info.header": "チーム情報",
"pre.info.unregister": "登録解除",
@@ -115,8 +115,8 @@
"bracket.standings.showMore": "さらに表示",
"match.hosts": "{{teamName}} ホスト",
"match.pass": "通過 {{pass}}",
"match.pool": "プール {{code}}",
"match.pass": "通過",
"match.pool": "プール",
"match.score": "{{scoreOne}}-{{scoreTwo}} (Best of {{bestOf}})",
"match.action.undoLastScore": "最後のスコアをやりなおす",
"match.action.reopenMatch": "対戦を再度開く",

View File

@@ -22,7 +22,7 @@
"pre.checkIn.over": "签到已结束",
"pre.checkIn.cant": "请在签到之前完成前面的步骤",
"pre.checkIn.button": "签到",
"pre.checkIn.checkedIn": "您的队伍已签到。请加入频道: {{pool}}",
"pre.checkIn.checkedIn": "您的队伍已签到",
"pre.info.header": "队伍信息",
"pre.info.unregister": "取消报名",
@@ -115,8 +115,8 @@
"bracket.standings.showMore": "展开",
"match.hosts": "{{teamName}} 为房主",
"match.pass": "密码 {{pass}}",
"match.pool": "频道 {{code}}",
"match.pass": "密码",
"match.pool": "频道",
"match.score": "{{scoreOne}}-{{scoreTwo}} (Bo {{bestOf}})",
"match.action.undoLastScore": "撤销上次比分",
"match.action.reopenMatch": "重新开始对战",