Skip to content

Commit 3766c46

Browse files
committed
lint
1 parent b67f982 commit 3766c46

File tree

4 files changed

+24
-46
lines changed

4 files changed

+24
-46
lines changed

dotcom-rendering/fixtures/manual/storylinesSectionContent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TPSGContent } from '../../src/types/tagPageAIContent';
1+
import type { TPSGContent } from '../../src/types/tagPageAIContent';
22

33
export const storylinesSectionContent: TPSGContent = {
44
created: '2025-12-09T17:14:47.633244289Z',

dotcom-rendering/src/components/StorylineSection.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import { submitComponentEvent } from '../client/ophan/ophan';
1010
import { type EditionId, isNetworkFront } from '../lib/edition';
1111
import { palette as schemePalette } from '../palette';
1212
import type { CollectionBranding } from '../types/branding';
13-
import type {
14-
DCRContainerLevel,
15-
DCRContainerPalette,
16-
TreatType,
17-
} from '../types/front';
13+
import type { DCRContainerLevel, DCRContainerPalette } from '../types/front';
1814
import { ContainerOverrides } from './ContainerOverrides';
1915
import { ContainerTitle } from './ContainerTitle';
2016
import { Footer } from './ExpandableAtom/Footer';
@@ -61,8 +57,6 @@ type Props = {
6157
showDateHeader?: boolean;
6258
/** Used in partnership with `showDateHeader` to localise the date string */
6359
editionId: EditionId;
64-
/** A list of related links that appear in the bottom of the left column on fronts */
65-
treats?: TreatType[];
6660
collectionBranding?: CollectionBranding;
6761
isTagPage?: boolean;
6862
hasNavigationButtons?: boolean;
@@ -534,7 +528,6 @@ export const StorylineSection = ({
534528
showDateHeader = false,
535529
showTopBorder = true,
536530
toggleable = false,
537-
treats,
538531
url,
539532
collectionBranding,
540533
isTagPage = false,

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

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { css } from '@emotion/react';
2-
import { FlexibleGeneral } from './FlexibleGeneral';
32
import {
43
from,
54
headlineLight50,
@@ -10,14 +9,14 @@ import {
109
textSans20,
1110
textSansBold34,
1211
} from '@guardian/source/foundations';
12+
import { useState } from 'react';
13+
import type { EditionId } from '../lib/edition';
1314
import { parseTPSGContentToStorylines } from '../model/enhanceAITagPageContent';
1415
import { palette } from '../palette';
15-
import { useState } from 'react';
16-
import type { TreatType } from '../types/front';
1716
import type { TPSGContent } from '../types/tagPageAIContent';
17+
import { FlexibleGeneral } from './FlexibleGeneral';
1818
import { ScrollableCarousel } from './ScrollableCarousel';
1919
import { StorylineSection } from './StorylineSection';
20-
import { EditionId } from '../lib/edition';
2120

2221
type StorylinesSectionProps = {
2322
url?: string;
@@ -112,9 +111,9 @@ function formatDateRangeText(
112111
const format = (d?: Date | null) => {
113112
if (!d) return '';
114113
const day = d.getDate();
115-
const suffix = (day: number) => {
116-
if (day > 3 && day < 21) return 'th';
117-
switch (day % 10) {
114+
const suffix = (dayNum: number) => {
115+
if (dayNum > 3 && dayNum < 21) return 'th';
116+
switch (dayNum % 10) {
118117
case 1:
119118
return 'st';
120119
case 2:
@@ -186,16 +185,6 @@ export const StorylinesSection = ({
186185
const activeStoryline = parsedStorylines.find(
187186
(s) => s.id === activeStorylineId,
188187
);
189-
const AITreat: TreatType = {
190-
altText:
191-
'This content has been generated with the assistance of AI technology.',
192-
links: [
193-
{
194-
text: 'This section was curated with AI.',
195-
linkTo: 'https://www.theguardian.com/help/insideguardian/2023/jun/16/the-guardians-approach-to-generative-ai',
196-
},
197-
],
198-
};
199188

200189
/** frontsection with background, title, AI warning on the left,
201190
*
@@ -219,7 +208,6 @@ export const StorylinesSection = ({
219208
toggleable={false} //maybe set to true if this still works?
220209
// pageId={tagPage.pageId}
221210
editionId={editionId}
222-
treats={[AITreat]}
223211
>
224212
{/* Tab selector */}
225213
<div css={tabsContainerStyles}>
@@ -285,24 +273,21 @@ export const StorylinesSection = ({
285273
)}
286274
{/* Tabs content */}
287275
<div css={contentStyles}>
288-
{activeStoryline &&
289-
activeStoryline.categories.map((category, idx) => (
290-
<div key={idx} css={contentCss}>
291-
{category.title !== 'Key Stories' && (
292-
<h2 css={categoryTitleCss}>
293-
{category.title}
294-
</h2>
295-
)}
296-
<FlexibleGeneral
297-
groupedTrails={category.groupedTrails}
298-
imageLoading={'eager'}
299-
aspectRatio={'5:4'}
300-
collectionId={0}
301-
containerLevel="Secondary"
302-
SCStyle={true}
303-
/>
304-
</div>
305-
))}
276+
{activeStoryline?.categories.map((category, idx) => (
277+
<div key={idx} css={contentCss}>
278+
{category.title !== 'Key Stories' && (
279+
<h2 css={categoryTitleCss}>{category.title}</h2>
280+
)}
281+
<FlexibleGeneral
282+
groupedTrails={category.groupedTrails}
283+
imageLoading={'eager'}
284+
aspectRatio={'5:4'}
285+
collectionId={0}
286+
containerLevel="Secondary"
287+
SCStyle={true}
288+
/>
289+
</div>
290+
))}
306291
</div>
307292
<div css={articleCountAndDateRangeStyle}>
308293
{`These storylines were curated from articles published ${formatDateRangeText(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { css } from '@emotion/react';
22
import type { Meta, StoryObj } from '@storybook/react-webpack5';
3-
import { StorylinesSection } from './StorylinesSection.importable';
43
import { storylinesSectionContent } from '../../fixtures/manual/storylinesSectionContent';
4+
import { StorylinesSection } from './StorylinesSection.importable';
55

66
const meta = {
77
component: StorylinesSection,

0 commit comments

Comments
 (0)