From 3b16908f89ed54f2234101adccdf875736f47a38 Mon Sep 17 00:00:00 2001 From: Pyry Koivisto Date: Thu, 26 Oct 2023 17:00:20 +0300 Subject: [PATCH] YKI(Frontend): Show complete text on desktop and limited text on mobile. --- .../examSession/PublicExamSessionListing.tsx | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/frontend/packages/yki/src/components/registration/examSession/PublicExamSessionListing.tsx b/frontend/packages/yki/src/components/registration/examSession/PublicExamSessionListing.tsx index 3a23be9734..13e719fb0c 100644 --- a/frontend/packages/yki/src/components/registration/examSession/PublicExamSessionListing.tsx +++ b/frontend/packages/yki/src/components/registration/examSession/PublicExamSessionListing.tsx @@ -31,25 +31,32 @@ const DisplayedRowsLabel = ({ count: number; }) => { const translateCommon = useCommonTranslation(); - - return ( -

- {translateCommon('component.table.pagination.displayedRowsLabel', { - from, - to, - count, - })} -

+ const { isPhone } = useWindowProperties(); + const fullLabelText = translateCommon( + 'component.table.pagination.displayedRowsAriaLabel', + { + from, + to, + count, + } ); + + if (isPhone) { + return ( + <> +

{fullLabelText}

+ + + ); + } else { + return fullLabelText; + } }; export const PublicExamSessionsTable = ({