Skip to content

Commit 24b7aed

Browse files
committed
tweak insertion check and add age to SC supporting content
1 parent 9e6b575 commit 24b7aed

File tree

5 files changed

+31
-21
lines changed

5 files changed

+31
-21
lines changed

dotcom-rendering/src/components/FeatureCardCardAge.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const FeatureCardCardAge = ({
1515
webPublicationDate,
1616
SCStyle,
1717
}: Props) => {
18-
console.log('FeatureCardCardAge webPublicationDate:', webPublicationDate);
1918
const withinTwelveHours = isWithinTwelveHours(webPublicationDate);
2019
if (withinTwelveHours || SCStyle) {
2120
return (

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ export const StorylinesSection = ({
147147
TPSGContent,
148148
editionId,
149149
}: StorylinesSectionProps) => {
150-
console.log('TPSGContent', TPSGContent);
150+
console.log('has TPSGContent', !!TPSGContent);
151+
// console.log('TPSGContent', TPSGContent);
151152
// const [storylines, SetStorylines] = useState<TPSGContent>();
152153
const storylines = TPSGContent;
153154

dotcom-rendering/src/components/SupportingContent.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ArticleDesign } from '../lib/articleFormat';
44
import { isMediaCard } from '../lib/cardHelpers';
55
import { palette } from '../palette';
66
import type { DCRContainerPalette, DCRSupportingContent } from '../types/front';
7+
import { CardAge } from './Card/components/CardAge';
78
import { CardHeadline } from './CardHeadline';
89
import { ContainerOverrides } from './ContainerOverrides';
910
import { FormatBoundary } from './FormatBoundary';
@@ -207,7 +208,16 @@ export const SupportingContent = ({
207208
mobile: 'medium',
208209
}}
209210
/>
210-
{/* {subLink.kickerText} */}
211+
{/* {subLink.kickerText}
212+
card age below obviously istag page is a lie
213+
*/}
214+
<CardAge
215+
webPublication={{
216+
date: subLink.kickerText ?? '',
217+
isWithinTwelveHours: false,
218+
}}
219+
isTagPage={false}
220+
/>
211221
</ContainerOverrides>
212222
</FormatBoundary>
213223
</li>

dotcom-rendering/src/layouts/TagPageLayout.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@ export const TagPageLayout = ({ tagPage, NAV }: Props) => {
6666
const isAccessibilityPage =
6767
tagPage.config.pageId === 'help/accessibility-help';
6868

69-
const isSCTagPage = process.env.NODE_ENV === 'development';
69+
// const isSCTagPage = process.env.NODE_ENV === 'development';
7070

71-
console.log(
72-
'isSCTagPage:',
73-
isSCTagPage,
74-
'tagPage.webURL:',
75-
tagPage.webURL,
76-
'isDev:', //isDev doesn't actually work?
77-
tagPage.config.isDev,
78-
'is node env',
79-
process.env.NODE_ENV,
80-
);
71+
// console.log(
72+
// 'isSCTagPage:',
73+
// isSCTagPage,
74+
// 'tagPage.webURL:',
75+
// tagPage.webURL,
76+
// 'isDev:', //isDev doesn't actually work?
77+
// tagPage.config.isDev,
78+
// 'is node env',
79+
// process.env.NODE_ENV,
80+
// );
8181

8282
console.log('has tagPage.TPSGContent:', !!tagPage.TagPageAIContent);
8383
console.log('tagPage.TPSGContent:', tagPage.TagPageAIContent);
@@ -153,8 +153,8 @@ export const TagPageLayout = ({ tagPage, NAV }: Props) => {
153153
: undefined;
154154

155155
const insertSCSection =
156-
// tagPage.TPSGContent &&
157-
isSCTagPage &&
156+
tagPage.TagPageAIContent &&
157+
// isSCTagPage &&
158158
index == 1 &&
159159
(!tagPage.pagination ||
160160
tagPage.pagination.currentPage === 1);

dotcom-rendering/src/model/enhanceAITagPageContent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { timeAgo } from '@guardian/libs';
1+
// import { timeAgo } from '@guardian/libs';
22
import type { DCRFrontCard, DCRGroupedTrails } from '../types/front';
33
import type {
44
ArticleData,
@@ -93,13 +93,13 @@ function parseArticleDataToFrontCard(
9393

9494
function parseKeyStoriesToFrontCard(category: CategoryContent): DCRFrontCard {
9595
const supportingContent = category.articles.slice(1, 5).map((article) => {
96-
const articleAge =
97-
article.publicationTime &&
98-
timeAgo(new Date(article.publicationTime).getTime()).toString();
96+
// const articleAge =
97+
// article.publicationTime &&
98+
// timeAgo(new Date(article.publicationTime).getTime()).toString();
9999
return {
100100
headline: article.headline,
101101
url: article.url,
102-
kickerText: articleAge,
102+
kickerText: article.publicationTime,
103103
format: { design: 0, display: 0, theme: 0 },
104104
};
105105
});

0 commit comments

Comments
 (0)