fix show-project-links type linting

This commit is contained in:
Shaun Hamilton
2021-06-26 14:14:45 +01:00
committed by Mrugesh Mohapatra
parent 2a2ee30f63
commit cb0cea07a1

View File

@ -21,7 +21,7 @@ interface IShowProjectLinksProps {
type SolutionStateType = { type SolutionStateType = {
projectTitle: string; projectTitle: string;
challengeFiles: ChallengeFileType[] | null; challengeFiles: ChallengeFileType[] | null;
solution: null | string; solution: CompletedChallenge['solution'];
isOpen: boolean; isOpen: boolean;
}; };
@ -74,7 +74,7 @@ const ShowProjectLinks = (props: IShowProjectLinksProps): JSX.Element => {
if (githubLink) { if (githubLink) {
return ( return (
<> <>
<a href={solution} rel='noopener noreferrer' target='_blank'> <a href={solution ?? ''} rel='noopener noreferrer' target='_blank'>
{t('certification.project.solution')} {t('certification.project.solution')}
</a> </a>
,{' '} ,{' '}
@ -84,11 +84,11 @@ const ShowProjectLinks = (props: IShowProjectLinksProps): JSX.Element => {
</> </>
); );
} }
if (maybeUrlRE.test(solution)) { if (maybeUrlRE.test(solution ?? '')) {
return ( return (
<a <a
className='btn-invert' className='btn-invert'
href={solution} href={solution ?? ''}
rel='noopener noreferrer' rel='noopener noreferrer'
target='_blank' target='_blank'
> >