@@ -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,12 +342,10 @@ export const ArticleMeta = ({
343342 mainMediaElements,
344343 crossword,
345344} : Props ) => {
346- const abTests = useBetaAB ( ) ;
347345 const { renderingTarget } = useConfig ( ) ;
348- const preferredSource = preferredSourceExperiment (
346+ const showPreferredSource = hasPreferredSourceButton (
349347 renderingTarget ,
350348 format ,
351- abTests ,
352349 ) ;
353350 const soleContributor = getSoleContributor ( tags , byline ) ;
354351 const authorName = soleContributor ?. title ?? 'Author Image' ;
@@ -446,7 +443,7 @@ export const ArticleMeta = ({
446443 < div
447444 data-print-layout = "hide"
448445 css = { metaFlex }
449- style = { preferredSourceMetaFlex ( preferredSource . hasButton ) }
446+ style = { preferredSourceMetaFlex ( showPreferredSource ) }
450447 >
451448 { renderingTarget === 'Web' && (
452449 < div
@@ -464,7 +461,7 @@ export const ArticleMeta = ({
464461 ) ,
465462 ] }
466463 style = { preferredSourceMetaExtras (
467- preferredSource . hasButton ,
464+ showPreferredSource ,
468465 ) }
469466 >
470467 < Island
@@ -518,9 +515,7 @@ export const ArticleMeta = ({
518515 </ div >
519516 </ div >
520517 </ div >
521- { preferredSource . hasButton ? (
522- < PreferredSourceButton kind = { preferredSource . kind } />
523- ) : null }
518+ { showPreferredSource ? < PreferredSourceButton /> : null }
524519 </ div >
525520 </ div >
526521 ) ;
0 commit comments