88} from '@guardian/source/foundations' ;
99import { StraightLines } from '@guardian/source-development-kitchen/react-components' ;
1010import { grid } from '../grid' ;
11- import { formatAttrString } from '../lib/formatAttrString' ;
1211import { palette } from '../palette' ;
13- import { type OnwardsSource } from '../types/onwards' ;
1412import { type TrailType } from '../types/trails' ;
1513import { Card } from './Card/Card' ;
1614import type { Props as CardProps } from './Card/Card' ;
@@ -19,53 +17,41 @@ type Props = {
1917 absoluteServerTimes : boolean ;
2018 trails : TrailType [ ] ;
2119 discussionApiUrl : string ;
22- headingLink ? : string ;
20+ guardianBaseUrl : string ;
2321} ;
2422
2523const standardCardStyles = css `
2624 flex : 1 ;
27-
2825 position : relative;
2926 display : flex;
3027 padding : ${ space [ 2 ] } px;
3128 background-color : ${ palette ( '--onward-card-background' ) } ;
3229
33- : not (: first-child )::before {
34- content : '' ;
35- position : absolute;
36- top : 0 ;
37- bottom : 0 ;
38- left : -10px ; /* shift into the gap */
39- width : 1px ;
40- background : ${ palette ( '--onward-content-border' ) } ;
41- }
42- ` ;
43-
44- const titleGridStyle = css `
45- ${ grid . column . centre }
46- color : ${ palette ( '--caption-text' ) } ;
47- align-self : start;
48-
49- ${ from . leftCol } {
50- ${ grid . column . left }
30+ ${ from . tablet } {
31+ : not (: first-child )::before {
32+ content : '' ;
33+ position : absolute;
34+ top : 0 ;
35+ bottom : 0 ;
36+ left : -10px ; /* shift into the gap */
37+ width : 1px ;
38+ background : ${ palette ( '--onward-content-border' ) } ;
39+ }
5140 }
5241` ;
5342
5443const standardCardsListStyles = css `
5544 width : 100% ;
5645 display : flex;
57- flex-direction : row ;
46+ flex-direction : column ;
5847 gap : 20px ;
5948 margin-bottom : ${ space [ 6 ] } px;
6049
6150 ${ from . tablet } {
51+ flex-direction : row;
6252 padding-top : ${ space [ 2 ] } px;
6353 }
6454
65- ${ until . tablet } {
66- flex-direction : column;
67- width : 100% ;
68- }
6955 ${ from . leftCol } {
7056 & ::before {
7157 content : '' ;
@@ -80,9 +66,8 @@ const standardCardsListStyles = css`
8066` ;
8167
8268const cardsContainerStyles = css `
83- dis play: inline;
84- position: relative;
8569 ${ grid . column . centre }
70+ position: relative;
8671
8772 ${ from . desktop } {
8873 ${ grid . between ( 'centre-column-start' , 'right-column-end' ) }
@@ -93,29 +78,6 @@ const cardsContainerStyles = css`
9378 }
9479` ;
9580
96- const headerStyles = css `
97- color : ${ palette ( '--carousel-text' ) } ;
98- ${ headlineBold24 } ;
99- padding- botto m: ${ space [ 3 ] } px;
100- padding- to p: ${ space [ 1 ] } px;
101- margin- left: 0;
102-
103- ${ from . tablet } {
104- ${ headlineBold28 } ;
105- }
106- ` ;
107-
108- const headerStylesWithUrl = css `
109- : hover {
110- text- decor ation: underline;
111- }
112- ` ;
113-
114- const titleStyle = css `
115- color : ${ palette ( '--onward-text' ) } ;
116- dis play: inline-block;
117- ` ;
118-
11981const getDefaultCardProps = (
12082 trail : TrailType ,
12183 absoluteServerTimes : boolean ,
@@ -159,39 +121,40 @@ export const MoreGalleries = (props: Props) => {
159121 const [ firstTrail , ...standardCards ] = props . trails ;
160122 if ( ! firstTrail ) return null ;
161123
162- const heading = 'More galleries' ;
163- const onwardsSource : OnwardsSource = 'more-galleries' ;
164-
165- const defaultProps = getDefaultCardProps (
166- firstTrail ,
167- props . absoluteServerTimes ,
168- props . discussionApiUrl ,
169- ) ;
170-
171124 return (
172125 < section
173- data-component = { onwardsSource }
174- data-link = { formatAttrString ( heading ) }
126+ data-component = "more-galleries"
127+ data-link = "more-galleries"
175128 css = { css `
176129 ${ grid . paddedContainer }
177-
178130 background- color : ${ palette ( '--onward-background' ) } ;
179-
180- ${ until . tablet } {
181- padding- to p: ${ space [ 1 ] } px;
182- }
131+ padding- to p: ${ space [ 1 ] } px;
183132
184133 ${ from . tablet } {
134+ padding- to p: 0;
185135 bor der- left: 1px solid ${ palette ( '--onward-content-border' ) } ;
186136 bor der- right: 1px solid
187137 ${ palette ( '--onward-content-border' ) } ;
188138 }
189139 ` }
190140 >
191- < Title title = { heading } url = { props . headingLink } />
192- < MoreGalleriesSplashCard defaultProps = { defaultProps } />
141+ < Title guardianBaseUrl = { props . guardianBaseUrl } />
142+ < MoreGalleriesSplashCard
143+ defaultProps = { getDefaultCardProps (
144+ firstTrail ,
145+ props . absoluteServerTimes ,
146+ props . discussionApiUrl ,
147+ ) }
148+ />
193149 < StraightLines
194- cssOverrides = { cardsContainerStyles }
150+ cssOverrides = { [
151+ cardsContainerStyles ,
152+ css `
153+ ${ until . tablet } {
154+ dis play: none;
155+ }
156+ ` ,
157+ ] }
195158 count = { 1 }
196159 color = { palette ( '--onward-content-border' ) }
197160 />
@@ -209,19 +172,6 @@ export const MoreGalleries = (props: Props) => {
209172 </ li >
210173 ) ) }
211174 </ ul >
212- < StraightLines
213- cssOverrides = { css `
214- ${ grid . column . all }
215- padding- left: ${ space [ 5 ] } px;
216- padding- right: ${ space [ 5 ] } px;
217- ${ from . leftCol } {
218- padding- left: ${ space [ 2 ] } px;
219- padding- right: ${ space [ 2 ] } px;
220- }
221- ` }
222- count = { 1 }
223- color = { palette ( '--onward-content-border' ) }
224- />
225175 </ section >
226176 ) ;
227177} ;
@@ -271,24 +221,36 @@ const MoreGalleriesSplashCard = ({
271221 ) ;
272222} ;
273223
274- const Title = ( { title, url } : { title : string ; url ?: string } ) =>
275- url ? (
276- < a
277- css = { [
278- titleGridStyle ,
279- css `
280- text- decor ation: none;
281- ` ,
282- ] }
283- href = { url }
284- data-link-name = "section heading"
285- >
286- < h2 css = { headerStyles } >
287- < span css = { [ headerStylesWithUrl , titleStyle ] } > { title } </ span >
288- </ h2 >
289- </ a >
290- ) : (
291- < h2 css = { [ titleGridStyle , headerStyles ] } >
292- < span css = { titleStyle } > { title } </ span >
293- </ h2 >
294- ) ;
224+ const Title = ( { guardianBaseUrl } : { guardianBaseUrl : string } ) => (
225+ < a
226+ css = { css `
227+ ${ grid . column . centre }
228+ color : ${ palette ( '--caption-text' ) } ;
229+ text- decor ation: none;
230+ align- self: start;
231+
232+ ${ from . leftCol } {
233+ ${ grid . column . left }
234+ }
235+ ` }
236+ href = { `${ guardianBaseUrl } /inpictures/all` }
237+ data-link-name = "section heading"
238+ >
239+ < h2 css = { headerStyles } > More galleries</ h2 >
240+ </ a >
241+ ) ;
242+
243+ const headerStyles = css `
244+ color : ${ palette ( '--carousel-text' ) } ;
245+ ${ headlineBold24 } ;
246+ padding- botto m: ${ space [ 3 ] } px;
247+ padding- to p: ${ space [ 1 ] } px;
248+
249+ : hover {
250+ text- decor ation: underline;
251+ }
252+
253+ ${ from . tablet } {
254+ ${ headlineBold28 } ;
255+ }
256+ ` ;
0 commit comments