From 83ecfa0a5eef2e45ba7b558feeaf0535c21be53e Mon Sep 17 00:00:00 2001 From: Raphaelle Cantin Date: Mon, 2 Dec 2024 17:13:38 +0000 Subject: [PATCH] Modify recommended stories slightly --- .../components/RecommendedStories/index.tsx | 70 ++++++++++++------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/common/views/components/RecommendedStories/index.tsx b/common/views/components/RecommendedStories/index.tsx index c89801ef6b..84a05d1f09 100644 --- a/common/views/components/RecommendedStories/index.tsx +++ b/common/views/components/RecommendedStories/index.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components'; import { font } from '@weco/common/utils/classnames'; import { Container } from '@weco/common/views/components/styled/Container'; import Space from '@weco/common/views/components/styled/Space'; -import { WobblyBottom } from '@weco/common/views/components/WobblyEdge'; +import { WobblyEdge } from '@weco/common/views/components/WobblyEdge'; const RecommendedSection = styled(Space).attrs({ $v: { size: 'l', properties: ['margin-bottom', 'margin-top'] }, @@ -12,6 +12,19 @@ const RecommendedSection = styled(Space).attrs({ background-color: ${props => props.theme.color('white')}; `; +const RecommendedWrapper = styled.div` + h2 { + padding: 16px 24px; + margin: 0; + } + + ${props => props.theme.media('xlarge', 'min-width')` + max-width: 2200px; + margin: 0 auto; + justify-content: center; + `} +`; + const StoryPromoContainer = styled(Container)` padding: 0 24px ${props => props.theme.containerPadding.small}px; max-width: none; @@ -53,6 +66,11 @@ const StoriesContainer = styled.ul` margin-left: 0; display: flex; flex-wrap: nowrap; + + ${props => props.theme.media('xlarge', 'min-width')` + max-width: 2200px; + margin: 0 auto; + `} `; const StoryLink = styled.a` @@ -75,12 +93,16 @@ const StoryWrapper = styled.li` padding-bottom: 0; } + ${props => props.theme.media('xlarge', 'min-width')` + min-width: 345px; + `} + ${props => props.theme.media('large', 'max-width')` min-width: 40vw; - max-width: 300px; `} ${props => props.theme.media('medium', 'max-width')` + max-width: 300px; min-width: 80vw; `} `; @@ -179,28 +201,28 @@ const RecommendedStories = () => { return ( -

- Popular stories -

- - - - {stories.map(story => { - return ( - - - - {story.title} -

{story.title}

-
-
-
- ); - })} -
-
- - + + + +

Popular stories

+ + + + {stories.map(story => { + return ( + + + + {story.title} +

{story.title}

+
+
+
+ ); + })} +
+
+
); };