Skip to content

Commit 13a7ca2

Browse files
authored
Merge branch 'main' into ab/add-us-front-restriction
2 parents 922aa66 + bd806b5 commit 13a7ca2

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React from 'react';
2+
3+
import styled from 'styled-components';
4+
import { ConicalFlaskIcon } from './icons/Icons';
5+
import { theme } from 'constants/theme';
6+
import url from '../constants/url';
7+
8+
const OphanBannerContainer = styled.div`
9+
display: flex;
10+
flex-direction: row;
11+
align-items: center;
12+
gap: 6px;
13+
background: ${({ theme }) => theme.abTest.active.background};
14+
color: ${({ theme }) => theme.abTest.active.text};
15+
border-bottom-left-radius: 4px;
16+
border-bottom-right-radius: 4px;
17+
padding: 10px 18px;
18+
margin: 10px -14px -12px -14px;
19+
font-size: 14px;
20+
`;
21+
22+
const OphanBannerTitle = styled.span`
23+
font-weight: 600;
24+
`;
25+
26+
const OphanBannerLink = styled.a`
27+
color: ${({ theme }) => theme.abTest.active.text};
28+
`;
29+
30+
const OphanBanner = () => {
31+
return (
32+
<OphanBannerContainer role="status">
33+
<ConicalFlaskIcon size="xs" fill={theme.abTest.active.icon} />
34+
<OphanBannerTitle>Headline Test In Progress :</OphanBannerTitle>
35+
<span>
36+
View results in{' '}
37+
<OphanBannerLink
38+
href={url.ophan}
39+
target="_blank"
40+
rel="noreferrer noopener"
41+
aria-label="View results in Ophan (opens in a new tab)"
42+
>
43+
Ophan
44+
</OphanBannerLink>
45+
</span>
46+
</OphanBannerContainer>
47+
);
48+
};
49+
50+
export { OphanBanner };

fronts-client/src/components/inputs/HeadlineInput.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { RichTextInput } from './RichTextInput';
55
import InputTextArea from './InputTextArea';
66
import InputCheckboxToggleInline from './InputCheckboxToggleInline';
77
import ConditionalField from './ConditionalField';
8+
import { OphanBanner } from '../OphanBanner';
89
import styled from 'styled-components';
910
import pageConfig from '../../util/extractConfigFromPage';
1011
import { normaliseHeadline } from '../../util/abTests';
@@ -135,6 +136,9 @@ const HeadlineInput = ({ ...props }: HeadlineInputProps) => {
135136
data-testid="edit-form-headline-field"
136137
/>
137138
)}
139+
{abTestFeatureEnabled && props.abTestEnabled && props.hasActiveABTest && (
140+
<OphanBanner />
141+
)}
138142
</HeadlineInputContainer>
139143
);
140144
};

fronts-client/src/constants/url.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ export default {
4545
liveUrlPROD: 'https://www.theguardian.com/',
4646
emailLiveUrlCODE,
4747
emailLiveUrlPROD,
48+
//TODO: update to the correct url
49+
ophan: 'https://dashboard.ophan.co.uk/',
4850
};

0 commit comments

Comments
 (0)