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

Text for tips how to upload solution #361

Merged
merged 2 commits into from
Apr 14, 2024
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
7 changes: 5 additions & 2 deletions src/components/Clickable/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Typography, TypographyProps} from '@mui/material'
import {SxProps, Theme, Typography, TypographyProps} from '@mui/material'
import clsx from 'clsx'
import NextLink from 'next/link'
import {ComponentProps, FC, ReactNode} from 'react'
Expand All @@ -10,9 +10,10 @@ type LinkProps = {
disabled?: boolean
children: ReactNode
variant?: TypographyProps['variant']
sx?: SxProps<Theme>
} & Pick<ComponentProps<typeof NextLink>, 'target'>

export const Link: FC<LinkProps> = ({children, href, disabled, target, variant}) => {
export const Link: FC<LinkProps> = ({children, href, disabled, target, variant, sx}) => {
// https://a11y-guidelines.orange.com/en/articles/disable-elements/#disable-a-link
return disabled ? (
<Typography
Expand All @@ -21,6 +22,7 @@ export const Link: FC<LinkProps> = ({children, href, disabled, target, variant})
className={clsx(styles.actionButton, styles.disabled)}
aria-disabled
role="link"
sx={sx}
>
{children}
</Typography>
Expand All @@ -31,6 +33,7 @@ export const Link: FC<LinkProps> = ({children, href, disabled, target, variant})
href={href ?? ''}
target={target}
className={clsx(styles.actionButton)}
sx={sx}
>
{children}
</Typography>
Expand Down
12 changes: 11 additions & 1 deletion src/components/Problems/UploadProblemForm.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Stack} from '@mui/material'
import {Typography} from '@mui/material'
import {useMutation} from '@tanstack/react-query'
import axios from 'axios'
import {Dispatch, FC, SetStateAction, useState} from 'react'
Expand All @@ -8,6 +8,7 @@
import {niceBytes} from '@/utils/niceBytes'

import {Button} from '../Clickable/Button'
import {Link} from '../Clickable/Link'
import {Dialog} from '../Dialog/Dialog'
import {FileDropZone} from '../FileDropZone/FileDropZone'
import styles from './UploadProblemForm.module.scss'
Expand Down Expand Up @@ -35,7 +36,7 @@
invalidateSeriesQuery()
alert('Riešenie úspešne nahrané.')
} else {
console.warn(response)

Check warning on line 39 in src/components/Problems/UploadProblemForm.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Unexpected console statement
alert(
'Niečo sa ASI pokazilo, skontroluj, či bolo riešenie nahrané, a ak si technický typ, môžeš pozrieť chybu v konzole.',
)
Expand Down Expand Up @@ -115,6 +116,15 @@
getInputProps={getInputProps}
text="Vlož riešenie vo formáte pdf"
/>
<Typography variant="body2" textAlign="center" component="div">
Dbaj na čitateľnosť riešenia - namiesto odfotenia zo zošita ho radšej napíš na čistý papier formátu A4,
oskenuj (prípadne využi mobilné aplikácie, ktoré skener nahradia) a nahraj ho správne orientované. Ak máš
riešenie v inom formáte ako PDF, skonvertuj ho napríklad pomocou stránky{' '}
<Link variant="button3" href="https://www.ilovepdf.com/" sx={{textTransform: 'unset'}}>
ilovepdf.com
</Link>
.
</Typography>
</>
)}
{files?.name && (
Expand Down
Loading