Skip to content

Commit

Permalink
YKI(Frontend): Show complete text on desktop and limited text on mobile.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoivisto committed Oct 26, 2023
1 parent 42bf0a5 commit 3b16908
Showing 1 changed file with 25 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,32 @@ const DisplayedRowsLabel = ({
count: number;
}) => {
const translateCommon = useCommonTranslation();

return (
<p
aria-label={translateCommon(
'component.table.pagination.displayedRowsAriaLabel',
{
from,
to,
count,
}
)}
>
{translateCommon('component.table.pagination.displayedRowsLabel', {
from,
to,
count,
})}
</p>
const { isPhone } = useWindowProperties();
const fullLabelText = translateCommon(
'component.table.pagination.displayedRowsAriaLabel',
{
from,
to,
count,
}
);

if (isPhone) {
return (
<>
<p className="display-none">{fullLabelText}</p>
<p aria-hidden="true">
{translateCommon('component.table.pagination.displayedRowsLabel', {
from,
to,
count,
})}
</p>
</>
);
} else {
return fullLabelText;
}
};

export const PublicExamSessionsTable = ({
Expand Down

0 comments on commit 3b16908

Please sign in to comment.