diff --git a/src/components/CompetitionPage/CompetitionPage.tsx b/src/components/CompetitionPage/CompetitionPage.tsx index 729ea51d..b10556cd 100644 --- a/src/components/CompetitionPage/CompetitionPage.tsx +++ b/src/components/CompetitionPage/CompetitionPage.tsx @@ -1,14 +1,12 @@ -import {Typography} from '@mui/material' +import {Stack, Typography} from '@mui/material' import {useRouter} from 'next/router' -import {FC, Fragment} from 'react' +import {FC} from 'react' import {Link} from '@/components/Clickable/Link' import {Competition, Event} from '@/types/api/competition' import {BannerContainer} from '@/utils/BannerContainer' import {formatDateTime} from '@/utils/formatDate' -import styles from './competition.module.scss' - type OurCompetition = Omit & {history_events: Event[]} type CompetitionPageProps = { @@ -28,108 +26,94 @@ export const CompetitionPage: FC = ({ const rulesLink = `${router.asPath}/pravidla` return ( - <> -
- {who_can_participate && ( -
- - Pre koho? {who_can_participate} - - - {description} - -
- )} -
-
+ + {who_can_participate && Súťaž je určená pre {who_can_participate}} + + {description && {description}} + + + + Pravidlá + + + + + Nadchádzajúci ročník {upcoming_or_current_event ? ( -
- - Nadchádzajúci ročník: - + {startDate && ( - - Odkedy? {startDate} + + Od: {startDate} )} {endDate && ( - - Dokedy? {endDate} + + Do: {endDate} )} {upcoming_or_current_event.publication_set.length > 0 && ( - + Pozvánka - + )} + + + Pozvánka + + {upcoming_or_current_event.registration_link && ( -
- - Registrácia prebieha do: - {upcoming_or_current_event.registration_link.end} + <> + + Registrácia prebieha do: {formatDateTime(upcoming_or_current_event.registration_link.end)} - + Registračný formulár - - - {upcoming_or_current_event.registration_link.additional_info} - -
+ + {upcoming_or_current_event.registration_link.additional_info} + )} -
+
) : ( -
- - Nadchádzajúci ročník: Pripravujeme - -
+ + Pripravujeme + )} -
- -
- - - Pravidlá - - -
+ -
- - Archív: - -
- {/* TODO: asi zjednotit styly, neriesit with/without publications */} - {competition_type?.name === 'Tábor' ? ( -
- {history_events.map((event) => ( - -
+ + Archív + {/* TODO: asi zjednotit styly, neriesit with/without publications */} + {competition_type?.name === 'Tábor' ? ( + + {history_events.map((event) => ( + {name + ' '} {event.school_year} -
-
- ))} -
- ) : ( -
- {history_events.map((event) => ( - -
- {name} {event.school_year} -
- {event.publication_set.map((publication) => ( - - {publication.name} - - ))} -
- ))} -
- )} - + + ))} + + ) : ( + + {history_events.map((event) => ( + + + {name} {event.school_year} + + + {event.publication_set.map((publication) => ( + + {publication.name} + + ))} + + + ))} + + )} + + ) } diff --git a/src/components/CompetitionPage/competition.module.scss b/src/components/CompetitionPage/competition.module.scss deleted file mode 100644 index 7911683a..00000000 --- a/src/components/CompetitionPage/competition.module.scss +++ /dev/null @@ -1,70 +0,0 @@ - .mainText{ - >p{ - padding: 20px; - } - } - - .h2{ - padding-top: 40px; - padding: 20px; - } - - .container { - display: grid; - grid-gap: 0px; - margin: -20px; - padding-top: 20px; -} - - .actions{ - margin-top: .5rem; - display: flex; - justify-content: flex-end; - } - - .actionButton, .commentActions>span{ - cursor: pointer; - font-size: 30px; - font-style: italic; - font-weight: bold; - margin-left: 40px; - user-select: none; - text-transform: uppercase; - - - &.disabled{ - color: #CCC; - border-color: #CCC; - } - } - - .archiveWithPublications{ - display: grid; - width: 50%; - grid-template-columns: 1fr max-content max-content; - font-weight: bold; - text-transform: uppercase; - margin-top: 10px; - font-style: italic; - row-gap: 10px; - margin-left: 20px; - - div:not(:nth-child(3n+1)){ - margin-left: 20px; - border-bottom: 4px solid black; - } - - div:nth-child(3n+1){ - font-size: 1.2rem; - } - } - - .archiveWithoutPublications{ - font-weight: bold; - text-transform: uppercase; - margin-top: 10px; - font-style: italic; - row-gap: 10px; - margin-left: 20px; - font-size: 1.2rem; - } \ No newline at end of file diff --git a/src/components/CompetitionPage/competition.module.scss.d.ts b/src/components/CompetitionPage/competition.module.scss.d.ts deleted file mode 100644 index 0409c32b..00000000 --- a/src/components/CompetitionPage/competition.module.scss.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export type Styles = { - actionButton: string - actions: string - archiveWithoutPublications: string - archiveWithPublications: string - commentActions: string - container: string - disabled: string - h2: string - mainText: string -} - -export type ClassNames = keyof Styles - -declare const styles: Styles - -export default styles