From 2dd15df4d9020eac2e3d4c23ee2db9f39a520396 Mon Sep 17 00:00:00 2001 From: Erik Vroon Date: Sun, 11 May 2025 18:11:01 +0200 Subject: [PATCH] Create stages from template --- .../buttons/create_stage.module.css | 35 +++++ .../src/components/buttons/create_stage.tsx | 139 ++++++++++++++++-- .../pages/tournaments/[id]/stages/index.tsx | 5 +- 3 files changed, 163 insertions(+), 16 deletions(-) create mode 100644 frontend/src/components/buttons/create_stage.module.css diff --git a/frontend/src/components/buttons/create_stage.module.css b/frontend/src/components/buttons/create_stage.module.css new file mode 100644 index 00000000..9d890b94 --- /dev/null +++ b/frontend/src/components/buttons/create_stage.module.css @@ -0,0 +1,35 @@ +.socialLink { + padding: 1rem; + border-radius: 1rem; + text-align: center; + font-size: 30px; + font-weight: bold; + text-decoration: none; + display: block; + border: 3px solid #333; +} + +.socialLink:hover { + border: 3px solid #8545c7; +} +.title { + font-family: + Greycliff CF, + var(--mantine-font-family); + text-align: center; + font-weight: 900; + font-size: rem(38px); + color: light-dark(var(--mantine-color-black), var(--mantine-color-white)); + + @media (max-width: $mantine-breakpoint-sm) { + font-size: rem(32px); + } +} + +.description { + max-width: rem(1000px); + margin: auto; + margin-top: var(--mantine-spacing-xl); + margin-bottom: calc(var(--mantine-spacing-xl) * 1.5); + color: light-dark(var(--mantine-color-black), var(--mantine-color-white)); +} diff --git a/frontend/src/components/buttons/create_stage.tsx b/frontend/src/components/buttons/create_stage.tsx index 4e137ddd..b79b4754 100644 --- a/frontend/src/components/buttons/create_stage.tsx +++ b/frontend/src/components/buttons/create_stage.tsx @@ -1,4 +1,17 @@ -import { Button } from '@mantine/core'; +import { + Button, + Card, + Center, + Container, Divider, + Flex, + Grid, + Group, + Image, + Stack, + Text, + Title, + UnstyledButton +} from '@mantine/core'; import { GoPlus } from '@react-icons/all-files/go/GoPlus'; import { useTranslation } from 'next-i18next'; import React from 'react'; @@ -6,6 +19,8 @@ import { SWRResponse } from 'swr'; import { Tournament } from '../../interfaces/tournament'; import { createStage } from '../../services/stage'; +import {Translator} from "../utils/types"; +import classes from './create_stage.module.css'; export default function CreateStageButton({ tournament, @@ -49,18 +64,114 @@ export function CreateStageButtonLarge({ const { t } = useTranslation(); return ( - + <> + {t('no_matches_title')} + + {t('no_matches_description')} + + + ); } + +function StageSelectCard({ + title, + descriptions, + images, + onClick, +}: { + title: string; + descriptions: string[]; + images: string[]; + onClick: () => void; +}) { + const image_components = images.map((image) => ()); + const description_components = descriptions.map((description) => (<>{description}
)); + return ( + + + + + {image_components} + + + + + {title} + + + + {description_components} + + + + ); +} + +export function CreateStagesFromTemplateButtons({ + t, +}: { + t: Translator; +}) { + return ( + <> + 1 Stage + + + { + }} + /> + + + { + }} + /> + + + { + }} + /> + + + 2 Stages + + + { + }} + /> + + + { + }} + /> + + + ); +} \ No newline at end of file diff --git a/frontend/src/pages/tournaments/[id]/stages/index.tsx b/frontend/src/pages/tournaments/[id]/stages/index.tsx index e664ac68..1cc76eb0 100644 --- a/frontend/src/pages/tournaments/[id]/stages/index.tsx +++ b/frontend/src/pages/tournaments/[id]/stages/index.tsx @@ -1,4 +1,4 @@ -import { Group, Stack } from '@mantine/core'; +import {Container, Group, Stack, Text, Title} from '@mantine/core'; import { useTranslation } from 'next-i18next'; import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import React from 'react'; @@ -20,6 +20,8 @@ import { getTournamentById, } from '../../../../services/adapter'; import TournamentLayout from '../../_tournament_layout'; +import classes from "../../../../components/no_content/empty_table_info.module.css"; +import {HiMiniWrenchScrewdriver} from "react-icons/hi2"; export default function StagesPage() { const { t } = useTranslation(); @@ -47,7 +49,6 @@ export default function StagesPage() { } else if (stages.length < 1) { content = ( -