-
{problem.order}. ÚLOHA
+
+
+ {problem.order}. ÚLOHA
+
{problem.text}
{problem.image && (
-
+
-
+
)}
{displayProblemUploadForm && (
)}
{displayActions && (
-
+
{problem.solution_pdf && (
-
+
vzorové riešenie
)}
@@ -93,6 +97,7 @@ export const Problem: FC<{
href={`/api/competition/problem/${problem.id}/my-solution`}
target="_blank"
disabled={!problem.submitted}
+ variant="button2"
>
moje riešenie
@@ -100,18 +105,21 @@ export const Problem: FC<{
href={`/api/competition/problem/${problem.id}/corrected-solution`}
target="_blank"
disabled={!problem.submitted?.corrected_solution}
+ variant="button2"
>
opravené riešenie{!!problem.submitted?.corrected_solution && ` (${problem.submitted.score || '?'})`}
>
)}
- diskusia ({problem.num_comments})
+
+ diskusia ({problem.num_comments}){' '}
+
{(registered || canRegister) && (
-
+
odovzdať
)}
-
+
)}
)
diff --git a/src/components/Problems/Problems.module.scss b/src/components/Problems/Problems.module.scss
index 8a42084c..d7e9214c 100644
--- a/src/components/Problems/Problems.module.scss
+++ b/src/components/Problems/Problems.module.scss
@@ -1,14 +1,3 @@
-.container {
- display: grid;
- grid-gap: 0px;
- margin: -20px;
- padding-top: 80px;
-}
-
-.adminSection {
- margin-left: auto;
-}
-
.debug {
margin-left: .5rem;
margin-bottom: .5rem;
diff --git a/src/components/Problems/Problems.module.scss.d.ts b/src/components/Problems/Problems.module.scss.d.ts
index 8d3ae811..f077a190 100644
--- a/src/components/Problems/Problems.module.scss.d.ts
+++ b/src/components/Problems/Problems.module.scss.d.ts
@@ -1,6 +1,4 @@
export type Styles = {
- adminSection: string
- container: string
debug: string
sideContainer: string
}
diff --git a/src/components/Problems/Problems.tsx b/src/components/Problems/Problems.tsx
index f559085a..1e17c4d3 100644
--- a/src/components/Problems/Problems.tsx
+++ b/src/components/Problems/Problems.tsx
@@ -1,15 +1,17 @@
+import {Stack, Typography} from '@mui/material'
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
import axios from 'axios'
import {useRouter} from 'next/router'
import {FC, useEffect, useState} from 'react'
import {useInterval} from 'usehooks-ts'
-import {Button, Link} from '@/components/Clickable/Clickable'
+import {Button} from '@/components/Clickable/Button'
+import {Link} from '@/components/Clickable/Link'
import {SeriesWithProblems} from '@/types/api/competition'
import {Profile} from '@/types/api/personal'
import {AuthContainer} from '@/utils/AuthContainer'
import {BannerContainer} from '@/utils/BannerContainer'
-import {formatDate} from '@/utils/formatDate'
+import {formatDateTime} from '@/utils/formatDate'
import {useDataFromURL} from '@/utils/useDataFromURL'
import {useHasPermissions} from '@/utils/useHasPermissions'
@@ -85,7 +87,7 @@ export const Problems: FC = () => {
if (seriesData === undefined) {
setBannerText('')
} else {
- const deadline = formatDate(seriesData.data.deadline)
+ const deadline = formatDateTime(seriesData.data.deadline)
if (seriesData?.data.can_submit) {
setBannerText(`Termín série: ${deadline}`)
} else {
@@ -121,23 +123,48 @@ export const Problems: FC = () => {
open={displayRegisterDialog}
close={closeRegisterDialog}
title="Skontroluj prosím, čí údaje o ročníku a škole sú správne."
- contentText={`Škola: ${profile?.grade_name}, Ročník: ${profile?.school.verbose_name}`} // TODO: this is not styled, I suggest expanding the dialog component to support content as component
+ contentText={
+
+
+
+ Škola
+
+
+ {profile?.school.verbose_name}
+
+
+
+
+ Ročník
+
+
+ {profile?.grade_name}
+
+
+
+ }
actions={
- <>
-
Zmeniť údaje
-
Údaje sú správne
- >
+
+
+ Zmeniť údaje
+
+
+ Údaje sú správne
+
+
}
/>
-
+
{(loading.semesterListIsLoading ||
loading.currentSeriesIsLoading ||
seriesIsLoading ||
permissionsIsLoading) && }
{hasPermissions && (
-
- Admin: Opravovanie
-
+
+
+ Admin: Opravovanie
+
+
)}
{problems.map((problem) => (
{
-
+
{displaySideContent.type === 'discussion' && (
- {title}
+ {title}
{children}
diff --git a/src/components/Problems/UploadProblemForm.tsx b/src/components/Problems/UploadProblemForm.tsx
index f9f982c0..8411abb1 100644
--- a/src/components/Problems/UploadProblemForm.tsx
+++ b/src/components/Problems/UploadProblemForm.tsx
@@ -1,3 +1,4 @@
+import {Stack} from '@mui/material'
import {useMutation} from '@tanstack/react-query'
import axios from 'axios'
import {Dispatch, FC, SetStateAction, useState} from 'react'
@@ -6,7 +7,7 @@ import {useDropzone} from 'react-dropzone'
import {CloseButton} from '@/components/CloseButton/CloseButton'
import {niceBytes} from '@/utils/niceBytes'
-import {Button} from '../Clickable/Clickable'
+import {Button} from '../Clickable/Button'
import {Dialog} from '../Dialog/Dialog'
import {FileDropZone} from '../FileDropZone/FileDropZone'
import styles from './UploadProblemForm.module.scss'
@@ -95,10 +96,14 @@ export const UploadProblemForm: FC<{
title="Pozor"
contentText={alertMessage}
actions={
- <>
- Zrušiť
- Pokračovať
- >
+
+
+ Zrušiť
+
+
+ Pokračovať
+
+
}
/>
@@ -122,8 +127,12 @@ export const UploadProblemForm: FC<{
- Uložiť
- Zrušiť
+
+ Uložiť
+
+
+ Zrušiť
+
{fileRejections.length > 0 && Nahraný súbor musí byť vo formáte pdf. }
diff --git a/src/components/Profile/PasswordChangeForm.tsx b/src/components/Profile/PasswordChangeForm.tsx
index cd3e9d2e..f32302db 100644
--- a/src/components/Profile/PasswordChangeForm.tsx
+++ b/src/components/Profile/PasswordChangeForm.tsx
@@ -1,12 +1,12 @@
+import {Stack} from '@mui/material'
import {useMutation} from '@tanstack/react-query'
import axios, {AxiosError} from 'axios'
import {FC} from 'react'
import {SubmitHandler, useForm} from 'react-hook-form'
-import styles from '@/components/FormItems/Form.module.scss'
import {IGeneralPostResponse} from '@/types/api/general'
-import {Button} from '../Clickable/Clickable'
+import {Button} from '../Clickable/Button'
import {Dialog} from '../Dialog/Dialog'
import {FormInput} from '../FormItems/FormInput/FormInput'
@@ -73,48 +73,50 @@ export const PasswordChangeDialog: FC = ({open, close
close={close}
title="Zmena hesla"
contentText={
-
)
}
diff --git a/src/components/PublicationUploader/PublicationUploader.tsx b/src/components/PublicationUploader/PublicationUploader.tsx
index 973c3d7b..4b3cddb8 100644
--- a/src/components/PublicationUploader/PublicationUploader.tsx
+++ b/src/components/PublicationUploader/PublicationUploader.tsx
@@ -4,7 +4,7 @@ import {FC} from 'react'
import {SemesterWithProblems} from '@/types/api/generated/competition'
-import {Link} from '../Clickable/Clickable'
+import {Link} from '../Clickable/Link'
import {FileUploader} from '../FileUploader/FileUploader'
interface PublicationUploaderProps {
diff --git a/src/components/RegisterForm/RegisterForm.tsx b/src/components/RegisterForm/RegisterForm.tsx
index 0fd16283..e0bf3f08 100644
--- a/src/components/RegisterForm/RegisterForm.tsx
+++ b/src/components/RegisterForm/RegisterForm.tsx
@@ -1,15 +1,16 @@
+import {Stack, Typography} from '@mui/material'
import {useMutation} from '@tanstack/react-query'
import axios, {AxiosError} from 'axios'
import {useRouter} from 'next/router'
import {FC} from 'react'
import {SubmitHandler, useForm} from 'react-hook-form'
-import styles from '@/components/FormItems/Form.module.scss'
import {FormInput} from '@/components/FormItems/FormInput/FormInput'
import {IGeneralPostResponse} from '@/types/api/general'
import {useSeminarInfo} from '@/utils/useSeminarInfo'
-import {Button, Link} from '../Clickable/Clickable'
+import {Button} from '../Clickable/Button'
+import {Link} from '../Clickable/Link'
import {SchoolSubForm, SchoolSubFormValues} from '../SchoolSubForm/SchoolSubForm'
interface RegisterFormValues extends SchoolSubFormValues {
@@ -101,8 +102,8 @@ export const RegisterForm: FC = () => {
},
}
return (
-
-
+
+
{
/>
-
+
- * takto označéné polia sú povinné
-
+
+ * takto označéné polia sú povinné
+
+
Vyplnením a odoslaním registrácie beriem na vedomie, že moje osobné údaje budú spracované v súlade so zákonom
o ochrane osobných údajov. Bližšie informácie nájdete tu.
-
-
- Registrovať
-
-
-
+
+
+
+ Registrovať
+
+
+
+
)
}
diff --git a/src/components/Results/Results.module.scss b/src/components/Results/Results.module.scss
index 44803a57..8654d6cb 100644
--- a/src/components/Results/Results.module.scss
+++ b/src/components/Results/Results.module.scss
@@ -1,6 +1,5 @@
.results {
background-color: transparent;
- margin-top: 80px;
display: grid;
row-gap: 10px;
grid-template-columns: max-content 1fr repeat(3, max-content);
diff --git a/src/components/SchoolSubForm/SchoolSubForm.tsx b/src/components/SchoolSubForm/SchoolSubForm.tsx
index 62d817e4..e6cfa53f 100644
--- a/src/components/SchoolSubForm/SchoolSubForm.tsx
+++ b/src/components/SchoolSubForm/SchoolSubForm.tsx
@@ -1,10 +1,10 @@
+import {Stack} from '@mui/material'
import {useQuery} from '@tanstack/react-query'
import axios from 'axios'
import {useRef} from 'react'
import {Control, UseFormSetValue, UseFormWatch} from 'react-hook-form'
import {useUpdateEffect} from 'usehooks-ts'
-import styles from '@/components/FormItems/Form.module.scss'
import {IGrade} from '@/types/api/competition'
import {ISchool} from '@/types/api/personal'
@@ -25,9 +25,10 @@ type SchoolSubFormProps = {
control: Control
watch: UseFormWatch
setValue: UseFormSetValue
+ gap: number
}
-export const SchoolSubForm = ({control, watch, setValue}: SchoolSubFormProps) => {
+export const SchoolSubForm = ({control, watch, setValue, gap}: SchoolSubFormProps) => {
const [school_not_found, without_school] = watch(['school_not_found', 'without_school'])
const otherSchoolItem = useRef()
@@ -80,7 +81,7 @@ export const SchoolSubForm = ({control, watch, setValue}: SchoolSubFormProps
+
-
+
)
}
diff --git a/src/components/SemesterAdministration/SemesterAdministration.tsx b/src/components/SemesterAdministration/SemesterAdministration.tsx
index b9617436..54e10346 100644
--- a/src/components/SemesterAdministration/SemesterAdministration.tsx
+++ b/src/components/SemesterAdministration/SemesterAdministration.tsx
@@ -4,10 +4,11 @@ import axios from 'axios'
import {useRouter} from 'next/router'
import {FC, useState} from 'react'
+import {Button} from '@/components/Clickable/Button'
+import {Link} from '@/components/Clickable/Link'
import {SemesterWithProblems} from '@/types/api/generated/competition'
import {useHasPermissions} from '@/utils/useHasPermissions'
-import {Button, Link} from '../Clickable/Clickable'
import {Loading} from '../Loading/Loading'
import {PublicationUploader} from '../PublicationUploader/PublicationUploader'
import {Result} from '../Results/ResultsRow'
diff --git a/src/components/StaticSites/Texts.tsx b/src/components/StaticSites/Texts.tsx
index 4c176612..588a98b7 100644
--- a/src/components/StaticSites/Texts.tsx
+++ b/src/components/StaticSites/Texts.tsx
@@ -1,7 +1,7 @@
import {FC, ReactNode} from 'react'
import {ReactMarkdownProps, TableDataCellProps, TableHeaderCellProps} from 'react-markdown/lib/ast-to-react'
-import {Link} from '../Clickable/Clickable'
+import {Link} from '../Clickable/Link'
import styles from './Texts.module.scss'
type MarkdownLinkProps = {
diff --git a/src/index.scss b/src/index.scss
index dee435f7..709d3132 100644
--- a/src/index.scss
+++ b/src/index.scss
@@ -92,46 +92,3 @@ code {
a {
text-decoration: none;
}
-
-h1 {
- font-style: italic;
-}
-
-.tooltip {
- position: relative;
- display: inline-block;
-}
-
-.tooltip .tooltiptext {
- visibility: hidden;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 0.75rem;
- // width: 10rem;
- height: 2rem;
- white-space: nowrap;
- background-color: black;
- color: #fff;
- border-radius: 6px;
- padding: 0px 20px;
- position: absolute;
- z-index: 0;
- top: calc(50% - 1rem);
- left: calc(100% + 10px);
-}
-
-.tooltip .tooltiptext::after {
- content: "";
- position: absolute;
- top: 50%;
- right: 100%;
- margin-top: -5px;
- border-width: 5px;
- border-style: solid;
- border-color: transparent black transparent transparent;
-}
-
-.tooltip:hover .tooltiptext {
- visibility: visible;
-}
\ No newline at end of file
diff --git a/src/index.scss.d.ts b/src/index.scss.d.ts
index 2a747408..ad024c32 100644
--- a/src/index.scss.d.ts
+++ b/src/index.scss.d.ts
@@ -1,8 +1,6 @@
export type Styles = {
next: string
root: string
- tooltip: string
- tooltiptext: string
}
export type ClassNames = keyof Styles
diff --git a/src/pages/test/index.tsx b/src/pages/test/index.tsx
index 8abdec2e..6c02aa90 100644
--- a/src/pages/test/index.tsx
+++ b/src/pages/test/index.tsx
@@ -1,6 +1,6 @@
import {NextPage} from 'next'
-import {Link} from '@/components/Clickable/Clickable'
+import {Link} from '@/components/Clickable/Link'
import {PageLayout} from '@/components/PageLayout/PageLayout'
import {PagePlaceholder} from '@/components/PagePlaceholder/PagePlaceholder'
diff --git a/src/theme.ts b/src/theme.ts
index 830ab17c..3affe50a 100644
--- a/src/theme.ts
+++ b/src/theme.ts
@@ -7,6 +7,8 @@ declare module '@mui/material/styles' {
button1: React.CSSProperties
button2: React.CSSProperties
button3: React.CSSProperties
+ postTitle: React.CSSProperties
+ postBody: React.CSSProperties
}
// allow configuration using `createTheme`
@@ -15,6 +17,8 @@ declare module '@mui/material/styles' {
button1?: React.CSSProperties
button2?: React.CSSProperties
button3?: React.CSSProperties
+ postTitle?: React.CSSProperties
+ postBody?: React.CSSProperties
}
}
@@ -25,6 +29,8 @@ declare module '@mui/material/Typography' {
button1: true
button2: true
button3: true
+ postTitle: true
+ postBody: true
// disable these variants
h4: false
h5: false
@@ -53,95 +59,121 @@ const _theme = createTheme({
})
const pxToRem = _theme.typography.pxToRem
-const sm = _theme.breakpoints.up('sm')
-const md = _theme.breakpoints.up('md')
-const lg = _theme.breakpoints.up('lg')
-const xl = _theme.breakpoints.up('xl')
+const sm = _theme.breakpoints.up('sm') // 600px
+const md = _theme.breakpoints.up('md') // 900px
+const lg = _theme.breakpoints.up('lg') // 1200px
+const xl = _theme.breakpoints.up('xl') // 1536px
export const theme: Theme = {
..._theme,
typography: {
..._theme.typography,
h1: {
+ // original Figma fontSize: 40px
fontSize: pxToRem(32),
- [sm]: {fontSize: pxToRem(36)},
- [md]: {fontSize: pxToRem(36)},
- [lg]: {fontSize: pxToRem(40)},
+ [sm]: {fontSize: pxToRem(32)},
+ [md]: {fontSize: pxToRem(32)},
+ [lg]: {fontSize: pxToRem(32)},
[xl]: {fontSize: pxToRem(40)},
textTransform: 'uppercase',
fontWeight: 800,
fontStyle: 'italic',
},
h2: {
- fontSize: pxToRem(22),
- [sm]: {fontSize: pxToRem(26)},
- [md]: {fontSize: pxToRem(26)},
- [lg]: {fontSize: pxToRem(30)},
+ // original Figma fontSize: 30px
+ fontSize: pxToRem(24),
+ [sm]: {fontSize: pxToRem(24)},
+ [md]: {fontSize: pxToRem(24)},
+ [lg]: {fontSize: pxToRem(24)},
[xl]: {fontSize: pxToRem(30)},
textTransform: 'uppercase',
fontWeight: 800,
fontStyle: 'italic',
},
h3: {
- fontSize: pxToRem(20),
- [sm]: {fontSize: pxToRem(22)},
- [md]: {fontSize: pxToRem(22)},
- [lg]: {fontSize: pxToRem(24)},
+ // original Figma fontSize: 24px
+ fontSize: pxToRem(18),
+ [sm]: {fontSize: pxToRem(18)},
+ [md]: {fontSize: pxToRem(18)},
+ [lg]: {fontSize: pxToRem(18)},
[xl]: {fontSize: pxToRem(24)},
textTransform: 'uppercase',
fontWeight: 800,
},
body1: {
- fontSize: pxToRem(16),
- [sm]: {fontSize: pxToRem(18)},
- [md]: {fontSize: pxToRem(18)},
- [lg]: {fontSize: pxToRem(20)},
+ // original Figma fontSize: 20px
+ fontSize: pxToRem(14),
+ [sm]: {fontSize: pxToRem(16)},
+ [md]: {fontSize: pxToRem(16)},
+ [lg]: {fontSize: pxToRem(18)},
[xl]: {fontSize: pxToRem(20)},
},
body2: {
- fontSize: pxToRem(12),
- [sm]: {fontSize: pxToRem(14)},
- [md]: {fontSize: pxToRem(14)},
- [lg]: {fontSize: pxToRem(16)},
+ // original Figma fontSize: 16px
+ fontSize: pxToRem(10),
+ [sm]: {fontSize: pxToRem(12)},
+ [md]: {fontSize: pxToRem(12)},
+ [lg]: {fontSize: pxToRem(14)},
[xl]: {fontSize: pxToRem(16)},
},
body3: {
- fontSize: pxToRem(12),
- [sm]: {fontSize: pxToRem(12)},
- [md]: {fontSize: pxToRem(12)},
- [lg]: {fontSize: pxToRem(12)},
+ // original Figma fontSize: 12px
+ fontSize: pxToRem(8),
+ [sm]: {fontSize: pxToRem(8)},
+ [md]: {fontSize: pxToRem(8)},
+ [lg]: {fontSize: pxToRem(10)},
[xl]: {fontSize: pxToRem(12)},
},
button1: {
- fontSize: pxToRem(22),
- [sm]: {fontSize: pxToRem(26)},
- [md]: {fontSize: pxToRem(26)},
- [lg]: {fontSize: pxToRem(30)},
+ // original Figma fontSize: 30px
+ fontSize: pxToRem(24),
+ [sm]: {fontSize: pxToRem(24)},
+ [md]: {fontSize: pxToRem(24)},
+ [lg]: {fontSize: pxToRem(24)},
[xl]: {fontSize: pxToRem(30)},
textTransform: 'uppercase',
fontWeight: 800,
fontStyle: 'italic',
},
button2: {
- fontSize: pxToRem(16),
- [sm]: {fontSize: pxToRem(18)},
- [md]: {fontSize: pxToRem(18)},
- [lg]: {fontSize: pxToRem(20)},
+ // original Figma fontSize: 20px
+ fontSize: pxToRem(14),
+ [sm]: {fontSize: pxToRem(16)},
+ [md]: {fontSize: pxToRem(16)},
+ [lg]: {fontSize: pxToRem(18)},
[xl]: {fontSize: pxToRem(20)},
textTransform: 'uppercase',
fontWeight: 800,
fontStyle: 'italic',
},
button3: {
+ // original Figma fontSize: 14px
fontSize: pxToRem(10),
- [sm]: {fontSize: pxToRem(12)},
- [md]: {fontSize: pxToRem(12)},
- [lg]: {fontSize: pxToRem(14)},
+ [sm]: {fontSize: pxToRem(10)},
+ [md]: {fontSize: pxToRem(10)},
+ [lg]: {fontSize: pxToRem(12)},
[xl]: {fontSize: pxToRem(14)},
textTransform: 'uppercase',
fontWeight: 800,
fontStyle: 'italic',
},
+ postTitle: {
+ // original Figma fontSize: 36px
+ fontSize: pxToRem(30),
+ [sm]: {fontSize: pxToRem(30)},
+ [md]: {fontSize: pxToRem(30)},
+ [lg]: {fontSize: pxToRem(30)},
+ [xl]: {fontSize: pxToRem(36)},
+ fontWeight: 800,
+ },
+ postBody: {
+ // original Figma fontSize: 30px
+ fontSize: pxToRem(24),
+ [sm]: {fontSize: pxToRem(24)},
+ [md]: {fontSize: pxToRem(24)},
+ [lg]: {fontSize: pxToRem(24)},
+ [xl]: {fontSize: pxToRem(30)},
+ },
},
components: {
MuiDialog: {
diff --git a/src/utils/formatDate.ts b/src/utils/formatDate.ts
index 1375dbc7..f14d41c9 100644
--- a/src/utils/formatDate.ts
+++ b/src/utils/formatDate.ts
@@ -1,3 +1,4 @@
import {DateTime} from 'luxon'
-export const formatDate = (date: string) => DateTime.fromISO(date).toFormat('dd.MM.yyyy HH:mm')
+export const formatDateTime = (date: string) => DateTime.fromISO(date).toFormat('dd. MM. yyyy HH:mm')
+export const formatDate = (date: string) => DateTime.fromISO(date).toFormat('dd. LLL yyyy')