Skip to content

Commit da60169

Browse files
committed
tweak opinion/media articles and add date
1 parent cdf3568 commit da60169

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ export const Card = ({
423423
subtitleSize = 'small',
424424
SCStyle = false,
425425
}: Props) => {
426-
console.log('article headline, mainMedia:', headlineText, mainMedia);
427-
428426
const hasSublinks = supportingContent && supportingContent.length > 0;
429427
const sublinkPosition = decideSublinkPosition(
430428
supportingContent,
@@ -465,7 +463,10 @@ export const Card = ({
465463
const withinTwelveHours = isWithinTwelveHours(webPublicationDate);
466464

467465
const shouldShowAge =
468-
isTagPage || !!onwardsSource || (showAge && withinTwelveHours);
466+
SCStyle ||
467+
isTagPage ||
468+
!!onwardsSource ||
469+
(showAge && withinTwelveHours);
469470

470471
if (!shouldShowAge) return undefined;
471472

@@ -708,8 +709,6 @@ export const Card = ({
708709
if (!hasSublinks) return null;
709710
if (sublinkPosition === 'none') return null;
710711

711-
console.log('supportingContent:', supportingContent);
712-
713712
const Sublinks = () => (
714713
<SupportingContent
715714
supportingContent={supportingContent}

dotcom-rendering/src/components/FlexibleGeneral.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ type FullWidthCardLayoutProps = {
430430
collectionId: number;
431431
/** Feature flag for the labs redesign work */
432432
showLabsRedesign?: boolean;
433+
SCStyle?: boolean;
433434
};
434435

435436
const FullWidthCardLayout = ({
@@ -444,6 +445,7 @@ const FullWidthCardLayout = ({
444445
containerLevel,
445446
collectionId,
446447
showLabsRedesign,
448+
SCStyle,
447449
}: FullWidthCardLayoutProps) => {
448450
const card = cards[0];
449451
if (!card) return null;
@@ -520,6 +522,7 @@ const FullWidthCardLayout = ({
520522
showKickerImage={card.format.design === ArticleDesign.Audio}
521523
showLabsRedesign={showLabsRedesign}
522524
subtitleSize={subtitleSize}
525+
SCStyle={SCStyle}
523526
/>
524527
</LI>
525528
</UL>
@@ -539,6 +542,7 @@ type HalfWidthCardLayoutProps = {
539542
containerLevel: DCRContainerLevel;
540543
/** Feature flag for the labs redesign work */
541544
showLabsRedesign?: boolean;
545+
SCStyle?: boolean;
542546
};
543547

544548
const HalfWidthCardLayout = ({
@@ -553,6 +557,7 @@ const HalfWidthCardLayout = ({
553557
isLastRow,
554558
containerLevel,
555559
showLabsRedesign,
560+
SCStyle,
556561
}: HalfWidthCardLayoutProps) => {
557562
if (cards.length === 0) return null;
558563

@@ -608,6 +613,7 @@ const HalfWidthCardLayout = ({
608613
headlineSizes={undefined}
609614
canPlayInline={false}
610615
showLabsRedesign={showLabsRedesign}
616+
SCStyle={SCStyle}
611617
/>
612618
</LI>
613619
);
@@ -680,6 +686,7 @@ export const FlexibleGeneral = ({
680686
containerLevel={containerLevel}
681687
collectionId={collectionId}
682688
showLabsRedesign={showLabsRedesign}
689+
SCStyle={SCStyle}
683690
/>
684691
);
685692

@@ -700,6 +707,7 @@ export const FlexibleGeneral = ({
700707
isLastRow={i === groupedCards.length - 1}
701708
containerLevel={containerLevel}
702709
showLabsRedesign={showLabsRedesign}
710+
SCStyle={SCStyle}
703711
/>
704712
);
705713
}

dotcom-rendering/src/components/StorylinesSection.importable.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type StorylinesSectionProps = {
4242
type ImageData = {
4343
src: string;
4444
altText: string;
45+
isAvatar: boolean;
4546
mediaData: MainMedia | null;
4647
};
4748

@@ -941,11 +942,6 @@ export const StorylinesSection = ({
941942
article: ArticleData,
942943
): DCRFrontCard {
943944
const format = decideFormatForArticle(category);
944-
console.log(
945-
'article headline and mediaData here',
946-
article.headline,
947-
article.image?.mediaData,
948-
);
949945
return {
950946
format: format,
951947
dataLinkName: '',
@@ -958,7 +954,7 @@ export const StorylinesSection = ({
958954
'https://discussion.theguardian.com/discussion-api',
959955
byline: article.byline || '',
960956
showByline:
961-
category.category === 'Contrasting Opinions' ? true : false, // could be true if opinion?
957+
category.category === 'Contrasting opinions' ? true : false, // could be true if opinion?
962958
boostLevel:
963959
category.category === 'Profiles and Interviews' ||
964960
category.category === 'Deep Reads'
@@ -971,12 +967,16 @@ export const StorylinesSection = ({
971967
: false, //would be true for profiles/deep reads?
972968
showQuotedHeadline: false,
973969
showLivePlayable: false,
974-
avatarUrl: undefined, // will need to be set for opinion pieces
970+
avatarUrl:
971+
category.category === 'Contrasting opinions' &&
972+
article.image?.isAvatar
973+
? article.image?.src
974+
: undefined, // will need to be set for opinion pieces
975975
// mainMedia: undefined, // ought to be set for multimedia pieces, but missing the extra info like count?
976976
mainMedia:
977977
category.category === 'Find multimedia' &&
978978
article.image?.mediaData
979-
? article.image.mediaData
979+
? article.image?.mediaData
980980
: undefined,
981981
isExternalLink: false,
982982
image: article.image

0 commit comments

Comments
 (0)