From f58837717df5caa525376e3a534bdd3d95b51ac8 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Wed, 18 Dec 2024 11:04:43 +0100 Subject: [PATCH] Fix accessibility issues in
list in InfoBox components --- components/shared/infoBox/InfoBox.tsx | 29 +++---- components/shared/infoBox/InfoBoxDetails.tsx | 90 +++++++------------- components/shared/infoBox/InfoBoxItem.tsx | 1 + 3 files changed, 43 insertions(+), 77 deletions(-) diff --git a/components/shared/infoBox/InfoBox.tsx b/components/shared/infoBox/InfoBox.tsx index cf75a4e..e7892e2 100644 --- a/components/shared/infoBox/InfoBox.tsx +++ b/components/shared/infoBox/InfoBox.tsx @@ -28,29 +28,20 @@ const InfoBox = ({ work }: InfoBoxProps) => {
{!!selectedManifestation?.audience?.ages.length && ( - <> -
- age.display)} - /> - + age.display)} + /> )} {!!selectedManifestation?.series?.length && ( - <> -
- - + )} {!!selectedManifestation?.subjects.all?.length && ( - <> -
- subject.display)} - isButtons - /> - + subject.display)} + isButtons + /> )}
diff --git a/components/shared/infoBox/InfoBoxDetails.tsx b/components/shared/infoBox/InfoBoxDetails.tsx index d116cac..55a3cfe 100644 --- a/components/shared/infoBox/InfoBoxDetails.tsx +++ b/components/shared/infoBox/InfoBoxDetails.tsx @@ -23,83 +23,57 @@ const InfoBoxDetails = ({ work }: InfoBoxDetailsProps) => {
{!!selectedManifestation && ( - <> -
- type.materialTypeGeneral.display - )} - /> - + type.materialTypeGeneral.display + )} + /> )} {!!selectedManifestation?.languages?.main?.length && ( - <> -
- language.display - )} - /> - + language.display)} + /> )} {!!selectedManifestation?.physicalDescription?.summaryFull && ( - <> -
- - + )} {!!selectedManifestation?.dateFirstEdition?.display || (work.workYear?.display && ( - <> -
- - + ))}
{!!selectedManifestation?.genreAndForm?.length && ( - <> -
- - + )} {!!selectedManifestation?.identifiers?.length && !!getIsbnsFromManifestation(selectedManifestation)?.length && ( - <> -
- - + )} {!!selectedManifestation?.publisher?.length && ( - <> -
- - + )} {(!!selectedManifestation?.contributors?.length || !!selectedManifestation?.contributorsFromDescription?.length) && ( - <> -
- item.display) - .concat(selectedManifestation?.contributorsFromDescription)} - /> - + item.display) + .concat(selectedManifestation?.contributorsFromDescription)} + /> )}
diff --git a/components/shared/infoBox/InfoBoxItem.tsx b/components/shared/infoBox/InfoBoxItem.tsx index a151543..2dd1187 100644 --- a/components/shared/infoBox/InfoBoxItem.tsx +++ b/components/shared/infoBox/InfoBoxItem.tsx @@ -20,6 +20,7 @@ const InfoBoxItem = ({ term, description, isButtons = false }: InfoBoxItemProps) return ( <> +
{term}
{!isButtons &&
{description.join(", ")}
} {isButtons && (