Skip to content

Commit b58216d

Browse files
committed
Move caption below byline in mobile breakpoints
1 parent 8bdf8c3 commit b58216d

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

dotcom-rendering/src/components/ArticleMeta.web.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { css } from '@emotion/react';
22
import { between, from, space, until } from '@guardian/source/foundations';
3+
import { Hide } from '@guardian/source/react-components';
34
import { StraightLines } from '@guardian/source-development-kitchen/react-components';
45
import type { FEArticle } from '../frontend/feArticle';
56
import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling';
@@ -17,6 +18,7 @@ import type { FEElement } from '../types/content';
1718
import type { Podcast, TagType } from '../types/tag';
1819
import { Avatar } from './Avatar';
1920
import { Branding } from './Branding.importable';
21+
import { Caption } from './Caption';
2022
import { CommentCount } from './CommentCount.importable';
2123
import { useConfig } from './ConfigContext';
2224
import { Contributor } from './Contributor';
@@ -41,6 +43,7 @@ type Props = {
4143
isCommentable: boolean;
4244
mainMediaElements?: FEElement[];
4345
crossword?: FEArticle['crossword'];
46+
captionText?: string;
4447
};
4548

4649
const meta = (format: ArticleFormat) => {
@@ -324,6 +327,7 @@ export const ArticleMeta = ({
324327
isCommentable,
325328
mainMediaElements,
326329
crossword,
330+
captionText,
327331
}: Props) => {
328332
const soleContributor = getSoleContributor(tags, byline);
329333
const authorName = soleContributor?.title ?? 'Author Image';
@@ -404,6 +408,21 @@ export const ArticleMeta = ({
404408
/>
405409
)}
406410

411+
{format.design === ArticleDesign.Gallery ? (
412+
<Hide from="leftCol">
413+
<Caption
414+
captionText={captionText}
415+
format={format}
416+
isMainMedia={true}
417+
/>
418+
<StraightLines
419+
cssOverrides={stretchLines}
420+
count={4}
421+
color={themePalette('--straight-lines')}
422+
/>
423+
</Hide>
424+
) : null}
425+
407426
{crossword?.creator && (
408427
<CrosswordSetter
409428
setter={crossword.creator.name}

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,15 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
270270
format={format}
271271
standfirst={frontendData.standfirst}
272272
/>
273-
<Caption
274-
captionText={captionText}
275-
format={format}
276-
isMainMedia={true}
277-
/>
273+
274+
<Hide until="leftCol">
275+
<Caption
276+
captionText={captionText}
277+
format={format}
278+
isMainMedia={true}
279+
/>
280+
</Hide>
281+
278282
<div css={metaAndDisclaimerContainer}>
279283
{isWeb ? (
280284
<ArticleMeta
@@ -297,6 +301,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
297301
isCommentable={frontendData.isCommentable}
298302
discussionApiUrl={discussionApiUrl}
299303
shortUrlId={shortUrlId}
304+
captionText={captionText}
300305
/>
301306
) : null}
302307
{isApps ? (

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3433,7 +3433,7 @@ const articleBorderDark: PaletteFunction = () => sourcePalette.neutral[20];
34333433

34343434
const straightLinesLight: PaletteFunction = (format) => {
34353435
if (format.design === ArticleDesign.Gallery) {
3436-
return sourcePalette.neutral[20];
3436+
return sourcePalette.neutral[38];
34373437
}
34383438
if (format.theme === ArticleSpecial.SpecialReportAlt) {
34393439
return transparentColour(sourcePalette.neutral[60], 0.3);

0 commit comments

Comments
 (0)