@@ -6,11 +6,17 @@ import {
66 until ,
77} from '@guardian/source/foundations' ;
88import { Hide , SvgMediaControlsPlay } from '@guardian/source/react-components' ;
9- import { ArticleDesign , type ArticleFormat } from '../lib/articleFormat' ;
9+ import {
10+ ArticleDesign ,
11+ type ArticleFormat ,
12+ ArticleSpecial ,
13+ } from '../lib/articleFormat' ;
1014import { secondsToDuration } from '../lib/formatTime' ;
1115import { getZIndex } from '../lib/getZIndex' ;
16+ import { getOphanComponents } from '../lib/labs' ;
1217import { transparentColour } from '../lib/transparentColour' ;
1318import { palette } from '../palette' ;
19+ import type { Branding } from '../types/branding' ;
1420import type { StarRating as Rating } from '../types/content' ;
1521import type {
1622 AspectRatio ,
@@ -33,6 +39,7 @@ import { FormatBoundary } from './FormatBoundary';
3339import { Island } from './Island' ;
3440import { MediaDuration } from './MediaDuration' ;
3541import { Pill } from './Pill' ;
42+ import { SponsoredContentLabel } from './SponsoredContentLabel' ;
3643import { StarRating } from './StarRating/StarRating' ;
3744import { SupportingContent } from './SupportingContent' ;
3845import { WaveForm } from './WaveForm' ;
@@ -228,6 +235,10 @@ const waveformStyles = css`
228235 opacity : 0.3 ;
229236` ;
230237
238+ const wrapperStyles = css `
239+ padding-top : ${ space [ 3 ] } px;
240+ ` ;
241+
231242const getMedia = ( {
232243 imageUrl,
233244 imageAltText,
@@ -310,7 +321,7 @@ export type Props = {
310321 /** Used for Ophan tracking */
311322 dataLinkName ?: string ;
312323 /** Only used on Labs cards */
313- // branding?: Branding;
324+ branding ?: Branding ;
314325 /** Supporting content refers to sublinks */
315326 supportingContent ?: DCRSupportingContent [ ] ;
316327 containerPalette ?: DCRContainerPalette ;
@@ -357,7 +368,7 @@ export const FeatureCard = ({
357368 kickerText,
358369 showPulsingDot,
359370 dataLinkName,
360- // branding,
371+ branding,
361372 supportingContent,
362373 containerPalette,
363374 discussionApiUrl,
@@ -397,6 +408,15 @@ export const FeatureCard = ({
397408
398409 const showCommentCount = discussionId !== undefined ;
399410
411+ const labsDataAttributes = branding
412+ ? getOphanComponents ( {
413+ branding,
414+ locationPrefix : 'front-card' ,
415+ } )
416+ : undefined ;
417+
418+ const isLabs = format . theme === ArticleSpecial . Labs ;
419+
400420 return (
401421 < FormatBoundary format = { format } >
402422 < ContainerOverrides containerPalette = { containerPalette } >
@@ -671,21 +691,6 @@ export const FeatureCard = ({
671691 />
672692 ) : undefined
673693 }
674- /**TODO: Determine if this is needed */
675- // cardBranding={
676- // branding ? (
677- // <CardBranding
678- // branding={branding}
679- // format={format}
680- // onwardsSource={
681- // onwardsSource
682- // }
683- // containerPalette={
684- // containerPalette
685- // }
686- // />
687- // ) : undefined
688- // }
689694 showLivePlayable = { false }
690695 mainMedia = { mainMedia }
691696 isNewsletter = { isNewsletter }
@@ -732,6 +737,22 @@ export const FeatureCard = ({
732737 fillBackgroundOnMobile = { true }
733738 />
734739 ) }
740+ { isLabs && branding && showLabsRedesign && (
741+ < div css = { wrapperStyles } >
742+ < SponsoredContentLabel
743+ branding = { branding }
744+ containerPalette = { containerPalette }
745+ orientation = "horizontal"
746+ alignment = "end"
747+ ophanComponentLink = {
748+ labsDataAttributes ?. ophanComponentLink
749+ }
750+ ophanComponentName = {
751+ labsDataAttributes ?. ophanComponentName
752+ }
753+ />
754+ </ div >
755+ ) }
735756 </ div >
736757 </ ContainerOverrides >
737758 </ FormatBoundary >
0 commit comments