Skip to content

Commit 327adfd

Browse files
committed
add new LabsPageHeader component, copied from LabsHeader
1 parent 45689e1 commit 327adfd

File tree

1 file changed

+147
-0
lines changed

1 file changed

+147
-0
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
import { css } from '@emotion/react';
2+
import {
3+
from,
4+
palette,
5+
space,
6+
textSans15,
7+
textSansBold15,
8+
} from '@guardian/source/foundations';
9+
import {
10+
Link,
11+
LinkButton,
12+
SvgArrowRightStraight,
13+
} from '@guardian/source/react-components';
14+
import type { EditionId } from '../lib/edition';
15+
import { getLabsUrlSuffix } from '../lib/labs';
16+
import { LABS_HEADER_HEIGHT } from '../lib/labs-constants';
17+
import LabsLogo from '../static/logos/the-guardian-labs.svg';
18+
import { Details } from './Details';
19+
20+
export const LabsHeader = ({ editionId }: { editionId: EditionId }) => (
21+
<div
22+
css={css`
23+
position: relative;
24+
height: ${LABS_HEADER_HEIGHT}px;
25+
display: flex;
26+
justify-content: space-between;
27+
28+
color: ${palette.neutral[7]};
29+
`}
30+
>
31+
<div
32+
css={css`
33+
display: flex;
34+
`}
35+
>
36+
<div
37+
css={css`
38+
border-right: 1px solid ${palette.neutral[60]};
39+
height: 100%;
40+
display: flex;
41+
align-items: center;
42+
43+
padding-right: 10px;
44+
${from.mobileLandscape} {
45+
padding-right: 20px;
46+
}
47+
`}
48+
>
49+
<div
50+
css={css`
51+
${textSansBold15};
52+
margin-bottom: 4px;
53+
`}
54+
>
55+
Paid content
56+
</div>
57+
</div>
58+
<div
59+
css={css`
60+
border-right: 1px solid ${palette.neutral[60]};
61+
height: 100%;
62+
display: flex;
63+
align-items: center;
64+
65+
padding-left: 10px;
66+
padding-right: 10px;
67+
${from.mobileLandscape} {
68+
padding-left: 20px;
69+
padding-right: 20px;
70+
}
71+
`}
72+
>
73+
<Details
74+
label="About"
75+
labelSize="small"
76+
positionStyles={css`
77+
top: 40px;
78+
left: -75px;
79+
80+
${from.mobile} {
81+
left: -108px;
82+
}
83+
84+
${from.mobileLandscape} {
85+
left: -128px;
86+
}
87+
`}
88+
>
89+
<div
90+
css={css`
91+
${textSans15};
92+
background-color: ${palette.labs[400]};
93+
border-top: 1px solid ${palette.neutral[60]};
94+
95+
width: 100vw;
96+
${from.desktop} {
97+
width: 235px;
98+
}
99+
100+
margin-left: -10px;
101+
${from.mobileLandscape} {
102+
margin-left: -20px;
103+
}
104+
padding: ${space[2]}px 10px;
105+
${from.mobileLandscape} {
106+
padding: ${space[3]}px 20px;
107+
}
108+
109+
> a {
110+
color: black;
111+
}
112+
`}
113+
>
114+
<p>
115+
Paid content is paid for and controlled by an
116+
advertiser and produced by the Guardian Labs team.
117+
</p>
118+
<br />
119+
<LinkButton
120+
iconSide="right"
121+
size="xsmall"
122+
priority="subdued"
123+
icon={<SvgArrowRightStraight />}
124+
href="https://www.theguardian.com/info/2016/jan/25/content-funding"
125+
>
126+
Learn more
127+
</LinkButton>
128+
</div>
129+
</Details>
130+
</div>
131+
</div>
132+
<div
133+
css={css`
134+
display: flex;
135+
padding: ${space[1]}px 0;
136+
`}
137+
>
138+
<Link
139+
href={`https://www.theguardian.com/guardian-labs${getLabsUrlSuffix(
140+
editionId,
141+
)}`}
142+
>
143+
<LabsLogo />
144+
</Link>
145+
</div>
146+
</div>
147+
);

0 commit comments

Comments
 (0)