Skip to content

Commit

Permalink
Improve planning page (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
evroon committed Sep 8, 2024
1 parent 72fe9ce commit 8a32b5c
Show file tree
Hide file tree
Showing 16 changed files with 163 additions and 189 deletions.
1 change: 0 additions & 1 deletion frontend/public/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy_dashboard_url_button": "Dashboard-URL kopieren",
"could_not_find_any_alert": "Konnte keine finden",
"court_name_input_placeholder": "Bestes Spielfeld aller Zeiten",
"court_spotlight_description": "Spielfelder ansehen, hinzufügen oder löschen",
"courts_title": "Spielfeld",
"create_account_alert_description": "Kontoerstellung ist auf dieser Domain momentan deaktiviert, da sich bracket noch in der Beta-Phase befindet.",
"create_account_alert_title": "Nicht verfügbar",
Expand Down
3 changes: 2 additions & 1 deletion frontend/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy_dashboard_url_button": "Copy Dashboard URL",
"could_not_find_any_alert": "Could not find any",
"court_name_input_placeholder": "Best Court Ever",
"court_spotlight_description": "View, add or delete courts",
"courts_title": "courts",
"create_account_alert_description": "Account creation is disabled on this domain for now since bracket is still in beta phase",
"create_account_alert_title": "Unavailable",
Expand Down Expand Up @@ -152,6 +151,7 @@
"next_stage_button": "Next Stage",
"no_matches_description": "First, add matches by creating stages and stage items. Then, schedule them using the button in the topright corner.",
"no_matches_title": "No matches scheduled yet",
"no_courts_title": "No courts yet",
"no_players_title": "No players yet",
"no_round_description": "There are no rounds in this stage item yet",
"no_round_found_description": "Please wait for the organiser to add them.",
Expand Down Expand Up @@ -194,6 +194,7 @@
"save_players_button": "Save players",
"save_ranking_button": "Save Ranking",
"schedule_description": "Schedule All Unscheduled Matches",
"no_courts_description": "No courts have been created yet. First, create the tournament structure by adding stages and stage items. Then, create courts here and schedule matches on these courts.",
"schedule_title": "Schedule",
"score_of_label": "Score of",
"search_placeholder": "Search ...",
Expand Down
1 change: 0 additions & 1 deletion frontend/public/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy_dashboard_url_button": "Copiar URL del Tablero",
"could_not_find_any_alert": "No se pudo encontrar ninguna",
"court_name_input_placeholder": "Mejor tribunal nunca",
"court_spotlight_description": "Visualizar, añadir o eliminar tribunales",
"courts_title": "cortes",
"create_account_alert_description": "La creación de cuenta está desactivada en este dominio por ahora ya que el corchete todavía está en fase beta",
"create_account_alert_title": "Unavailable",
Expand Down
1 change: 0 additions & 1 deletion frontend/public/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy_dashboard_url_button": "Copier l'URL du tableau de bord",
"could_not_find_any_alert": "Aucun résultat trouvé",
"court_name_input_placeholder": "Le Meilleur Des Terrains",
"court_spotlight_description": "Voir, ajouter ou supprimer des terrains",
"courts_title": "Terrains",
"create_account_alert_description": "Pour le moment, la création de compte est désactivée sur ce domaine car Bracket est toujours en phase bêta",
"create_account_alert_title": "Indisponible",
Expand Down
1 change: 0 additions & 1 deletion frontend/public/locales/nl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy_dashboard_url_button": "Kopieer de Dashboard URL",
"could_not_find_any_alert": "Kon er geen vinden",
"court_name_input_placeholder": "Beste veld ooit",
"court_spotlight_description": "Velden bekijken, toevoegen of verwijderen",
"courts_title": "velden",
"create_account_alert_description": "Het aanmaken van een account is voorlopig uitgeschakeld op dit domein",
"create_account_alert_title": "Niet beschikbaar",
Expand Down
1 change: 0 additions & 1 deletion frontend/public/locales/pt/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy_dashboard_url_button": "Copiar URL do painel",
"could_not_find_any_alert": "Não foi possível encontrar nenhum",
"court_name_input_placeholder": "Melhor Tribunal já",
"court_spotlight_description": "Visualizar, adicionar ou excluir tribunais",
"courts_title": "Tribunais",
"create_account_alert_description": "A criação de conta está desabilitada neste domínio por enquanto já que o parêntese ainda está na fase beta",
"create_account_alert_title": "Unavailable",
Expand Down
1 change: 0 additions & 1 deletion frontend/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"copy_dashboard_url_button": "复制仪表板URL",
"could_not_find_any_alert": "找不到任何",
"court_name_input_placeholder": "最好的场地",
"court_spotlight_description": "查看、添加或删除场地",
"courts_title": "场地",
"create_account_alert_description": "由于括号仍处于测试阶段,因此暂时禁用了此域上的帐户创建",
"create_account_alert_title": "不可用",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/builder/builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function StageItemRow({
<Menu withinPortal position="bottom-end" shadow="sm">
<Menu.Target>
<ActionIcon variant="transparent" color="gray">
<IconDots size="1.5rem" />
<IconDots size="1.25rem" />
</ActionIcon>
</Menu.Target>

Expand Down Expand Up @@ -190,7 +190,7 @@ function StageColumn({
<Menu withinPortal position="bottom-end" shadow="sm">
<Menu.Target>
<ActionIcon variant="transparent" color="gray">
<IconDots size="1rem" />
<IconDots size="1.25rem" />
</ActionIcon>
</Menu.Target>

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/buttons/next_stage_button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function NextStageButton({ tournamentData, swrStagesResponse }: any) {
return (
<Button
size="md"
style={{ marginBottom: 10 }}
mb="10"
color="indigo"
leftSection={<IconSquareArrowRight size={24} />}
onClick={async () => {
Expand All @@ -29,7 +29,7 @@ export function PreviousStageButton({ tournamentData, swrStagesResponse }: any)
return (
<Button
size="md"
style={{ marginBottom: 10 }}
mb="10"
color="indigo"
leftSection={<IconSquareArrowLeft size={24} />}
onClick={async () => {
Expand Down
65 changes: 65 additions & 0 deletions frontend/src/components/modals/create_court_modal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { Button, Modal, TextInput } from '@mantine/core';
import { useForm } from '@mantine/form';
import { GoPlus } from '@react-icons/all-files/go/GoPlus';
import { useTranslation } from 'next-i18next';
import React, { useState } from 'react';
import { SWRResponse } from 'swr';

import { createCourt } from '../../services/court';

export default function CourtModal({
tournamentId,
swrCourtsResponse,
buttonSize,
}: {
buttonSize: 'xs' | 'lg';
tournamentId: number;
swrCourtsResponse: SWRResponse;
}) {
const { t } = useTranslation();
const [opened, setOpened] = useState(false);
const form = useForm({
initialValues: {
name: '',
},

validate: {
name: (value) => (value.length > 0 ? null : t('too_short_name_validation')),
},
});

return (
<>
<Modal opened={opened} onClose={() => setOpened(false)} title={t('add_court_title')}>
<form
onSubmit={form.onSubmit(async (values) => {
await createCourt(tournamentId, values.name);
await swrCourtsResponse.mutate();
setOpened(false);
})}
>
<TextInput
withAsterisk
label={t('name_input_label')}
placeholder={t('court_name_input_placeholder')}
{...form.getInputProps('name')}
/>

<Button fullWidth style={{ marginTop: 10 }} color="green" type="submit">
{t('save_button')}
</Button>
</form>
</Modal>
<Button
variant="outline"
color="green"
size={buttonSize}
style={{ marginRight: 10 }}
onClick={() => setOpened(true)}
leftSection={<GoPlus size={24} />}
>
{t('add_court_title')}
</Button>
</>
);
}
1 change: 0 additions & 1 deletion frontend/src/components/modals/create_stage_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export function CreateStageItemModal({
variant="outline"
color="green"
size="xs"
style={{ marginRight: 10 }}
onClick={() => setOpened(true)}
leftSection={<GoPlus size={24} />}
>
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/components/modals/spotlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
IconScoreboard,
IconSearch,
IconSettings,
IconSoccerField,
IconTrophy,
IconUser,
IconUsers,
Expand Down Expand Up @@ -84,13 +83,6 @@ export function BracketSpotlight() {
onClick: () => router.push(`/tournaments/${tournamentId}/stages`),
leftSection: <IconTrophy size="1.2rem" />,
},
{
id: 'courts',
title: t('courts_title'),
description: t('court_spotlight_description'),
onClick: () => router.push(`/tournaments/${tournamentId}/courts`),
leftSection: <IconSoccerField size="1.2rem" />,
},
{
id: 'tournament settings',
title: t('tournament_setting_title'),
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/components/navbar/_main_links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
IconHome,
IconScoreboard,
IconSettings,
IconSoccerField,
IconTrophy,
IconUser,
IconUsers,
Expand Down Expand Up @@ -130,11 +129,6 @@ export function TournamentLinks({ tournament_id }: any) {
label: capitalize(t('teams_title')),
link: `${tm_prefix}/teams`,
},
{
icon: IconSoccerField,
label: capitalize(t('courts_title')),
link: `${tm_prefix}/courts`,
},
{
icon: IconCalendar,
label: capitalize(t('planning_title')),
Expand Down
64 changes: 0 additions & 64 deletions frontend/src/components/tables/courts.tsx

This file was deleted.

79 changes: 0 additions & 79 deletions frontend/src/pages/tournaments/[id]/courts.tsx

This file was deleted.

Loading

0 comments on commit 8a32b5c

Please sign in to comment.