mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-02 22:26:57 -05:00
Improve finalize tournament button style
Old overflowed on mobile but also otherwise looked a bit dated
This commit is contained in:
parent
929974535d
commit
dd1a525e10
|
|
@ -46,37 +46,42 @@ export default function TournamentFinalizePage() {
|
|||
onCloseTo={bracketUrl}
|
||||
heading={t("tournament:actions.finalize")}
|
||||
>
|
||||
<FinalizeForm
|
||||
error={badgesError}
|
||||
isAssigningBadges={!isAssignLaterSelected && tournamentHasBadges}
|
||||
>
|
||||
{tournamentHasBadges ? (
|
||||
<>
|
||||
<SendouSwitch
|
||||
isSelected={isAssignLaterSelected}
|
||||
onChange={setIsAssignLaterSelected}
|
||||
data-testid="assign-badges-later-switch"
|
||||
>
|
||||
{t("tournament:actions.finalize.assignBadgesLater")}
|
||||
</SendouSwitch>
|
||||
{!isAssignLaterSelected ? (
|
||||
<>
|
||||
<input
|
||||
type="hidden"
|
||||
name="badgeReceivers"
|
||||
value={JSON.stringify(badgeReceivers)}
|
||||
/>
|
||||
<NewBadgeReceiversSelector
|
||||
badges={data.badges}
|
||||
standings={data.standings}
|
||||
badgeReceivers={badgeReceivers}
|
||||
setBadgeReceivers={setBadgeReceivers}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
) : null}
|
||||
</FinalizeForm>
|
||||
<div className="stack md">
|
||||
<FormMessage type="info">
|
||||
{t("tournament:actions.finalize.notice")}
|
||||
</FormMessage>
|
||||
<FinalizeForm
|
||||
error={badgesError}
|
||||
isAssigningBadges={!isAssignLaterSelected && tournamentHasBadges}
|
||||
>
|
||||
{tournamentHasBadges ? (
|
||||
<>
|
||||
<SendouSwitch
|
||||
isSelected={isAssignLaterSelected}
|
||||
onChange={setIsAssignLaterSelected}
|
||||
data-testid="assign-badges-later-switch"
|
||||
>
|
||||
{t("tournament:actions.finalize.assignBadgesLater")}
|
||||
</SendouSwitch>
|
||||
{!isAssignLaterSelected ? (
|
||||
<>
|
||||
<input
|
||||
type="hidden"
|
||||
name="badgeReceivers"
|
||||
value={JSON.stringify(badgeReceivers)}
|
||||
/>
|
||||
<NewBadgeReceiversSelector
|
||||
badges={data.badges}
|
||||
standings={data.standings}
|
||||
badgeReceivers={badgeReceivers}
|
||||
setBadgeReceivers={setBadgeReceivers}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
) : null}
|
||||
</FinalizeForm>
|
||||
</div>
|
||||
</SendouDialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { sub } from "date-fns";
|
||||
import { Check, Eye, EyeOff, Map as MapIcon } from "lucide-react";
|
||||
import { Check, Eye, EyeOff, Map as MapIcon, Stamp } from "lucide-react";
|
||||
import * as React from "react";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
|
@ -168,17 +168,6 @@ export default function TournamentBracketsPage() {
|
|||
return (
|
||||
<div>
|
||||
<Outlet context={ctx} />
|
||||
{tournament.canFinalize(user) ? (
|
||||
<div className={styles.finalize}>
|
||||
<LinkButton
|
||||
variant="minimal"
|
||||
testId="finalize-tournament-button"
|
||||
to="finalize"
|
||||
>
|
||||
{t("tournament:actions.finalize.question")}
|
||||
</LinkButton>
|
||||
</div>
|
||||
) : null}
|
||||
{bracket.preview &&
|
||||
bracket.enoughTeams &&
|
||||
tournament.isOrganizer(user) &&
|
||||
|
|
@ -223,6 +212,15 @@ export default function TournamentBracketsPage() {
|
|||
{bracket.type !== "round_robin" && !bracket.preview ? (
|
||||
<CompactifyButton />
|
||||
) : null}
|
||||
{tournament.canFinalize(user) ? (
|
||||
<LinkButton
|
||||
to="finalize"
|
||||
testId="finalize-tournament-button"
|
||||
icon={<Stamp />}
|
||||
>
|
||||
{t("tournament:actions.finalize.button")}
|
||||
</LinkButton>
|
||||
) : null}
|
||||
{showPrepareMapsButton ? (
|
||||
// Error Boundary because preparing maps is optional, so no need to make the whole page inaccessible if it fails
|
||||
<ErrorBoundary fallback={null}>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
.finalize {
|
||||
font-size: var(--font-sm);
|
||||
margin-block-end: var(--s-4);
|
||||
display: flex;
|
||||
gap: var(--s-1);
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.miniAlert {
|
||||
background-color: var(--color-info-low);
|
||||
font-size: var(--font-2xs);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@
|
|||
"actions.sub.prompt_other": "Du kan stadigvæk tilføje {{count}} Suppleanter til din holdliste",
|
||||
"actions.sub.prompt_zero": "Din holdliste er fuld, så du kan ikke tilføje flere Suppleanter",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Når du har undersøgt, om de indrapporterede resultater er korrekte, så tryk her for at afslutte turneringen og bearbejd resultaterne.",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Afslut",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@
|
|||
"actions.sub.prompt_other": "Du kannst noch {{count}} Ersatzspieler zu deinem Roster hinzufügen",
|
||||
"actions.sub.prompt_zero": "Dein Roster ist voll und keine weiteren Ersatzspieler können hinzugefügt werden",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Sobald du überprüft hast, dass die gemeldeten Ergebnisse korrekt sind, klicke hier, um das Turnier zu finalisieren und die Endergebnisse zu verarbeiten",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Finalisieren",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@
|
|||
"actions.sub.prompt_one": "You can still add {{count}} sub to your roster",
|
||||
"actions.sub.prompt_zero": "Your roster is full and more subs can't be added",
|
||||
"actions.finalize": "Finalizing tournament",
|
||||
"actions.finalize.question": "When you have checked that reported scores are correct click here to finalize the tournament and process results",
|
||||
"actions.finalize.button": "Finalize tournament",
|
||||
"actions.finalize.notice": "Check that all scores are correct. After tournament is finalized they can no longer be changed.",
|
||||
"actions.finalize.action": "Finalize",
|
||||
"actions.finalize.action.withBadges": "Finalize & assign badges",
|
||||
"actions.finalize.info": "This action can't be undone. Please ensure that all reported matches are correct before proceeding.",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"actions.sub.prompt_other": "Aún puedes añadir {{count}} subs a tu equipo",
|
||||
"actions.sub.prompt_zero": "Tu equipo está lleno y no puedes añadir más subs",
|
||||
"actions.finalize": "Finalizando torneo",
|
||||
"actions.finalize.question": "Al verificar que los resultados presentados son correctos, haz click aquí para finalizar el torneo y procesar los resultados",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Finalizar",
|
||||
"actions.finalize.action.withBadges": "Finalizar y asignar insignias",
|
||||
"actions.finalize.info": "Esta acción no se puede deshacer. Asegúrate de que todos los resultados reportados son correctos antes de continuar.",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"actions.sub.prompt_other": "Aún puedes añadir {{count}} subs a tu equipo",
|
||||
"actions.sub.prompt_zero": "Tu equipo está lleno y no puedes añadir más subs",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Al verificar que los resultados presentados son correctos, haz click aquí para finalizar el torneo y procesar los resultados",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Finalizar",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"actions.sub.prompt_other": "Vous pouvez encore ajouter {{count}} remplaçants à votre liste",
|
||||
"actions.sub.prompt_zero": "Votre liste est pleine, des remplaçant supplémentaires ne peuvent être ajoutés",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Lorsque vous avez vérifié que les scores indiqués sont corrects, cliquez ici pour finaliser le tournoi et traiter les résultats",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Finaliser",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"actions.sub.prompt_other": "Vous pouvez encore ajouter {{count}} remplaçants à votre liste",
|
||||
"actions.sub.prompt_zero": "Votre liste est pleine, des remplaçant supplémentaires ne peuvent être ajoutés",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Lorsque vous avez vérifié que les scores indiqués sont corrects, cliquez ici pour finaliser le tournoi et traiter les résultats",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Finaliser",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"actions.sub.prompt_other": "אתם עדיין יכולים להוסיף {{count}} ממלאי מקום לצוות שלכם",
|
||||
"actions.sub.prompt_zero": "הצוות שלכם מלא ולא ניתן להוסיף עוד ממלאי מקום",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "לאחר שבדקתם שהתוצאות נכונות, לחצו כאן כדי לסיים את הטורניר ולנתח את התוצאות",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "סיימו",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"actions.sub.prompt_other": "Puoi ancora aggiungere {{count}} sub al tuo roster",
|
||||
"actions.sub.prompt_zero": "Il tuo roster è completo e non è possibile aggiungere altri sub",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Quando hai verificato che i punteggi riportati sono corretti, clicca qui per finalizzare il torneo e processare i risultati",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Finalizza",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@
|
|||
"actions.shareLink": "メンバー招待リンクをシェアする: {{inviteLink}}",
|
||||
"actions.sub.prompt_zero": "メンバーが上限に達しているので、これ以上サブを追加することができません",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "報告されたスコアが正しいかどうかをチェックしたら、ここをクリックしてトーナメント内容を確定・結果処理をおこないます",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "トーナメント結果確定",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@
|
|||
"actions.shareLink": "",
|
||||
"actions.sub.prompt_zero": "",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@
|
|||
"actions.sub.prompt_other": "",
|
||||
"actions.sub.prompt_zero": "",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@
|
|||
"actions.sub.prompt_other": "",
|
||||
"actions.sub.prompt_zero": "",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@
|
|||
"actions.sub.prompt_other": "Você ainda pode adicionar {{count}} substitutos(as) à sua lista",
|
||||
"actions.sub.prompt_zero": "Sua lista está cheia e mais nenhum(a) substituto(a) pode ser adicionado(a)",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Quando você verificar que as pontuações e resultados declarados estão corretos, clique aqui para finalizar o torneio e processar os resultados",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Finalizar Torneio",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@
|
|||
"actions.sub.prompt_other": "Вы ещё можете добавить {{count}} запасных",
|
||||
"actions.sub.prompt_zero": "Состав заполнен, больше нельзя добавить запасных",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "Как только вы убедитесь, что заявлённые счёты достоверны, нажмите здесь для завершения турнира и обработки результатов",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "Завершить",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@
|
|||
"actions.shareLink": "分享您的邀请链接以添加成员: {{inviteLink}}",
|
||||
"actions.sub.prompt_zero": "您的阵容已满,无法再添加替补",
|
||||
"actions.finalize": "",
|
||||
"actions.finalize.question": "在您确认报告的比分无误后,点击这里结束比赛并生成结果",
|
||||
"actions.finalize.button": "",
|
||||
"actions.finalize.notice": "",
|
||||
"actions.finalize.action": "结束",
|
||||
"actions.finalize.action.withBadges": "",
|
||||
"actions.finalize.info": "",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user