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

Upravene zarovania #376

Merged
merged 2 commits into from
May 19, 2024
Merged
Changes from 1 commit
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
70 changes: 38 additions & 32 deletions src/components/CompetitionPage/CompetitionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
who_can_participate,
description,
upcoming_or_current_event,
competition_type,

Check warning on line 25 in src/components/CompetitionPage/CompetitionPage.tsx

View workflow job for this annotation

GitHub Actions / branch-test

'competition_type' is defined but never used. Allowed unused args must match /^_/u
history_events,
},
}) => {
Expand All @@ -48,11 +48,20 @@

return (
<Stack gap={3}>
{who_can_participate && <Typography variant="body1">Súťaž je určená pre {who_can_participate}</Typography>}
{who_can_participate && (
<Typography variant="body1">
Súťaž je určená pre {who_can_participate}.{description && ` ${description}`}
Copy link
Collaborator

@rtrembecky rtrembecky May 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description nedava zmysel bez who_can_participate? len sa pytam, ty vies, preco si menil

</Typography>
)}

{description && <Typography variant="body1">{description}</Typography>}

<Stack alignSelf="center">
<Stack
direction="row"
sx={{
mt: 0.5,
justifyContent: 'end',
alignItems: 'end',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically staci:

        sx={{
          mt: 0.5,
          alignItems: 'end',

alignItems zarovnava v "cross" osi - ked mame Stack, je defaultne vertikalny, a alignItems to da na koniec horizontalne.
alternativa by bola:

        direction="row"
        sx={{
          mt: 0.5,
          justifyContent: 'end',

justifyContent zarovnava v osi sadzania

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Použil som to prvé

}}
>
<Link variant="button2" href={rulesLink}>
Pravidlá
</Link>
Expand All @@ -73,23 +82,23 @@
</Typography>
)}
{upcoming_or_current_event.publication_set.length > 0 && (
<Stack alignSelf="center">
<Stack direction="row" sx={{justifyContent: 'end', alignItems: 'end'}}>
kovacspe marked this conversation as resolved.
Show resolved Hide resolved
<Link variant="button2" href={`/api/${upcoming_or_current_event.publication_set[0].file}`}>
Pozvánka
</Link>
</Stack>
)}
{upcoming_or_current_event.registration_link && (
<>
<Typography variant="body1">{upcoming_or_current_event.registration_link.additional_info}</Typography>
<Typography variant="body1">
<b>Registrácia prebieha do:</b> {formatDateTime(upcoming_or_current_event.registration_link.end)}
</Typography>
<Stack alignSelf="center">
<Stack direction="row" sx={{justifyContent: 'end', alignItems: 'end'}}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

takisto aj tu:

<Stack sx={{alignItems: 'end'}}>

<Link variant="button2" href={upcoming_or_current_event.registration_link.url}>
Registračný formulár
</Link>
</Stack>
<Typography variant="body1">{upcoming_or_current_event.registration_link.additional_info}</Typography>
</>
)}
</Stack>
Expand All @@ -99,36 +108,33 @@
</Typography>
)}
</Stack>

<Stack>
<Typography variant="h2">Archív</Typography>
{/* TODO: asi zjednotit styly, neriesit with/without publications */}
{competition_type?.name === 'Tábor' ? (
kovacspe marked this conversation as resolved.
Show resolved Hide resolved
<Stack gap={1}>
{history_events.map((event) => (
<Typography key={event.id} variant="h3" component="span">
{name + ' '} {event.school_year}

<Stack gap={1}>
{history_events.map((event) => (
<Stack
key={event.id}
direction="row"
sx={{
justifyContent: 'space-between',
alignItems: 'end',
kovacspe marked this conversation as resolved.
Show resolved Hide resolved
}}
>
<Typography variant="h3" component="span">
{name} {event.school_year}
</Typography>
))}
</Stack>
) : (
<Stack gap={1}>
{history_events.map((event) => (
<Stack key={event.id} direction="row" gap={20}>
<Typography variant="h3" component="span">
{name} {event.school_year}
</Typography>
<Stack direction="row" gap={2}>
{event.publication_set.map((publication) => (
<Link variant="button2" key={publication.id} href={`/api/${publication.file}`}>
{publication.name}
</Link>
))}
</Stack>
<Stack direction="row" gap={2}>
{event.publication_set.map((publication) => (
<Link variant="button2" key={publication.id} href={`/api/${publication.file}`}>
{publication.name}
</Link>
))}
</Stack>
))}
</Stack>
)}
</Stack>
))}
</Stack>
</Stack>
</Stack>
)
Expand Down
Loading