From b3696a3170671b9dce7ceaa232ed7915fb5598f2 Mon Sep 17 00:00:00 2001 From: Roland Bernard <rolbernard@unibz.it> Date: Mon, 7 Jun 2021 21:49:20 +0200 Subject: [PATCH] Fixed accessibility issues --- client/src/components/ui/Project/index.tsx | 60 +++++++++++++--------- client/src/pages/Home/index.tsx | 8 +-- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/client/src/components/ui/Project/index.tsx b/client/src/components/ui/Project/index.tsx index 0e5d15a..ef6a7a0 100644 --- a/client/src/components/ui/Project/index.tsx +++ b/client/src/components/ui/Project/index.tsx @@ -38,31 +38,43 @@ export default function Project({ project, large, demo }: ProjectProps) { } }, [project, demo]); - return ( - <Link to={demo ? '' : '/projects/' + project.id} className={'project ' + (large ? 'large' : '')}> - <div className="status"> - <Tag label={project.status} color={StatusColors.get(project.status)} /> - </div> - <div className="content"> - { - completion - ? (<CircularProgress percent={completion.closed / (completion.sum ?? 1) * 100} color={project.color} />) - : (<LoadingScreen />) - } - <div className="title">{project.name}</div> - { - large && - <div className="details"> - { - project.deadline - && (<div className="deadline">{formatDate(project.deadline, 'month')}</div>) - } - <AssigneeList assignees={assignees} max={3} /> - </div> - } + const content = <> + <div className="status"> + <Tag label={project.status} color={StatusColors.get(project.status)} /> + </div> + <div className="content"> + { + completion + ? (<CircularProgress percent={completion.closed / (completion.sum ?? 1) * 100} color={project.color} />) + : (<LoadingScreen />) + } + <div className="title">{project.name}</div> + { + large && + <div className="details"> + { + project.deadline + && (<div className="deadline">{formatDate(project.deadline, 'month')}</div>) + } + <AssigneeList assignees={assignees} max={3} /> + </div> + } + </div> + </>; + + if (demo) { + return ( + <Link to={'/projects/' + project.id} className={'project ' + (large ? 'large' : '')}> + { content } + </Link> + ); + } else { + return ( + <div className={'project ' + (large ? 'large' : '')}> + { content } </div> - </Link> - ); + ); + } } diff --git a/client/src/pages/Home/index.tsx b/client/src/pages/Home/index.tsx index abf5666..3811b72 100644 --- a/client/src/pages/Home/index.tsx +++ b/client/src/pages/Home/index.tsx @@ -19,7 +19,7 @@ export default function Home(): JSX.Element { <div className="hero-container"> <header> <a href="index.html"> - <img src={Logo} alt="Logo" width="100" height="35" /> + <img src={Logo} alt="Go home" width="100" height="35" /> </a> <nav> <a href="#hero">Home</a> @@ -137,7 +137,7 @@ export default function Home(): JSX.Element { <div className="team-list"> <div className="team-member"> <img className="team-member-image" src={ImageDaniel} width="200" height="200" - alt="Daniel PlanĂśtscher" /> + alt="" /> <div className="team-member-info"> <div className="team-member-title">Web Developer</div> <h3 className="team-member-name">Daniel PlanĂśtscher</h3> @@ -153,7 +153,7 @@ export default function Home(): JSX.Element { </div> <div className="team-member"> <img className="team-member-image" src={ImageRoland} width="200" height="200" - alt="Roland Bernard" /> + alt="" /> <div className="team-member-info"> <div className="team-member-title">Software Engineer</div> <h3 className="team-member-name">Roland Bernard</h3> @@ -202,7 +202,7 @@ export default function Home(): JSX.Element { <footer> <div className="content-container footer-container"> <div className="footer-copyright"> - <img src={Logo} className="logo" alt="Logo" width="70" height="24" /> + <img src={Logo} className="logo" alt="" width="70" height="24" /> <p> © <a href="index.html">ryoko</a>, 2021 </p> -- GitLab