Skip to content

Commit 9f5ede6

Browse files
committed
Update shareButton grid for mobile breakpoint
1 parent d8cf2bf commit 9f5ede6

1 file changed

Lines changed: 62 additions & 4 deletions

File tree

dotcom-rendering/src/layouts/HostedArticleLayout.tsx

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import { css } from '@emotion/react';
2-
import { palette as sourcePalette } from '@guardian/source/foundations';
2+
import {
3+
from,
4+
palette as sourcePalette,
5+
space,
6+
} from '@guardian/source/foundations';
37
import { HostedContentHeader } from '../components/HostedContentHeader';
8+
import { Island } from '../components/Island';
49
import { Section } from '../components/Section';
10+
import { ShareButton } from '../components/ShareButton.importable';
511
import { grid } from '../grid';
12+
import {
13+
ArticleDesign,
14+
ArticleDisplay,
15+
ArticleSpecial,
16+
} from '../lib/articleFormat';
617
import type { RenderingTarget } from '../types/renderingTarget';
718
import { Stuck } from './lib/stickiness';
819

@@ -22,6 +33,22 @@ const border = css`
2233
border: 1px solid black;
2334
`;
2435

36+
const metaFlex = css`
37+
margin-bottom: ${space[3]}px;
38+
display: flex;
39+
justify-content: space-between;
40+
flex-wrap: wrap;
41+
`;
42+
43+
const shareButtonWrapper = css`
44+
${grid.column.centre}
45+
grid-row: 1 / -2;
46+
47+
${from.leftCol} {
48+
${grid.column.left}
49+
}
50+
`;
51+
2552
export const HostedArticleLayout = (props: WebProps | AppProps) => {
2653
return (
2754
<>
@@ -52,9 +79,40 @@ export const HostedArticleLayout = (props: WebProps | AppProps) => {
5279
Headline
5380
</div>
5481
</header>
55-
<div css={[grid.container]}>
56-
<div css={[grid.column.left, 'grid-row: 1']}>
57-
Left column
82+
<div
83+
css={[
84+
grid.container,
85+
css`
86+
padding-top: ${space[12]}px;
87+
88+
${from.leftCol} {
89+
padding-top: ${space[5]}px;
90+
}
91+
`,
92+
]}
93+
>
94+
<div css={shareButtonWrapper}>
95+
<div data-print-layout="hide" css={metaFlex}>
96+
{props.renderingTarget === 'Web' && (
97+
<Island
98+
priority="feature"
99+
defer={{ until: 'visible' }}
100+
>
101+
<ShareButton
102+
pageId={'replace with actual pageId'}
103+
webTitle={
104+
'replace with actual webTitle'
105+
}
106+
format={{
107+
theme: ArticleSpecial.Labs,
108+
design: ArticleDesign.Standard,
109+
display: ArticleDisplay.Standard,
110+
}} // replace with Hosted Content format if there is one
111+
context="ArticleMeta"
112+
/>
113+
</Island>
114+
)}
115+
</div>
58116
</div>
59117
<div css={[grid.column.right, 'grid-row: 1']}>
60118
Onward content

0 commit comments

Comments
 (0)