From e541941b15f637dee80693661c2236c305a475de Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sun, 19 May 2024 10:43:57 +0200 Subject: [PATCH] Upravene zarovania (#376) * Upravene zarovania * Simplify layout props --- .../CompetitionPage/CompetitionPage.tsx | 76 +++++++++---------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/src/components/CompetitionPage/CompetitionPage.tsx b/src/components/CompetitionPage/CompetitionPage.tsx index 62db4166..ee6171a8 100644 --- a/src/components/CompetitionPage/CompetitionPage.tsx +++ b/src/components/CompetitionPage/CompetitionPage.tsx @@ -16,15 +16,7 @@ type CompetitionPageProps = { } export const CompetitionPage: FC = ({ - competition: { - id, - name, - who_can_participate, - description, - upcoming_or_current_event, - competition_type, - history_events, - }, + competition: {id, name, who_can_participate, description, upcoming_or_current_event, history_events}, }) => { const {setBannerMessages} = BannerContainer.useContainer() @@ -48,11 +40,17 @@ export const CompetitionPage: FC = ({ return ( - {who_can_participate && Súťaž je určená pre {who_can_participate}} + + {who_can_participate && `Súťaž je určená pre ${who_can_participate}.`} + {description && ` ${description}`} + - {description && {description}} - - + Pravidlá @@ -73,7 +71,7 @@ export const CompetitionPage: FC = ({ )} {upcoming_or_current_event.publication_set.length > 0 && ( - + Pozvánka @@ -81,15 +79,15 @@ export const CompetitionPage: FC = ({ )} {upcoming_or_current_event.registration_link && ( <> + {upcoming_or_current_event.registration_link.additional_info} Registrácia prebieha do: {formatDateTime(upcoming_or_current_event.registration_link.end)} - + Registračný formulár - {upcoming_or_current_event.registration_link.additional_info} )} @@ -99,36 +97,32 @@ export const CompetitionPage: FC = ({ )} - 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} - ))} - - ) : ( - - {history_events.map((event) => ( - - - {name} {event.school_year} - - - {event.publication_set.map((publication) => ( - - {publication.name} - - ))} - + + {event.publication_set.map((publication) => ( + + {publication.name} + + ))} - ))} - - )} + + ))} + )