File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 } ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { RichTextInput } from './RichTextInput';
55import InputTextArea from './InputTextArea' ;
66import InputCheckboxToggleInline from './InputCheckboxToggleInline' ;
77import ConditionalField from './ConditionalField' ;
8+ import { OphanBanner } from '../OphanBanner' ;
89import styled from 'styled-components' ;
910import pageConfig from '../../util/extractConfigFromPage' ;
1011import { 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} ;
Original file line number Diff line number Diff 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} ;
You can’t perform that action at this time.
0 commit comments