From 042b46cce77d62be9503d389255cf78366a74f4e Mon Sep 17 00:00:00 2001 From: Remko Date: Tue, 13 Feb 2024 11:58:15 +0100 Subject: [PATCH] WCAG --- .../TableResultsTemplate.tsx | 115 +++++++++--------- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx index fc3eb421..329fcc01 100644 --- a/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx +++ b/pwa/src/templates/templateParts/tableResultsTemplate/TableResultsTemplate.tsx @@ -28,72 +28,75 @@ export const TableResultsTemplate: React.FC = ({ requ scrollRightButton: t("Scroll table to the right"), }} > - - - - {t("Subject")} - {t("Publication date")} - {(window.sessionStorage.getItem("SHOW_CATEGORY") === "true" || - window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true") && ( - <> - {window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && ( - {t("Municipality")} - )} - {window.sessionStorage.getItem("SHOW_CATEGORY") === "true" && ( - {t("Category")} - )} - - )} - {t("Summary")} - - - - {requests.map((request) => ( - navigate(request._id)} - tabIndex={0} - aria-label={`${request.titel}, ${ - request.publicatiedatum ? translateDate(i18n.language, request.publicatiedatum) : t("N/A") - } ${ - window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" ? `,${request.organisatie?.naam}` : "" - } ${window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ? `, ${request.categorie}` : ""}, ${ - request.samenvatting - }`} - > - {request.titel ?? t("No subject available")} - - {request.publicatiedatum - ? translateDate(i18n.language, request.publicatiedatum) - : t("No publication date available")} - +
+
+ + + {t("Subject")} + {t("Publication date")} {(window.sessionStorage.getItem("SHOW_CATEGORY") === "true" || window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true") && ( <> {window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && ( - - {request.organisatie?.naam ?? t("No municipality available")} - + {t("Municipality")} )} {window.sessionStorage.getItem("SHOW_CATEGORY") === "true" && ( - - {request.categorie ?? t("No category available")} - + {t("Category")} )} )} - -
{request.samenvatting ?? t("No summary available")}
-
+ {t("Summary")}
- ))} - -
+ + + {requests.map((request) => ( + navigate(request._id)} + tabIndex={0} + aria-label={`${request.titel}, ${ + request.publicatiedatum ? translateDate(i18n.language, request.publicatiedatum) : t("N/A") + } ${ + window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" ? `,${request.organisatie?.naam}` : "" + } ${window.sessionStorage.getItem("SHOW_CATEGORY") === "true" ? `, ${request.categorie}` : ""}, ${ + request.samenvatting ?? t("No summary available") + }`} + > + {request.titel ?? t("No subject available")} + + {request.publicatiedatum + ? translateDate(i18n.language, request.publicatiedatum) + : t("No publication date available")} + + {(window.sessionStorage.getItem("SHOW_CATEGORY") === "true" || + window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true") && ( + <> + {window.sessionStorage.getItem("SHOW_ORGANIZATION") === "true" && ( + + {request.organisatie?.naam ?? t("No municipality available")} + + )} + {window.sessionStorage.getItem("SHOW_CATEGORY") === "true" && ( + + {request.categorie ?? t("No category available")} + + )} + + )} + +
{request.samenvatting ?? t("No summary available")}
+
+
+ ))} +
+ + ); };