From b799e4efc68bc302c1f094dbad7d9243fd611913 Mon Sep 17 00:00:00 2001 From: rtrembecky Date: Fri, 10 Nov 2023 13:05:53 +0100 Subject: [PATCH] otvorit PDF nahrateho/opraveneho riesenia v novom tabe --- src/components/Clickable/Clickable.tsx | 10 +++++----- src/components/Problems/Problems.tsx | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) 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..c5f801b5 100644 --- a/src/components/Problems/Problems.tsx +++ b/src/components/Problems/Problems.tsx @@ -75,11 +75,16 @@ const Problem: FC<{ {problem.solution_pdf && vzorové riešenie} {registered && ( <> - + moje riešenie opravené riešenie{!!problem.submitted?.corrected_solution && ` (${problem.submitted.score || '?'})`}