From c9a30da1b0fede0d5052cfcb9a5164b51ee8913b Mon Sep 17 00:00:00 2001 From: Andrew Polk Date: Fri, 26 Jul 2024 16:33:16 -0700 Subject: [PATCH] Fix overlapping text on resources page (BL-13673) --- src/components/BookCardGroup.tsx | 48 +++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/src/components/BookCardGroup.tsx b/src/components/BookCardGroup.tsx index 58f5b33b..c3635482 100644 --- a/src/components/BookCardGroup.tsx +++ b/src/components/BookCardGroup.tsx @@ -270,27 +270,61 @@ const BookCardGroupInner: React.FunctionComponent = (props) => { // props.title, if provided, is already localized const label = props.title ?? getLocalizedCollectionLabel(props.collection); - const descriptionBlockWidth = 200; + const descriptionBlockLargeWidth = 200; const descriptionBlockLargeRightMargin = 20; + // On a small screen, the description is above the books, so it should be full width. + // (It won't get too long because then it is a large screen...) + // On a large screen, the description is to the left of the books, so it should be a fixed width. + const descriptionBlockWidth = getResponsiveChoice( + "unset", + `${descriptionBlockLargeWidth}px` + ); + const descriptionBlock = (
-

{label}

- +

+ {label} +

+ @@ -359,7 +393,7 @@ const BookCardGroupInner: React.FunctionComponent = (props) => { {descriptionBlock}