11import { css } from '@emotion/react' ;
2- import {
3- between ,
4- from ,
5- palette as sourcePalette ,
6- } from '@guardian/source/foundations' ;
2+ import { from , palette as sourcePalette } from '@guardian/source/foundations' ;
73import { AppsFooter } from '../components/AppsFooter.importable' ;
84import { ArticleHeadline } from '../components/ArticleHeadline' ;
95import { ArticleMetaApps } from '../components/ArticleMeta.apps' ;
106import { ArticleMeta } from '../components/ArticleMeta.web' ;
117import { ArticleTitle } from '../components/ArticleTitle' ;
8+ import { Caption } from '../components/Caption' ;
129import { Footer } from '../components/Footer' ;
1310import { GalleryImage } from '../components/GalleryImage' ;
1411import { Island } from '../components/Island' ;
@@ -19,6 +16,7 @@ import { Standfirst } from '../components/Standfirst';
1916import { SubMeta } from '../components/SubMeta' ;
2017import { grid } from '../grid' ;
2118import type { ArticleFormat } from '../lib/articleFormat' ;
19+ import { decideMainMediaCaption } from '../lib/decide-caption' ;
2220import type { NavType } from '../model/extract-nav' ;
2321import { palette } from '../palette' ;
2422import type { Gallery } from '../types/article' ;
@@ -60,6 +58,8 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
6058 const isWeb = props . renderingTarget === 'Web' ;
6159 const isApps = props . renderingTarget === 'Apps' ;
6260
61+ const captionText = decideMainMediaCaption ( props . gallery . mainMedia ) ;
62+
6363 const format : ArticleFormat = {
6464 design : gallery . design ,
6565 display : gallery . display ,
@@ -117,6 +117,11 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
117117 format = { format }
118118 standfirst = { frontendData . standfirst }
119119 />
120+ < Caption
121+ captionText = { captionText }
122+ format = { format }
123+ isMainMedia = { true }
124+ />
120125 { isWeb ? (
121126 < ArticleMeta
122127 branding = {
@@ -166,32 +171,6 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
166171 shortUrlId = { frontendData . config . shortUrlId }
167172 />
168173 ) : null }
169- < div
170- css = { [
171- css `
172- ${ grid . column . centre }
173- ${ from . leftCol } {
174- ${ grid . column . left }
175- }
176- position : relative;
177- ${ between . tablet . and . leftCol } {
178- & ::before {
179- content : '' ;
180- position : absolute;
181- left : -10px ;
182- top : 0 ;
183- bottom : 0 ;
184- width : 1px ;
185- background-color : ${ palette (
186- '--article-border' ,
187- ) } ;
188- }
189- }
190- ` ,
191- ] }
192- >
193- Main media caption
194- </ div >
195174 </ header >
196175 { gallery . images . map ( ( element , idx ) => (
197176 < GalleryImage
0 commit comments