From c4126a183a2d86b0857e5abad4dd59de288dce9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Trembeck=C3=BD?= Date: Fri, 10 Nov 2023 17:11:47 +0100 Subject: [PATCH] Otvaranie PDF nahrateho/opraveneho riesenia v novom tabe (#152) * otvorit PDF nahrateho/opraveneho riesenia v novom tabe * open rest of the PDF links in a new tab --- src/components/Archive/Archive.tsx | 6 +++++- src/components/Clickable/Clickable.tsx | 10 +++++----- src/components/Problems/Problems.tsx | 13 +++++++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/Archive/Archive.tsx b/src/components/Archive/Archive.tsx index efc846e9..c6a1ddb5 100644 --- a/src/components/Archive/Archive.tsx +++ b/src/components/Archive/Archive.tsx @@ -23,7 +23,11 @@ const PublicationButton: FC<{ publicationId: number publicationName: string }> = ({publicationId, publicationName}) => { - return {publicationName} + return ( + + {publicationName} + + ) } const ResultsButton: FC<{ diff --git a/src/components/Clickable/Clickable.tsx b/src/components/Clickable/Clickable.tsx index 009445e6..86503fbf 100644 --- a/src/components/Clickable/Clickable.tsx +++ b/src/components/Clickable/Clickable.tsx @@ -1,6 +1,6 @@ import clsx from 'clsx' import NextLink from 'next/link' -import {ButtonHTMLAttributes, FC, ReactNode} from 'react' +import {ButtonHTMLAttributes, ComponentProps, FC, ReactNode} from 'react' import styles from './Clickable.module.scss' @@ -24,20 +24,20 @@ export const Button: FC = ({children, onClick, disabled, type}) => ) } -interface LinkProps { +type LinkProps = { href?: string disabled?: boolean children: ReactNode -} +} & Pick, 'target'> -export const Link: FC = ({children, href, disabled}) => { +export const Link: FC = ({children, href, disabled, target}) => { // https://a11y-guidelines.orange.com/en/articles/disable-elements/#disable-a-link return disabled ? ( {children} ) : ( - + {children} ) diff --git a/src/components/Problems/Problems.tsx b/src/components/Problems/Problems.tsx index ff19a4db..d6308fea 100644 --- a/src/components/Problems/Problems.tsx +++ b/src/components/Problems/Problems.tsx @@ -72,14 +72,23 @@ const Problem: FC<{ )} {displayActions && (
- {problem.solution_pdf && vzorové riešenie} + {problem.solution_pdf && ( + + vzorové riešenie + + )} {registered && ( <> - + moje riešenie opravené riešenie{!!problem.submitted?.corrected_solution && ` (${problem.submitted.score || '?'})`}