Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events page - info about current semester #170

Merged
merged 8 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 49 additions & 10 deletions src/pages/strom/akcie/[[...params]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,72 @@ const StaticPage: NextPage<CompetitionPageProps> = ({competition, is_rules}) =>
{competition.who_can_participate && <p>Pre koho? {competition.who_can_participate}</p>}
<p>{competition.description}</p>
</div>
{competition.rules && (
<div className={styles.container}>
<div className={styles.actions}>
<div className={styles.mainText}>
{competition.upcoming_or_current_event ? (
<div className={styles.mainText}>
<p>
<b>Nadchádzajúci ročník:</b>
</p>
{competition.upcoming_or_current_event.start && (
<p>Odkedy? {competition.upcoming_or_current_event.start} </p>
)}
{competition.upcoming_or_current_event.end && <p>Dokedy? {competition.upcoming_or_current_event.end}</p>}
{competition.upcoming_or_current_event.publication_set.length > 0 && (
<p>
<Link href={`/api/${competition.upcoming_or_current_event.publication_set[0].file}`}>Pozvánka</Link>
</p>
)}
{competition.upcoming_or_current_event.registration_link && (
<div>
<p>
Registrácia prebieha do:
{competition.upcoming_or_current_event.registration_link.end}
<Link href={competition.upcoming_or_current_event.registration_link.url}>Registračný formulár</Link>
</p>

<p>{competition.upcoming_or_current_event.registration_link.additional_info}</p>
</div>
)}
</div>
) : (
<p>
<b>Nadchádzajúci ročník:</b> Pripravujeme
</p>
)}
</div>

<div className={styles.container}>
<div className={styles.actions}>
<div className={styles.actionButton}>
<RulesLink />
</div>
</div>
)}
</div>

<div className={styles.h2}>
<h2>Archív: </h2>
</div>
{competition.competition_type.name === 'Tábor' ? (
<div className={styles.archiveCamp}>
<div className={styles.archiveWithoutPublications}>
{competition.history_events.map((event) => (
<div key={event.id}>
{competition.name} {event.school_year}
</div>
<Fragment key={event.id}>
<div>
{competition.name + ' '} {event.school_year}
</div>
</Fragment>
))}
</div>
) : (
<div className={styles.archive}>
<div className={styles.archiveWithPublications}>
{competition.history_events.map((event) => (
<Fragment key={event.id}>
<div>
{competition.name} {event.school_year}
</div>
{event.publication_set.map((publication) => (
<div key={publication.id}> {publication.name}</div>
<Link key={publication.id} href={`/api/${publication.file}`}>
{publication.name}
</Link>
))}
</Fragment>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/strom/akcie/competition.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
}

.archive{
.archiveWithPublications{
display: grid;
width: 50%;
grid-template-columns: 1fr max-content max-content;
Expand All @@ -60,7 +60,7 @@
}
}

.archiveCamp{
.archiveWithoutPublications{
font-weight: bold;
text-transform: uppercase;
margin-top: 10px;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/strom/akcie/competition.module.scss.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type Styles = {
actionButton: string
actions: string
archive: string
archiveCamp: string
archiveWithoutPublications: string
archiveWithPublications: string
commentActions: string
container: string
disabled: string
Expand Down
Loading