diff --git a/src/components/CompetitionPage/CompetitionPage.tsx b/src/components/CompetitionPage/CompetitionPage.tsx index 6cd2dbc1..b36a31d7 100644 --- a/src/components/CompetitionPage/CompetitionPage.tsx +++ b/src/components/CompetitionPage/CompetitionPage.tsx @@ -83,6 +83,7 @@ export const CompetitionPage: FC = ({ {history_events.map((event) => { const results = event.publication_set.find((p) => p.publication_type === PublicationTypes.RESULTS.id) + const solutions = event.publication_set.find((p) => p.publication_type === PublicationTypes.SOLUTIONS.id) const problems = event.publication_set.find((p) => p.publication_type === PublicationTypes.PROBLEMS.id) return ( @@ -94,15 +95,21 @@ export const CompetitionPage: FC = ({ {results && ( - {results.name} + {PublicationTypes.RESULTS.display_name} )} - {problems && ( - - {problems.name} + {solutions ? ( + + {PublicationTypes.SOLUTIONS.display_name} + ) : ( + problems && ( + + {PublicationTypes.PROBLEMS.display_name} + + ) )} diff --git a/src/types/api/competition.ts b/src/types/api/competition.ts index 4cf41f75..f1851478 100644 --- a/src/types/api/competition.ts +++ b/src/types/api/competition.ts @@ -21,22 +21,27 @@ export const PublicationTypes = { PROBLEMS: { id: 0, name: 'Zadania', + display_name: 'Zadania', }, RESULTS: { id: 1, name: 'Poradia', + display_name: 'Poradie', }, SOLUTIONS: { id: 2, name: 'Brožúra', + display_name: 'Brožúra', }, INVITATION: { id: 3, name: 'Pozvánka', + display_name: 'Pozvánka', }, LEAFLET: { id: 4, name: 'Časopisy', + display_name: 'Časopis', }, }