@@ -2,7 +2,6 @@ import { css } from '@emotion/react';
22import { between , from , space , until } from '@guardian/source/foundations' ;
33import { StraightLines } from '@guardian/source-development-kitchen/react-components' ;
44import type { CSSProperties } from 'react' ;
5- import { preferredSourceExperiment } from '../experiments/preferredSource' ;
65import type { FEArticle } from '../frontend/feArticle' ;
76import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling' ;
87import {
@@ -13,8 +12,8 @@ import {
1312} from '../lib/articleFormat' ;
1413import { getAudioData } from '../lib/audio-data' ;
1514import { getSoleContributor } from '../lib/byline' ;
16- import { useBetaAB } from '../lib/useAB' ;
1715import { palette as themePalette } from '../palette' ;
16+ import { hasPreferredSourceButton } from '../preferredSource' ;
1817import type { Branding as BrandingType } from '../types/branding' ;
1918import type { FEElement } from '../types/content' ;
2019import type { Podcast , TagType } from '../types/tag' ;
@@ -343,13 +342,8 @@ export const ArticleMeta = ({
343342 mainMediaElements,
344343 crossword,
345344} : Props ) => {
346- const abTests = useBetaAB ( ) ;
347345 const { renderingTarget } = useConfig ( ) ;
348- const preferredSource = preferredSourceExperiment (
349- renderingTarget ,
350- format ,
351- abTests ,
352- ) ;
346+ const preferredSource = hasPreferredSourceButton ( renderingTarget , format ) ;
353347 const soleContributor = getSoleContributor ( tags , byline ) ;
354348 const authorName = soleContributor ?. title ?? 'Author Image' ;
355349
@@ -446,7 +440,7 @@ export const ArticleMeta = ({
446440 < div
447441 data-print-layout = "hide"
448442 css = { metaFlex }
449- style = { preferredSourceMetaFlex ( preferredSource . hasButton ) }
443+ style = { preferredSourceMetaFlex ( preferredSource ) }
450444 >
451445 { renderingTarget === 'Web' && (
452446 < div
@@ -463,9 +457,7 @@ export const ArticleMeta = ({
463457 metaExtrasLiveBlog ,
464458 ) ,
465459 ] }
466- style = { preferredSourceMetaExtras (
467- preferredSource . hasButton ,
468- ) }
460+ style = { preferredSourceMetaExtras ( preferredSource ) }
469461 >
470462 < Island
471463 priority = "feature"
@@ -518,9 +510,7 @@ export const ArticleMeta = ({
518510 </ div >
519511 </ div >
520512 </ div >
521- { preferredSource . hasButton ? (
522- < PreferredSourceButton kind = { preferredSource . kind } />
523- ) : null }
513+ { preferredSource ? < PreferredSourceButton /> : null }
524514 </ div >
525515 </ div >
526516 ) ;
0 commit comments