From ffd581b44213a53b7ec8d436b56579c4ef78f23f Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:40:04 +0000 Subject: [PATCH 1/5] Add DateTime context provider --- .../src/components/DateTimeContext.tsx | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dotcom-rendering/src/components/DateTimeContext.tsx diff --git a/dotcom-rendering/src/components/DateTimeContext.tsx b/dotcom-rendering/src/components/DateTimeContext.tsx new file mode 100644 index 00000000000..7afe71f6568 --- /dev/null +++ b/dotcom-rendering/src/components/DateTimeContext.tsx @@ -0,0 +1,42 @@ +import { isUndefined } from '@guardian/libs'; +import { createContext, useContext } from 'react'; + +/** + * Context to store current date and time when page is rendered on server. + * + * It is deliberately set with a default value of `undefined` to better + * surface errors relating to incorrect usage and is not exported. + * + * @see https://kentcdodds.com/blog/how-to-use-react-context-effectively + */ +const DateTimeContext = createContext(undefined); + +/** + * DateTimeProvider should be included at a high level to ensure child + * components can access the current date and time + */ +export const DateTimeProvider = ({ + value, + children, +}: { + value: number | undefined; + children: React.ReactNode; +}) => ( + + {children} + +); + +/** + * Hook to safely fetch current date and time from context and ensure it is + * used correctly within an instance of `DateTimeProvider` + */ +export const useDateTime = () => { + const context = useContext(DateTimeContext); + + if (isUndefined(context)) { + throw Error('useDateTime must be used within DateTimeProvider'); + } + + return context; +}; From 75dd838717ccec40d6e9d275b296ac24d4e180fd Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:55:40 +0000 Subject: [PATCH 2/5] Add DateTime context to render methods --- ...render.allEditorialNewslettersPage.web.tsx | 13 ++-- .../src/server/render.article.apps.tsx | 63 ++++++++++------- .../src/server/render.article.web.tsx | 68 +++++++++++-------- .../src/server/render.front.web.tsx | 13 +++- .../src/server/render.sportDataPage.web.tsx | 6 +- 5 files changed, 100 insertions(+), 63 deletions(-) diff --git a/dotcom-rendering/src/server/render.allEditorialNewslettersPage.web.tsx b/dotcom-rendering/src/server/render.allEditorialNewslettersPage.web.tsx index 56e53b97f96..94817e065f4 100644 --- a/dotcom-rendering/src/server/render.allEditorialNewslettersPage.web.tsx +++ b/dotcom-rendering/src/server/render.allEditorialNewslettersPage.web.tsx @@ -1,5 +1,6 @@ import { AllEditorialNewslettersPage } from '../components/AllEditorialNewslettersPage'; import { ConfigProvider } from '../components/ConfigContext'; +import { DateTimeProvider } from '../components/DateTimeContext'; import { ASSET_ORIGIN, generateScriptTags, @@ -32,12 +33,16 @@ export const renderEditorialNewslettersPage = ({ editionId: newslettersPage.editionId, } satisfies Config; + const serverTime = Date.now(); + const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); diff --git a/dotcom-rendering/src/server/render.article.apps.tsx b/dotcom-rendering/src/server/render.article.apps.tsx index 478bf3ea8dc..8abdeed4abe 100644 --- a/dotcom-rendering/src/server/render.article.apps.tsx +++ b/dotcom-rendering/src/server/render.article.apps.tsx @@ -1,6 +1,7 @@ import { isString } from '@guardian/libs'; import { ArticlePage } from '../components/ArticlePage'; import { ConfigProvider } from '../components/ConfigContext'; +import { DateTimeProvider } from '../components/DateTimeContext'; import { LiveBlogRenderer } from '../components/LiveBlogRenderer'; import { ArticleDesign, @@ -36,10 +37,16 @@ export const renderArticle = ( assetOrigin: ASSET_ORIGIN, editionId: frontendData.editionId, }; + const serverTime = Date.now(); const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); @@ -171,33 +178,37 @@ export const renderAppsBlocks = ({ editionId, }; + const serverTime = Date.now(); + const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); diff --git a/dotcom-rendering/src/server/render.article.web.tsx b/dotcom-rendering/src/server/render.article.web.tsx index ddb80b357fc..8a6a25c6059 100644 --- a/dotcom-rendering/src/server/render.article.web.tsx +++ b/dotcom-rendering/src/server/render.article.web.tsx @@ -1,6 +1,7 @@ import { isString } from '@guardian/libs'; import { ArticlePage } from '../components/ArticlePage'; import { ConfigProvider } from '../components/ConfigContext'; +import { DateTimeProvider } from '../components/DateTimeContext'; import { LiveBlogRenderer } from '../components/LiveBlogRenderer'; import { ArticleDesign, @@ -58,14 +59,17 @@ export const renderHtml = ({ assetOrigin: ASSET_ORIGIN, editionId: frontendData.editionId, }; + const serverTime = Date.now(); const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); @@ -246,33 +250,37 @@ export const renderBlocks = ({ editionId, }; + const serverTime = Date.now(); + const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); diff --git a/dotcom-rendering/src/server/render.front.web.tsx b/dotcom-rendering/src/server/render.front.web.tsx index 5364a83eceb..1d6a2fb0d7f 100644 --- a/dotcom-rendering/src/server/render.front.web.tsx +++ b/dotcom-rendering/src/server/render.front.web.tsx @@ -1,5 +1,6 @@ import { isString } from '@guardian/libs'; import { ConfigProvider } from '../components/ConfigContext'; +import { DateTimeProvider } from '../components/DateTimeContext'; import { FrontPage } from '../components/FrontPage'; import { TagPage } from '../components/TagPage'; import { Pillar } from '../lib/articleFormat'; @@ -92,9 +93,13 @@ export const renderFront = ({ editionId: front.editionId, } satisfies Config; + const serverTime = Date.now(); + const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); @@ -191,9 +196,13 @@ export const renderTagPage = ({ editionId: tagPage.editionId, }; + const serverTime = Date.now(); + const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); diff --git a/dotcom-rendering/src/server/render.sportDataPage.web.tsx b/dotcom-rendering/src/server/render.sportDataPage.web.tsx index 8f98adfc8cd..e3682d7535c 100644 --- a/dotcom-rendering/src/server/render.sportDataPage.web.tsx +++ b/dotcom-rendering/src/server/render.sportDataPage.web.tsx @@ -1,5 +1,6 @@ import { isString } from '@guardian/libs'; import { ConfigProvider } from '../components/ConfigContext'; +import { DateTimeProvider } from '../components/DateTimeContext'; import { SportDataPageComponent } from '../components/SportDataPageComponent'; import type { FootballMatch } from '../footballMatch'; import { @@ -106,13 +107,16 @@ export const renderSportPage = (sportData: SportDataPage) => { assetOrigin: ASSET_ORIGIN, editionId: sportData.editionId, }; + const serverTime = Date.now(); const title = decideTitle(sportData); const description = decideDescription(sportData.kind); const { html, extractedCss } = renderToStringWithEmotion( - + + + , ); From 9f579761d8c3294f48d6822a6fb5ceea04cc811a Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Fri, 9 Jan 2026 16:46:38 +0000 Subject: [PATCH 3/5] Pass DateTime context to islands when hydrating --- dotcom-rendering/src/client/discussion.ts | 11 ++++++++++- .../src/client/islands/doHydration.tsx | 19 ++++++++++++------- .../src/client/islands/getDateTime.ts | 10 ++++++++++ .../src/client/islands/initHydration.ts | 12 +++++++++++- dotcom-rendering/src/components/Island.tsx | 8 ++++++++ 5 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 dotcom-rendering/src/client/islands/getDateTime.ts diff --git a/dotcom-rendering/src/client/discussion.ts b/dotcom-rendering/src/client/discussion.ts index 26521cbdce0..c837eafa36d 100644 --- a/dotcom-rendering/src/client/discussion.ts +++ b/dotcom-rendering/src/client/discussion.ts @@ -1,6 +1,7 @@ import { doHydration } from './islands/doHydration'; import { getEmotionCache } from './islands/emotion'; import { getConfig } from './islands/getConfig'; +import { getDateTime } from './islands/getDateTime'; import { getName } from './islands/getName'; import { getProps } from './islands/getProps'; @@ -21,12 +22,20 @@ const forceHydration = async (): Promise => { // Read the props and config from where they have been serialised in the dom using an Island const props = getProps(guElement); const config = getConfig(); + const dateTime = getDateTime(guElement); // Now that we have the props as an object, tell Discussion we want it to expand itself props.expanded = true; // Force hydration - await doHydration(name, props, guElement, getEmotionCache(), config); + await doHydration( + name, + props, + guElement, + getEmotionCache(), + config, + dateTime, + ); } catch (err) { // Do nothing } diff --git a/dotcom-rendering/src/client/islands/doHydration.tsx b/dotcom-rendering/src/client/islands/doHydration.tsx index b6bcabb1e4f..96b4310abd4 100644 --- a/dotcom-rendering/src/client/islands/doHydration.tsx +++ b/dotcom-rendering/src/client/islands/doHydration.tsx @@ -5,6 +5,7 @@ import { isUndefined, log, startPerformanceMeasure } from '@guardian/libs'; import { createElement } from 'react'; import { hydrateRoot } from 'react-dom/client'; import { ConfigProvider } from '../../components/ConfigContext'; +import { DateTimeProvider } from '../../components/DateTimeContext'; import { IslandProvider } from '../../components/IslandContext'; import type { Config } from '../../types/configContext'; @@ -30,6 +31,7 @@ declare global { * @param element The location on the DOM where the component to hydrate exists * @param emotionCache An instance of an emotion cache to use for the island * @param config Application configuration to be passed to the config context for the hydrated component + * @param dateTime Datetime value to be passed to DateTime context for the hydrated component */ export const doHydration = async ( name: string, @@ -37,6 +39,7 @@ export const doHydration = async ( element: HTMLElement, emotionCache: EmotionCache, config: Config, + dateTime?: number, ): Promise => { // If this function has already been run for an element then don't try to // run it a second time @@ -61,13 +64,15 @@ export const doHydration = async ( hydrateRoot( element, - - {/* Child islands should not be hydrated separately */} - - {/* The component to hydrate must be a single JSX Element */} - {createElement(module[name], data)} - - + + + {/* Child islands should not be hydrated separately */} + + {/* The component to hydrate must be a single JSX Element */} + {createElement(module[name], data)} + + + , ); diff --git a/dotcom-rendering/src/client/islands/getDateTime.ts b/dotcom-rendering/src/client/islands/getDateTime.ts new file mode 100644 index 00000000000..6a3c97ecc8f --- /dev/null +++ b/dotcom-rendering/src/client/islands/getDateTime.ts @@ -0,0 +1,10 @@ +/** + * Returns `datetime` attribute from given HTML element. + * + * We expect the element to always be a `gu-*` custom element + */ +export const getDateTime = (marker: HTMLElement): number | undefined => { + const dateTime = marker.getAttribute('datetime'); + if (dateTime) return parseInt(dateTime); + return; +}; diff --git a/dotcom-rendering/src/client/islands/initHydration.ts b/dotcom-rendering/src/client/islands/initHydration.ts index bfe49460b3b..ff2e37b1d01 100644 --- a/dotcom-rendering/src/client/islands/initHydration.ts +++ b/dotcom-rendering/src/client/islands/initHydration.ts @@ -3,6 +3,7 @@ import { isUndefined } from '@guardian/libs'; import { schedule } from '../../lib/scheduler'; import { doHydration } from './doHydration'; import { getConfig } from './getConfig'; +import { getDateTime } from './getDateTime'; import { getName } from './getName'; import { getPriority } from './getPriority'; import { getProps } from './getProps'; @@ -41,6 +42,7 @@ export const initHydration = async ( const props = getProps(element); const config = getConfig(); const priority = getPriority(element); + const dateTime = getDateTime(element); if (!name) return; if (isUndefined(priority)) return; @@ -48,7 +50,15 @@ export const initHydration = async ( const scheduleHydration = () => schedule( name, - () => doHydration(name, props, element, emotionCache, config), + () => + doHydration( + name, + props, + element, + emotionCache, + config, + dateTime, + ), { priority }, ); diff --git a/dotcom-rendering/src/components/Island.tsx b/dotcom-rendering/src/components/Island.tsx index 932c107816d..03b3064987b 100644 --- a/dotcom-rendering/src/components/Island.tsx +++ b/dotcom-rendering/src/components/Island.tsx @@ -1,5 +1,6 @@ import { useContext } from 'react'; import type { ScheduleOptions, SchedulePriority } from '../lib/scheduler'; +import { useDateTime } from './DateTimeContext'; import { IslandContext, IslandProvider } from './IslandContext'; type DeferredProps = { @@ -62,6 +63,11 @@ export const Island = ({ priority, defer, children, role }: IslandProps) => { */ const island = useContext(IslandContext); + /** + * Datetime from server render + */ + const dateTime = useDateTime(); + return ( {/* Child islands defer to nearest parent island for hydration */} @@ -74,6 +80,7 @@ export const Island = ({ priority, defer, children, role }: IslandProps) => { deferUntil={defer?.until} props={JSON.stringify(children.props)} rootMargin={rootMargin} + dateTime={dateTime} data-spacefinder-role={role} > {children} @@ -92,6 +99,7 @@ export type GuIsland = { priority: ScheduleOptions['priority']; deferUntil?: NonNullable['until']; rootMargin?: string; + dateTime?: number; props: string; children: React.ReactNode; }; From 55326a5a01abbdd5a53eee4238ef2b2f473a766d Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Fri, 9 Jan 2026 17:38:02 +0000 Subject: [PATCH 4/5] Remove serverTime prop and fetch from context instead --- .../src/components/ArticleBody.tsx | 3 - dotcom-rendering/src/components/Card/Card.tsx | 5 -- .../components/Card/components/CardAge.tsx | 3 - .../src/components/Carousel.importable.tsx | 6 -- dotcom-rendering/src/components/DateTime.tsx | 13 ++--- .../src/components/DecideContainer.tsx | 26 --------- .../src/components/DynamicFast.tsx | 39 ------------- .../src/components/DynamicPackage.tsx | 56 ------------------- .../src/components/DynamicSlow.tsx | 17 ------ .../src/components/FeatureCard.tsx | 4 -- .../src/components/FeatureCardCardAge.tsx | 3 - .../FetchMoreGalleriesData.importable.tsx | 3 - .../FetchOnwardsData.importable.tsx | 4 -- .../src/components/FirstPublished.tsx | 3 - .../src/components/FixedLargeSlowXIV.tsx | 6 -- .../src/components/FixedMediumFastXI.tsx | 4 -- .../src/components/FixedMediumFastXII.tsx | 4 -- .../src/components/FixedMediumSlowVI.tsx | 5 -- .../src/components/FixedMediumSlowVII.tsx | 5 -- .../src/components/FixedMediumSlowXIIMPU.tsx | 14 ----- .../src/components/FixedSmallFastVIII.tsx | 4 -- .../src/components/FixedSmallSlowI.tsx | 3 - .../src/components/FixedSmallSlowIII.tsx | 4 -- .../src/components/FixedSmallSlowIV.tsx | 3 - .../src/components/FixedSmallSlowVHalf.tsx | 4 -- .../src/components/FixedSmallSlowVMPU.tsx | 3 - .../src/components/FixedSmallSlowVThird.tsx | 4 -- .../src/components/FlexibleGeneral.tsx | 19 ------- .../src/components/FlexibleSpecial.tsx | 11 ---- dotcom-rendering/src/components/FrontCard.tsx | 4 +- .../src/components/KeyEventCard.tsx | 3 - .../KeyEventsCarousel.importable.tsx | 3 - .../src/components/LatestLinks.importable.tsx | 3 - dotcom-rendering/src/components/LiveBlock.tsx | 3 - .../src/components/LiveBlockContainer.tsx | 3 - .../components/LiveBlogBlocksAndAdverts.tsx | 3 - .../src/components/LiveBlogRenderer.tsx | 7 +-- .../src/components/MoreGalleries.tsx | 5 -- .../components/OnwardsUpper.importable.tsx | 4 -- .../PersonalisedMediumFour.importable.tsx | 3 - .../src/components/PinnedPost.tsx | 4 +- .../ScrollableFeature.importable.tsx | 3 - .../ScrollableMedium.importable.tsx | 3 - .../components/ScrollableSmall.importable.tsx | 3 - .../ScrollableSmallOnwards.stories.tsx | 1 - .../src/components/ScrollableSmallOnwards.tsx | 4 -- .../src/components/StaticFeatureTwo.tsx | 3 - .../src/components/StaticMediumFour.tsx | 3 - .../components/YoutubeAtom/YoutubeAtom.tsx | 3 - .../YoutubeAtomFeatureCardOverlay.tsx | 7 +-- .../YoutubeBlockComponent.importable.tsx | 3 - dotcom-rendering/src/layouts/AudioLayout.tsx | 5 +- .../src/layouts/CommentLayout.tsx | 5 +- dotcom-rendering/src/layouts/DecideLayout.tsx | 26 --------- dotcom-rendering/src/layouts/FrontLayout.tsx | 4 -- .../src/layouts/GalleryLayout.tsx | 6 +- .../src/layouts/ImmersiveLayout.tsx | 5 +- .../src/layouts/InteractiveLayout.tsx | 5 +- dotcom-rendering/src/layouts/LiveLayout.tsx | 7 +-- .../src/layouts/NewsletterSignupLayout.tsx | 4 -- .../src/layouts/PictureLayout.tsx | 5 +- .../src/layouts/ShowcaseLayout.tsx | 5 +- .../src/layouts/StandardLayout.tsx | 5 +- dotcom-rendering/src/lib/cardWrappers.tsx | 41 -------------- dotcom-rendering/src/lib/dynamicSlices.tsx | 28 ---------- .../src/server/handler.front.web.ts | 3 - dotcom-rendering/src/types/article.ts | 5 -- dotcom-rendering/src/types/front.ts | 2 - 68 files changed, 20 insertions(+), 497 deletions(-) diff --git a/dotcom-rendering/src/components/ArticleBody.tsx b/dotcom-rendering/src/components/ArticleBody.tsx index 25d010855aa..355a7055b38 100644 --- a/dotcom-rendering/src/components/ArticleBody.tsx +++ b/dotcom-rendering/src/components/ArticleBody.tsx @@ -54,7 +54,6 @@ type Props = { lang?: string; isRightToLeftLang?: boolean; shouldHideAds: boolean; - serverTime?: number; idApiUrl?: string; }; @@ -139,7 +138,6 @@ export const ArticleBody = ({ isRightToLeftLang = false, editionId, shouldHideAds, - serverTime, idApiUrl, }: Props) => { const isInteractiveContent = @@ -209,7 +207,6 @@ export const ArticleBody = ({ keywordIds={keywordIds} editionId={editionId} shouldHideAds={shouldHideAds} - serverTime={serverTime} idApiUrl={idApiUrl} /> diff --git a/dotcom-rendering/src/components/Card/Card.tsx b/dotcom-rendering/src/components/Card/Card.tsx index 6f1bcb1e359..253cf437ae3 100644 --- a/dotcom-rendering/src/components/Card/Card.tsx +++ b/dotcom-rendering/src/components/Card/Card.tsx @@ -76,7 +76,6 @@ export type Props = { format: ArticleFormat; /** The format of the article holding the card */ contextFormat?: ArticleFormat; - serverTime?: number; headlineText: string; headlineSizes?: ResponsiveFontSize; showQuotedHeadline?: boolean; @@ -383,7 +382,6 @@ export const Card = ({ liveUpdatesPosition = 'inner', onwardsSource, showVideo = true, - serverTime, isTagPage = false, aspectRatio, index = 0, @@ -444,7 +442,6 @@ export const Card = ({ isWithinTwelveHours: withinTwelveHours, }} showClock={showClock} - serverTime={serverTime} isTagPage={isTagPage} /> ); @@ -1244,7 +1241,6 @@ export const Card = ({ : supportingContentAlignment } containerPalette={containerPalette} - serverTime={serverTime} displayHeader={isFlexibleContainer} directionOnMobile={ isFlexibleContainer @@ -1303,7 +1299,6 @@ export const Card = ({ : supportingContentAlignment } containerPalette={containerPalette} - serverTime={serverTime} displayHeader={isFlexibleContainer} directionOnMobile={'horizontal'} > diff --git a/dotcom-rendering/src/components/Card/components/CardAge.tsx b/dotcom-rendering/src/components/Card/components/CardAge.tsx index 95496cec509..09b59e7ab73 100644 --- a/dotcom-rendering/src/components/Card/components/CardAge.tsx +++ b/dotcom-rendering/src/components/Card/components/CardAge.tsx @@ -22,7 +22,6 @@ const ageStyles = (colour: string) => { }; type Props = { - serverTime?: number; webPublication: { date: string; isWithinTwelveHours: boolean; @@ -34,7 +33,6 @@ type Props = { }; export const CardAge = ({ - serverTime, webPublication, isTagPage, showClock, @@ -60,7 +58,6 @@ export const CardAge = ({ { @@ -527,7 +524,6 @@ const CarouselCard = ({ isOnwardContent={isOnwardContent} mediaPositionOnDesktop={cardImagePosition} mediaPositionOnMobile={cardImagePosition} - serverTime={serverTime} starRating={starRating} index={index} showTopBarDesktop={!isOnwardContent} @@ -751,7 +747,6 @@ export const Carousel = ({ leftColSize, discussionApiUrl, isOnwardContent = true, - serverTime, renderingTarget, ...props }: ArticleProps | FrontProps) => { @@ -973,7 +968,6 @@ export const Carousel = ({ linkTo={linkTo} headlineText={headlineText} webPublicationDate={webPublicationDate} - serverTime={serverTime} image={image} kickerText={kickerText} dataLinkName={`carousel-small-card-position-${i}`} diff --git a/dotcom-rendering/src/components/DateTime.tsx b/dotcom-rendering/src/components/DateTime.tsx index e7c7ed755f4..247910930f8 100644 --- a/dotcom-rendering/src/components/DateTime.tsx +++ b/dotcom-rendering/src/components/DateTime.tsx @@ -1,6 +1,7 @@ -import { isString, isUndefined } from '@guardian/libs'; +import { isString } from '@guardian/libs'; import { getEditionFromId } from '../lib/edition'; import { useConfig } from './ConfigContext'; +import { useDateTime } from './DateTimeContext'; import { Island } from './Island'; import { RelativeTime } from './RelativeTime.importable'; @@ -14,11 +15,9 @@ type Props = { type DisplayProps = | { display?: 'absolute'; - serverTime?: never; } | { display: 'relative'; - serverTime?: number; }; const formatWeekday = (date: Date, locale: string, timeZone: string) => @@ -57,10 +56,10 @@ export const DateTime = ({ showDate, showTime, display = 'absolute', - serverTime, }: Props & DisplayProps) => { const { editionId } = useConfig(); const { dateLocale, timeZone } = getEditionFromId(editionId); + const serverTime = useDateTime(); /** * Server time (if set) is rounded down to the previous minute to ensure @@ -70,9 +69,9 @@ export const DateTime = ({ * * [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date */ - const now = isUndefined(serverTime) - ? MAX_DATE - : Math.floor(serverTime / ONE_MINUTE) * ONE_MINUTE; + const now = serverTime + ? Math.floor(serverTime / ONE_MINUTE) * ONE_MINUTE + : MAX_DATE; const then = date.getTime(); return display === 'relative' ? ( diff --git a/dotcom-rendering/src/components/DecideContainer.tsx b/dotcom-rendering/src/components/DecideContainer.tsx index 65dce96b362..232e43ba890 100644 --- a/dotcom-rendering/src/components/DecideContainer.tsx +++ b/dotcom-rendering/src/components/DecideContainer.tsx @@ -43,7 +43,6 @@ type Props = { containerType: DCRContainerType; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; aspectRatio: AspectRatio; sectionId: string; frontId?: string; @@ -58,7 +57,6 @@ export const DecideContainer = ({ containerType, containerPalette, showAge, - serverTime, imageLoading, aspectRatio, sectionId, @@ -74,7 +72,6 @@ export const DecideContainer = ({ groupedTrails={groupedTrails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -84,7 +81,6 @@ export const DecideContainer = ({ groupedTrails={groupedTrails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -94,7 +90,6 @@ export const DecideContainer = ({ groupedTrails={groupedTrails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -104,7 +99,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -114,7 +108,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -124,7 +117,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -134,7 +126,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -144,7 +135,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -154,7 +144,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -164,7 +153,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -174,7 +162,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -184,7 +171,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -194,7 +180,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -204,7 +189,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -214,7 +198,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -224,7 +207,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ); @@ -244,7 +226,6 @@ export const DecideContainer = ({ groupedTrails={groupedTrails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} aspectRatio={aspectRatio} collectionId={collectionId} @@ -256,7 +237,6 @@ export const DecideContainer = ({ groupedTrails={groupedTrails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} aspectRatio={aspectRatio} containerLevel={containerLevel} @@ -271,7 +251,6 @@ export const DecideContainer = ({ imageLoading={imageLoading} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} aspectRatio={aspectRatio} sectionId={sectionId} /> @@ -285,7 +264,6 @@ export const DecideContainer = ({ imageLoading={imageLoading} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} aspectRatio={aspectRatio} sectionId={sectionId} /> @@ -299,7 +277,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} aspectRatio={aspectRatio} pillarBuckets={pillarBuckets} @@ -312,7 +289,6 @@ export const DecideContainer = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} aspectRatio={aspectRatio} /> @@ -324,7 +300,6 @@ export const DecideContainer = ({ trails={trails} imageLoading={imageLoading} containerPalette={containerPalette} - serverTime={serverTime} aspectRatio={aspectRatio} collectionId={collectionId} /> @@ -335,7 +310,6 @@ export const DecideContainer = ({ { if (!cards[0]) return null; @@ -71,7 +68,6 @@ const Card50_ColumnOfThreeCards25_ColumnOfFiveCards = ({ trail={big} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -90,7 +86,6 @@ const Card50_ColumnOfThreeCards25_ColumnOfFiveCards = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ) : ( @@ -98,7 +93,6 @@ const Card50_ColumnOfThreeCards25_ColumnOfFiveCards = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> )} @@ -119,7 +113,6 @@ const Card50_ColumnOfThreeCards25_ColumnOfFiveCards = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); @@ -133,14 +126,12 @@ const Card50_ColumnOfThreeCards25_ColumnOfFiveCards = ({ const Card50_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ cards, showAge, - serverTime, containerPalette, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { if (!cards[0]) return null; @@ -154,7 +145,6 @@ const Card50_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ trail={big} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -180,7 +170,6 @@ const Card50_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); @@ -195,12 +184,10 @@ const ColumnOfThreeCards25_ColumnOfThreeCards25_ColumnOfThreeCards25_ColumnOfThr ({ cards, showAge, - serverTime, containerPalette, }: { cards: DCRFrontCard[]; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { if (cards.length === 0) return null; @@ -226,7 +213,6 @@ const ColumnOfThreeCards25_ColumnOfThreeCards25_ColumnOfThreeCards25_ColumnOfThr trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); @@ -238,14 +224,12 @@ const ColumnOfThreeCards25_ColumnOfThreeCards25_ColumnOfThreeCards25_ColumnOfThr const Card25_ColumnOfCards25_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ cards, showAge, - serverTime, containerPalette, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { if (!cards[0]) return null; @@ -259,7 +243,6 @@ const Card25_ColumnOfCards25_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ trail={big} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -285,7 +268,6 @@ const Card25_ColumnOfCards25_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); @@ -301,12 +283,10 @@ const Card25_Card25_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ showAge, containerPalette, imageLoading, - serverTime, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { if (cards.length < 0) return null; @@ -328,7 +308,6 @@ const Card25_Card25_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -357,7 +336,6 @@ const Card25_Card25_ColumnOfThreeCards25_ColumnOfThreeCards25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); @@ -373,12 +351,10 @@ const Card25_Card25_Card25_ColumnOfThreeCards25 = ({ showAge, containerPalette, imageLoading, - serverTime, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { if (cards.length < 3) return null; @@ -400,7 +376,6 @@ const Card25_Card25_Card25_ColumnOfThreeCards25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -422,7 +397,6 @@ const Card25_Card25_Card25_ColumnOfThreeCards25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); @@ -437,7 +411,6 @@ export const DynamicFast = ({ groupedTrails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { let firstSliceLayout: @@ -570,7 +543,6 @@ export const DynamicFast = ({ @@ -580,7 +552,6 @@ export const DynamicFast = ({ @@ -590,7 +561,6 @@ export const DynamicFast = ({ @@ -600,7 +570,6 @@ export const DynamicFast = ({ @@ -610,7 +579,6 @@ export const DynamicFast = ({ @@ -627,7 +595,6 @@ export const DynamicFast = ({ @@ -637,7 +604,6 @@ export const DynamicFast = ({ @@ -647,7 +613,6 @@ export const DynamicFast = ({ ); @@ -656,7 +621,6 @@ export const DynamicFast = ({ @@ -666,7 +630,6 @@ export const DynamicFast = ({ @@ -676,7 +639,6 @@ export const DynamicFast = ({ @@ -686,7 +648,6 @@ export const DynamicFast = ({ diff --git a/dotcom-rendering/src/components/DynamicPackage.tsx b/dotcom-rendering/src/components/DynamicPackage.tsx index 0888ba86f55..639f170057a 100644 --- a/dotcom-rendering/src/components/DynamicPackage.tsx +++ b/dotcom-rendering/src/components/DynamicPackage.tsx @@ -14,7 +14,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; /*ΓΈ @@ -32,14 +31,12 @@ const Snap100 = ({ snaps, containerPalette, showAge, - serverTime, imageLoading, }: { snaps: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { if (!snaps[0]) return null; return ( @@ -50,7 +47,6 @@ const Snap100 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'small', tablet: 'xxsmall', @@ -71,14 +67,12 @@ const Card100 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { if (!cards[0]) return null; @@ -90,7 +84,6 @@ const Card100 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} headlineSizes={ cards[0].isBoosted ? { @@ -117,14 +110,12 @@ const Card75_Card25 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { if (cards.length < 2) return null; const card75 = cards.slice(0, 1); @@ -139,7 +130,6 @@ const Card75_Card25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'small' }} mediaPositionOnDesktop="right" mediaPositionOnMobile="bottom" @@ -161,7 +151,6 @@ const Card75_Card25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -174,7 +163,6 @@ const Card25_Card25_Card25_Card25 = ({ cards, containerPalette, showAge, - serverTime, showImage = true, padBottom, imageLoading, @@ -183,7 +171,6 @@ const Card25_Card25_Card25_Card25 = ({ imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; showImage?: boolean; padBottom?: boolean; }) => { @@ -201,7 +188,6 @@ const Card25_Card25_Card25_Card25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} supportingContent={limitSupportingContent(card)} image={showImage ? card.image : undefined} imageLoading={imageLoading} @@ -217,14 +203,12 @@ const Card25_Card25_Card25_ColumnOfTwo25 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const bigs = cards.slice(0, 3); const remaining = cards.slice(3); @@ -244,7 +228,6 @@ const Card25_Card25_Card25_ColumnOfTwo25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} supportingContent={limitSupportingContent(card)} imageLoading={imageLoading} /> @@ -265,7 +248,6 @@ const Card25_Card25_Card25_ColumnOfTwo25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} supportingContent={limitSupportingContent( card, )} @@ -285,14 +267,12 @@ const Card25_Card25_ColumnOfTwo25_ColumnOfTwo25 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const bigs = cards.slice(0, 2); const remaining = cards.slice(2, 6); @@ -312,7 +292,6 @@ const Card25_Card25_ColumnOfTwo25_ColumnOfTwo25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} supportingContent={limitSupportingContent(card)} imageLoading={imageLoading} /> @@ -339,7 +318,6 @@ const Card25_Card25_ColumnOfTwo25_ColumnOfTwo25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} supportingContent={limitSupportingContent( card, )} @@ -359,14 +337,12 @@ const Card25_ColumnOfTwo25_ColumnOfTwo25_ColumnOfTwo25 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const bigs = cards.slice(0, 1); const remaining = cards.slice(1, 7); @@ -381,7 +357,6 @@ const Card25_ColumnOfTwo25_ColumnOfTwo25_ColumnOfTwo25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} supportingContent={limitSupportingContent(card)} imageLoading={imageLoading} /> @@ -408,7 +383,6 @@ const Card25_ColumnOfTwo25_ColumnOfTwo25_ColumnOfTwo25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} supportingContent={limitSupportingContent( card, )} @@ -428,14 +402,12 @@ const Card75_ColumnOfCards25 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const card75 = cards.slice(0, 1); const remaining = cards.slice(1, 4); @@ -449,7 +421,6 @@ const Card75_ColumnOfCards25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'medium', tablet: 'small' }} mediaPositionOnDesktop="bottom" mediaPositionOnMobile="bottom" @@ -481,7 +452,6 @@ const Card75_ColumnOfCards25 = ({ containerPalette={containerPalette} containerType="dynamic/package" showAge={showAge} - serverTime={serverTime} image={ shouldShowImage ? card.image : undefined } @@ -512,7 +482,6 @@ export const DynamicPackage = ({ groupedTrails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { let layout: @@ -603,14 +572,12 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -622,7 +589,6 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> {/* Card75_Card25 does not support the first card being boosted - on Frontend the 75% card would @@ -632,7 +598,6 @@ export const DynamicPackage = ({ cards={secondSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -644,21 +609,18 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -670,14 +632,12 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -689,21 +649,18 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -715,21 +672,18 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -741,21 +695,18 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -767,21 +718,18 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -793,21 +741,18 @@ export const DynamicPackage = ({ snaps={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -815,7 +760,6 @@ export const DynamicPackage = ({ cards={fourthSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} showImage={false} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/DynamicSlow.tsx b/dotcom-rendering/src/components/DynamicSlow.tsx index 0756578aed5..132a23a0360 100644 --- a/dotcom-rendering/src/components/DynamicSlow.tsx +++ b/dotcom-rendering/src/components/DynamicSlow.tsx @@ -27,7 +27,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; const ColumnOfCards50_Card50 = ({ @@ -35,12 +34,10 @@ const ColumnOfCards50_Card50 = ({ showAge, containerPalette, imageLoading, - serverTime, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { const big = cards.slice(0, 1); @@ -58,7 +55,6 @@ const ColumnOfCards50_Card50 = ({ @@ -77,7 +73,6 @@ const ColumnOfCards50_Card50 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -94,12 +89,10 @@ const ColumnOfCards50_ColumnOfCards50 = ({ showAge, containerPalette, imageLoading, - serverTime, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { return ( @@ -122,7 +115,6 @@ const ColumnOfCards50_ColumnOfCards50 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -141,7 +133,6 @@ export const DynamicSlow = ({ groupedTrails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { let firstSliceLayout: @@ -225,7 +216,6 @@ export const DynamicSlow = ({ @@ -235,7 +225,6 @@ export const DynamicSlow = ({ @@ -245,7 +234,6 @@ export const DynamicSlow = ({ @@ -255,7 +243,6 @@ export const DynamicSlow = ({ @@ -265,7 +252,6 @@ export const DynamicSlow = ({ @@ -282,7 +268,6 @@ export const DynamicSlow = ({ @@ -292,7 +277,6 @@ export const DynamicSlow = ({ @@ -302,7 +286,6 @@ export const DynamicSlow = ({ diff --git a/dotcom-rendering/src/components/FeatureCard.tsx b/dotcom-rendering/src/components/FeatureCard.tsx index 23cef00c4af..6a82ef38f73 100644 --- a/dotcom-rendering/src/components/FeatureCard.tsx +++ b/dotcom-rendering/src/components/FeatureCard.tsx @@ -330,7 +330,6 @@ const renderPodcastImage = ( export type Props = { linkTo: string; format: ArticleFormat; - serverTime?: number; headlineText: string; headlineSizes?: ResponsiveFontSize; byline?: string; @@ -412,7 +411,6 @@ export const FeatureCard = ({ discussionApiUrl, discussionId, isExternalLink, - serverTime, aspectRatio, mobileAspectRatio, starRating, @@ -529,7 +527,6 @@ export const FeatureCard = ({ headlineSizes={headlineSizes} webPublicationDate={webPublicationDate} showClock={!!showClock} - serverTime={serverTime} linkTo={linkTo} discussionId={discussionId} discussionApiUrl={discussionApiUrl} @@ -779,7 +776,6 @@ export const FeatureCard = ({ webPublicationDate } showClock={!!showClock} - serverTime={serverTime} isStorylines={ isStorylines } diff --git a/dotcom-rendering/src/components/FeatureCardCardAge.tsx b/dotcom-rendering/src/components/FeatureCardCardAge.tsx index bc50a03275e..2bf83bb7de2 100644 --- a/dotcom-rendering/src/components/FeatureCardCardAge.tsx +++ b/dotcom-rendering/src/components/FeatureCardCardAge.tsx @@ -4,14 +4,12 @@ import { CardAge } from './Card/components/CardAge'; type Props = { showClock: boolean; - serverTime?: number; webPublicationDate: string; isStorylines?: boolean; }; export const FeatureCardCardAge = ({ showClock, - serverTime, webPublicationDate, isStorylines, }: Props) => { @@ -24,7 +22,6 @@ export const FeatureCardCardAge = ({ isWithinTwelveHours: true, }} showClock={showClock} - serverTime={serverTime} isTagPage={false} colour={palette('--feature-card-footer-text')} /> diff --git a/dotcom-rendering/src/components/FetchMoreGalleriesData.importable.tsx b/dotcom-rendering/src/components/FetchMoreGalleriesData.importable.tsx index 4420e2bd09d..aaedaa99de6 100644 --- a/dotcom-rendering/src/components/FetchMoreGalleriesData.importable.tsx +++ b/dotcom-rendering/src/components/FetchMoreGalleriesData.importable.tsx @@ -12,7 +12,6 @@ import { Placeholder } from './Placeholder'; type Props = { discussionApiUrl: string; - serverTime?: number; isAdFreeUser: boolean; ajaxUrl: string; guardianBaseUrl: string; @@ -87,7 +86,6 @@ const fetchJson = async (ajaxUrl: string): Promise => { export const FetchMoreGalleriesData = ({ discussionApiUrl, - serverTime, isAdFreeUser, ajaxUrl, guardianBaseUrl, @@ -149,7 +147,6 @@ export const FetchMoreGalleriesData = ({ return ( {format.design === ArticleDesign.Gallery ? ( )} diff --git a/dotcom-rendering/src/components/FirstPublished.tsx b/dotcom-rendering/src/components/FirstPublished.tsx index dc46d42c96c..786367aa308 100644 --- a/dotcom-rendering/src/components/FirstPublished.tsx +++ b/dotcom-rendering/src/components/FirstPublished.tsx @@ -22,7 +22,6 @@ type Props = { blockId: string; isPinnedPost: boolean; isOriginalPinnedPost: boolean; - serverTime?: number; }; const href = (blockId: string, renderingTarget: RenderingTarget): string => { @@ -43,7 +42,6 @@ const FirstPublished = ({ blockId, isPinnedPost, isOriginalPinnedPost, - serverTime, }: Props) => { const publishedDate = new Date(firstPublished); const { renderingTarget } = useConfig(); @@ -81,7 +79,6 @@ const FirstPublished = ({ { const firstSlice75 = trails.slice(0, 1); @@ -39,7 +37,6 @@ export const FixedLargeSlowXIV = ({ @@ -57,7 +54,6 @@ export const FixedLargeSlowXIV = ({ @@ -78,7 +74,6 @@ export const FixedLargeSlowXIV = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -103,7 +98,6 @@ export const FixedLargeSlowXIV = ({ diff --git a/dotcom-rendering/src/components/FixedMediumFastXI.tsx b/dotcom-rendering/src/components/FixedMediumFastXI.tsx index 70a75ac4ec9..ba81bf1433b 100644 --- a/dotcom-rendering/src/components/FixedMediumFastXI.tsx +++ b/dotcom-rendering/src/components/FixedMediumFastXI.tsx @@ -10,7 +10,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; const decideOffset = ({ @@ -44,7 +43,6 @@ export const FixedMediumFastXI = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice = trails.slice(0, 3); @@ -55,7 +53,6 @@ export const FixedMediumFastXI = ({ cards={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> {/* @@ -85,7 +82,6 @@ export const FixedMediumFastXI = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ))} diff --git a/dotcom-rendering/src/components/FixedMediumFastXII.tsx b/dotcom-rendering/src/components/FixedMediumFastXII.tsx index f5f06ec66f7..f095f0f39e8 100644 --- a/dotcom-rendering/src/components/FixedMediumFastXII.tsx +++ b/dotcom-rendering/src/components/FixedMediumFastXII.tsx @@ -9,14 +9,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedMediumFastXII = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice25 = trails.slice(0, 4); @@ -37,7 +35,6 @@ export const FixedMediumFastXII = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -57,7 +54,6 @@ export const FixedMediumFastXII = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); diff --git a/dotcom-rendering/src/components/FixedMediumSlowVI.tsx b/dotcom-rendering/src/components/FixedMediumSlowVI.tsx index fc956efa2d9..aea77410c02 100644 --- a/dotcom-rendering/src/components/FixedMediumSlowVI.tsx +++ b/dotcom-rendering/src/components/FixedMediumSlowVI.tsx @@ -13,7 +13,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedMediumSlowVI = ({ @@ -21,7 +20,6 @@ export const FixedMediumSlowVI = ({ containerPalette, showAge, imageLoading, - serverTime, }: Props) => { const firstSlice75 = trails.slice(0, 1); const firstSlice25 = trails.slice(1, 2); @@ -36,7 +34,6 @@ export const FixedMediumSlowVI = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -52,7 +49,6 @@ export const FixedMediumSlowVI = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -65,7 +61,6 @@ export const FixedMediumSlowVI = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/FixedMediumSlowVII.tsx b/dotcom-rendering/src/components/FixedMediumSlowVII.tsx index 2a55104f77b..22de99727e0 100644 --- a/dotcom-rendering/src/components/FixedMediumSlowVII.tsx +++ b/dotcom-rendering/src/components/FixedMediumSlowVII.tsx @@ -13,14 +13,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedMediumSlowVII = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice50 = trails.slice(0, 1); @@ -41,7 +39,6 @@ export const FixedMediumSlowVII = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -58,7 +55,6 @@ export const FixedMediumSlowVII = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -71,7 +67,6 @@ export const FixedMediumSlowVII = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/FixedMediumSlowXIIMPU.tsx b/dotcom-rendering/src/components/FixedMediumSlowXIIMPU.tsx index 03d706ec422..27eb3c16fee 100644 --- a/dotcom-rendering/src/components/FixedMediumSlowXIIMPU.tsx +++ b/dotcom-rendering/src/components/FixedMediumSlowXIIMPU.tsx @@ -14,7 +14,6 @@ type Props = { trails: DCRFrontCard[]; containerPalette?: DCRContainerPalette; imageLoading: Loading; - serverTime?: number; showAge?: boolean; }; @@ -29,11 +28,9 @@ const Card33_Card33_Card33 = ({ showAge, padBottom, imageLoading, - serverTime, }: { trails: DCRFrontCard[]; imageLoading: Loading; - serverTime?: number; containerPalette?: DCRContainerPalette; showAge?: boolean; padBottom?: boolean; @@ -49,7 +46,6 @@ const Card33_Card33_Card33 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -65,7 +61,6 @@ const Card33_Card33_Card33 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -85,11 +80,9 @@ const Card50_Card50 = ({ showAge, padBottom, imageLoading, - serverTime, }: { trails: DCRFrontCard[]; imageLoading: Loading; - serverTime?: number; containerPalette?: DCRContainerPalette; showAge?: boolean; padBottom?: boolean; @@ -104,7 +97,6 @@ const Card50_Card50 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -120,7 +112,6 @@ const Card50_Card50 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -138,7 +129,6 @@ export const FixedMediumSlowXIIMPU = ({ containerPalette, showAge, imageLoading, - serverTime, }: Props) => { const firstSlice = trails.slice(0, 3); const remaining = trails.slice(3, 9); @@ -152,7 +142,6 @@ export const FixedMediumSlowXIIMPU = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} key={trail.url} imageLoading={imageLoading} /> @@ -164,7 +153,6 @@ export const FixedMediumSlowXIIMPU = ({ trails={trails} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> ) : ( @@ -172,7 +160,6 @@ export const FixedMediumSlowXIIMPU = ({ trails={firstSlice} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} padBottom={true} imageLoading={imageLoading} /> @@ -196,7 +183,6 @@ export const FixedMediumSlowXIIMPU = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ))} diff --git a/dotcom-rendering/src/components/FixedSmallFastVIII.tsx b/dotcom-rendering/src/components/FixedSmallFastVIII.tsx index e74d16ce15e..551d7812bfd 100644 --- a/dotcom-rendering/src/components/FixedSmallFastVIII.tsx +++ b/dotcom-rendering/src/components/FixedSmallFastVIII.tsx @@ -10,14 +10,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedSmallFastVIII = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { if (!trails[0]) return null; @@ -38,7 +36,6 @@ export const FixedSmallFastVIII = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -66,7 +63,6 @@ export const FixedSmallFastVIII = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} /> ); diff --git a/dotcom-rendering/src/components/FixedSmallSlowI.tsx b/dotcom-rendering/src/components/FixedSmallSlowI.tsx index 69c8d18182e..565ceb1fc7a 100644 --- a/dotcom-rendering/src/components/FixedSmallSlowI.tsx +++ b/dotcom-rendering/src/components/FixedSmallSlowI.tsx @@ -9,14 +9,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedSmallSlowI = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice100 = trails.slice(0, 1); @@ -29,7 +27,6 @@ export const FixedSmallSlowI = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/FixedSmallSlowIII.tsx b/dotcom-rendering/src/components/FixedSmallSlowIII.tsx index 16be9d1b7c9..9499a5cdbc2 100644 --- a/dotcom-rendering/src/components/FixedSmallSlowIII.tsx +++ b/dotcom-rendering/src/components/FixedSmallSlowIII.tsx @@ -9,14 +9,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedSmallSlowIII = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice50 = trails.slice(0, 1); @@ -30,7 +28,6 @@ export const FixedSmallSlowIII = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -46,7 +43,6 @@ export const FixedSmallSlowIII = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/FixedSmallSlowIV.tsx b/dotcom-rendering/src/components/FixedSmallSlowIV.tsx index 61abae4aac6..7dfb11672f7 100644 --- a/dotcom-rendering/src/components/FixedSmallSlowIV.tsx +++ b/dotcom-rendering/src/components/FixedSmallSlowIV.tsx @@ -9,14 +9,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedSmallSlowIV = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice25 = trails.slice(0, 4); @@ -30,7 +28,6 @@ export const FixedSmallSlowIV = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/FixedSmallSlowVHalf.tsx b/dotcom-rendering/src/components/FixedSmallSlowVHalf.tsx index 049dc5995e2..118bc977291 100644 --- a/dotcom-rendering/src/components/FixedSmallSlowVHalf.tsx +++ b/dotcom-rendering/src/components/FixedSmallSlowVHalf.tsx @@ -9,14 +9,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedSmallSlowVHalf = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice50 = trails.slice(0, 1); @@ -36,7 +34,6 @@ export const FixedSmallSlowVHalf = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -51,7 +48,6 @@ export const FixedSmallSlowVHalf = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/FixedSmallSlowVMPU.tsx b/dotcom-rendering/src/components/FixedSmallSlowVMPU.tsx index 8af6450cdde..f5e03e1b8cf 100644 --- a/dotcom-rendering/src/components/FixedSmallSlowVMPU.tsx +++ b/dotcom-rendering/src/components/FixedSmallSlowVMPU.tsx @@ -9,7 +9,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; /** @@ -20,7 +19,6 @@ export const FixedSmallSlowVMPU = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => (
    @@ -36,7 +34,6 @@ export const FixedSmallSlowVMPU = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/components/FixedSmallSlowVThird.tsx b/dotcom-rendering/src/components/FixedSmallSlowVThird.tsx index 61b36ce02ff..67152c6d383 100644 --- a/dotcom-rendering/src/components/FixedSmallSlowVThird.tsx +++ b/dotcom-rendering/src/components/FixedSmallSlowVThird.tsx @@ -10,14 +10,12 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }; export const FixedSmallSlowVThird = ({ trails, containerPalette, showAge, - serverTime, imageLoading, }: Props) => { const firstSlice25 = trails.slice(0, 2); @@ -37,7 +35,6 @@ export const FixedSmallSlowVThird = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -52,7 +49,6 @@ export const FixedSmallSlowVThird = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'xxsmall' }} mediaPositionOnDesktop="left" mediaPositionOnMobile="none" diff --git a/dotcom-rendering/src/components/FlexibleGeneral.tsx b/dotcom-rendering/src/components/FlexibleGeneral.tsx index c6955686357..1899ba724b9 100644 --- a/dotcom-rendering/src/components/FlexibleGeneral.tsx +++ b/dotcom-rendering/src/components/FlexibleGeneral.tsx @@ -29,7 +29,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; aspectRatio: AspectRatio; containerLevel?: DCRContainerLevel; collectionId: number; @@ -86,7 +85,6 @@ export const decideCardPositions = (cards: DCRFrontCard[]): GroupedCards => { type ImmersiveCardLayoutProps = { card: DCRFrontCard; containerPalette?: DCRContainerPalette; - serverTime?: number; imageLoading: Loading; collectionId: number; isStorylines?: boolean; @@ -101,7 +99,6 @@ type ImmersiveCardLayoutProps = { const ImmersiveCardLayout = ({ card, containerPalette, - serverTime, imageLoading, collectionId, isStorylines, @@ -131,7 +128,6 @@ const ImmersiveCardLayout = ({ branding={card.branding} containerPalette={containerPalette} trailText={card.trailText} - serverTime={serverTime} imageLoading={imageLoading} aspectRatio="5:3" mobileAspectRatio="4:5" @@ -250,7 +246,6 @@ type SplashCardLayoutProps = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; aspectRatio: AspectRatio; isLastRow: boolean; containerLevel: DCRContainerLevel; @@ -262,7 +257,6 @@ const SplashCardLayout = ({ cards, containerPalette, showAge, - serverTime, imageLoading, aspectRatio, isLastRow, @@ -279,7 +273,6 @@ const SplashCardLayout = ({ @@ -325,7 +318,6 @@ const SplashCardLayout = ({ containerPalette={containerPalette} containerType="flexible/general" showAge={showAge} - serverTime={serverTime} headlineSizes={headlineSizes} mediaPositionOnDesktop={mediaPositionOnDesktop} mediaPositionOnMobile={mediaPositionOnMobile} @@ -414,7 +406,6 @@ type FullWidthCardLayoutProps = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; aspectRatio: AspectRatio; isFirstRow: boolean; isLastRow: boolean; @@ -427,7 +418,6 @@ const FullWidthCardLayout = ({ cards, containerPalette, showAge, - serverTime, imageLoading, aspectRatio, isFirstRow, @@ -458,7 +448,6 @@ const FullWidthCardLayout = ({ & - Pick; + Pick; /** * A wrapper around the normal Card component providing sensible defaults for Cards on front containers. @@ -25,7 +25,7 @@ type Props = { */ export const FrontCard = (props: Props) => { const { trail, ...cardProps } = props; - const defaultProps: Omit = { + const defaultProps: Omit = { linkTo: trail.url, format: trail.format, headlineText: trail.headline, diff --git a/dotcom-rendering/src/components/KeyEventCard.tsx b/dotcom-rendering/src/components/KeyEventCard.tsx index ee5f0ce854b..0598c42b706 100644 --- a/dotcom-rendering/src/components/KeyEventCard.tsx +++ b/dotcom-rendering/src/components/KeyEventCard.tsx @@ -16,7 +16,6 @@ interface Props { title: string; isSummary: boolean; filterKeyEvents: boolean; - serverTime?: number; cardPosition?: string; renderingTarget: RenderingTarget; } @@ -139,7 +138,6 @@ export const KeyEventCard = ({ title, filterKeyEvents, cardPosition = 'unknown position', - serverTime, renderingTarget, }: Props) => { const url = getUrl({ filterKeyEvents, renderingTarget, id }); @@ -156,7 +154,6 @@ export const KeyEventCard = ({ { const carousel = useRef(null); @@ -162,7 +160,6 @@ export const KeyEventsCarousel = ({ isSummary={keyEvent.attributes.summary} title={keyEvent.title} cardPosition={`${index} of ${carouselLength}`} - serverTime={serverTime} renderingTarget={renderingTarget} /> ); diff --git a/dotcom-rendering/src/components/LatestLinks.importable.tsx b/dotcom-rendering/src/components/LatestLinks.importable.tsx index b386db6c26f..cffb3802327 100644 --- a/dotcom-rendering/src/components/LatestLinks.importable.tsx +++ b/dotcom-rendering/src/components/LatestLinks.importable.tsx @@ -20,7 +20,6 @@ import type { Alignment } from './SupportingContent'; type Props = { id: string; direction: Alignment; - serverTime?: number; isDynamo?: boolean; containerPalette?: DCRContainerPalette; displayHeader?: boolean; @@ -118,7 +117,6 @@ export const LatestLinks = ({ direction, isDynamo = false, containerPalette, - serverTime, displayHeader = false, directionOnMobile, }: Props) => { @@ -204,7 +202,6 @@ export const LatestLinks = ({ ) } display="relative" - serverTime={serverTime} showWeekday={false} showDate={true} showTime={false} diff --git a/dotcom-rendering/src/components/LiveBlock.tsx b/dotcom-rendering/src/components/LiveBlock.tsx index 9d328dd5ba9..d826cee29c3 100644 --- a/dotcom-rendering/src/components/LiveBlock.tsx +++ b/dotcom-rendering/src/components/LiveBlock.tsx @@ -26,7 +26,6 @@ type Props = { pinnedPostId?: string; editionId: EditionId; shouldHideAds: boolean; - serverTime?: number; idApiUrl?: string; }; @@ -46,7 +45,6 @@ export const LiveBlock = ({ pinnedPostId, editionId, shouldHideAds, - serverTime, idApiUrl, }: Props) => { if (block.elements.length === 0) return null; @@ -72,7 +70,6 @@ export const LiveBlock = ({ contributors={block.contributors} isPinnedPost={isPinnedPost} isOriginalPinnedPost={isOriginalPinnedPost} - serverTime={serverTime} > {block.elements.map((element, index) => ( { return (
    )} {blockTitle ? : null} diff --git a/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx b/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx index c307637f84c..6e024f8f883 100644 --- a/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx +++ b/dotcom-rendering/src/components/LiveBlogBlocksAndAdverts.tsx @@ -24,7 +24,6 @@ type Props = { isSensitive: boolean; isLiveUpdate?: boolean; shouldHideAds: boolean; - serverTime?: number; idApiUrl?: string; }; /** @@ -50,7 +49,6 @@ export const LiveBlogBlocksAndAdverts = ({ isLiveUpdate, editionId, shouldHideAds, - serverTime, idApiUrl, }: Props) => { const { renderingTarget } = useConfig(); @@ -75,7 +73,6 @@ export const LiveBlogBlocksAndAdverts = ({ pinnedPostId={pinnedPost?.id} editionId={editionId} shouldHideAds={shouldHideAds} - serverTime={serverTime} idApiUrl={idApiUrl} /> ); diff --git a/dotcom-rendering/src/components/LiveBlogRenderer.tsx b/dotcom-rendering/src/components/LiveBlogRenderer.tsx index 2923c0c3596..578a78581b3 100644 --- a/dotcom-rendering/src/components/LiveBlogRenderer.tsx +++ b/dotcom-rendering/src/components/LiveBlogRenderer.tsx @@ -38,7 +38,6 @@ type Props = { keyEvents: Block[]; filterKeyEvents: boolean; shouldHideAds: boolean; - serverTime?: number; idApiUrl?: string; }; @@ -66,7 +65,6 @@ export const LiveBlogRenderer = ({ filterKeyEvents = false, editionId, shouldHideAds, - serverTime, idApiUrl, }: Props) => { const { renderingTarget } = useConfig(); @@ -79,7 +77,7 @@ export const LiveBlogRenderer = ({ - + @@ -109,7 +106,6 @@ export const LiveBlogRenderer = ({ filterKeyEvents={filterKeyEvents} id={'key-events-carousel-mobile'} renderingTarget={renderingTarget} - serverTime={serverTime} /> @@ -139,7 +135,6 @@ export const LiveBlogRenderer = ({ pinnedPost={pinnedPost} editionId={editionId} shouldHideAds={shouldHideAds} - serverTime={serverTime} idApiUrl={idApiUrl} /> {isWeb && blocks.length > 4 && !isLiveUpdate && ( diff --git a/dotcom-rendering/src/components/MoreGalleries.tsx b/dotcom-rendering/src/components/MoreGalleries.tsx index 211d08fec04..7d693910934 100644 --- a/dotcom-rendering/src/components/MoreGalleries.tsx +++ b/dotcom-rendering/src/components/MoreGalleries.tsx @@ -15,7 +15,6 @@ import { Card } from './Card/Card'; import type { Props as CardProps } from './Card/Card'; type Props = { - serverTime?: number; trails: TrailType[]; discussionApiUrl: string; guardianBaseUrl: string; @@ -160,7 +159,6 @@ const getDefaultCardProps = ( trail: TrailType, discussionApiUrl: string, format: ArticleFormat, - serverTime?: number, ) => { const defaultProps: CardProps = { linkTo: trail.url, @@ -187,7 +185,6 @@ const getDefaultCardProps = ( mainMedia: trail.mainMedia, isExternalLink: false, branding: trail.branding, - serverTime, imageLoading: 'lazy', trailText: trail.trailText, showAge: false, @@ -235,7 +232,6 @@ export const MoreGalleries = (props: Props) => { firstTrail, props.discussionApiUrl, props.format, - props.serverTime, )} /> { trail, props.discussionApiUrl, props.format, - props.serverTime, )} mediaSize="medium" /> diff --git a/dotcom-rendering/src/components/OnwardsUpper.importable.tsx b/dotcom-rendering/src/components/OnwardsUpper.importable.tsx index 929b633bc5c..aa8f742f74d 100644 --- a/dotcom-rendering/src/components/OnwardsUpper.importable.tsx +++ b/dotcom-rendering/src/components/OnwardsUpper.importable.tsx @@ -184,7 +184,6 @@ type Props = { pillar: ArticleTheme; shortUrlId: string; discussionApiUrl: string; - serverTime?: number; renderingTarget: RenderingTarget; webURL: string; }; @@ -220,7 +219,6 @@ export const OnwardsUpper = ({ editionId, shortUrlId, discussionApiUrl, - serverTime, renderingTarget, webURL, }: Props) => { @@ -334,7 +332,6 @@ export const OnwardsUpper = ({ onwardsSource={onwardsSource} format={format} discussionApiUrl={discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} isAdFreeUser={isAdFreeUser} containerPosition="first" @@ -356,7 +353,6 @@ export const OnwardsUpper = ({ onwardsSource="curated-content" format={format} discussionApiUrl={discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} isAdFreeUser={isAdFreeUser} containerPosition={ diff --git a/dotcom-rendering/src/components/PersonalisedMediumFour.importable.tsx b/dotcom-rendering/src/components/PersonalisedMediumFour.importable.tsx index a5ef5167a10..1d95674a143 100644 --- a/dotcom-rendering/src/components/PersonalisedMediumFour.importable.tsx +++ b/dotcom-rendering/src/components/PersonalisedMediumFour.importable.tsx @@ -36,7 +36,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; showImage?: boolean; aspectRatio: AspectRatio; containerLevel?: DCRContainerLevel; @@ -68,7 +67,6 @@ export const PersonalisedMediumFour = ({ trails, containerPalette, showAge, - serverTime, imageLoading, showImage = true, aspectRatio, @@ -155,7 +153,6 @@ export const PersonalisedMediumFour = ({ containerPalette={containerPalette} containerType="static/medium/4" showAge={showAge} - serverTime={serverTime} image={showImage ? card.image : undefined} imageLoading={imageLoading} mediaPositionOnDesktop={getMediaPositionOnDesktop( diff --git a/dotcom-rendering/src/components/PinnedPost.tsx b/dotcom-rendering/src/components/PinnedPost.tsx index de212029444..5201228ed71 100644 --- a/dotcom-rendering/src/components/PinnedPost.tsx +++ b/dotcom-rendering/src/components/PinnedPost.tsx @@ -140,10 +140,9 @@ const buttonIcon = css` type Props = { pinnedPost: Block; children: React.ReactNode; - serverTime?: number; }; -export const PinnedPost = ({ pinnedPost, children, serverTime }: Props) => { +export const PinnedPost = ({ pinnedPost, children }: Props) => { return (
    { ; export const ScrollableSmallOnwardsStory = { args: { - serverTime: new Date('2022-09-01T20:00:25.000Z').getTime(), discussionApiUrl: 'https://discussion.code.dev-theguardian.com/discussion-api', heading: 'More on this story', diff --git a/dotcom-rendering/src/components/ScrollableSmallOnwards.tsx b/dotcom-rendering/src/components/ScrollableSmallOnwards.tsx index f6c76fcf600..c24c6a81c8a 100644 --- a/dotcom-rendering/src/components/ScrollableSmallOnwards.tsx +++ b/dotcom-rendering/src/components/ScrollableSmallOnwards.tsx @@ -18,7 +18,6 @@ import type { Props as CardProps } from './Card/Card'; import { ScrollableCarousel } from './ScrollableCarousel'; type Props = { - serverTime?: number; trails: TrailType[]; discussionApiUrl: string; heading: string; @@ -119,7 +118,6 @@ export const ScrollableSmallOnwards = (props: Props) => { props.discussionApiUrl, props.onwardsSource, props.format, - props.serverTime, )} showTopBarDesktop={desktopBottomCards.includes( index, @@ -190,12 +188,10 @@ const getDefaultCardProps = ( discussionApiUrl: string, onwardsSource: OnwardsSource, format: ArticleFormat, - serverTime?: number, ) => { const defaultProps: CardProps = { linkTo: trail.url, imageLoading: 'lazy', - serverTime, format: trail.format, contextFormat: format, containerType: 'scrollable/small', diff --git a/dotcom-rendering/src/components/StaticFeatureTwo.tsx b/dotcom-rendering/src/components/StaticFeatureTwo.tsx index ed14bd9c18f..d6964091361 100644 --- a/dotcom-rendering/src/components/StaticFeatureTwo.tsx +++ b/dotcom-rendering/src/components/StaticFeatureTwo.tsx @@ -13,7 +13,6 @@ type Props = { trails: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; - serverTime?: number; aspectRatio: AspectRatio; collectionId: number; }; @@ -27,7 +26,6 @@ type Props = { export const StaticFeatureTwo = ({ trails, containerPalette, - serverTime, imageLoading, aspectRatio, collectionId, @@ -68,7 +66,6 @@ export const StaticFeatureTwo = ({ isExternalLink={card.isExternalLink} branding={card.branding} containerPalette={containerPalette} - serverTime={serverTime} imageLoading={imageLoading} aspectRatio={aspectRatio} imageSize="feature-large" diff --git a/dotcom-rendering/src/components/StaticMediumFour.tsx b/dotcom-rendering/src/components/StaticMediumFour.tsx index 470f607208d..5b0575f170c 100644 --- a/dotcom-rendering/src/components/StaticMediumFour.tsx +++ b/dotcom-rendering/src/components/StaticMediumFour.tsx @@ -28,7 +28,6 @@ type Props = { imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; showImage?: boolean; aspectRatio: AspectRatio; containerLevel?: DCRContainerLevel; @@ -38,7 +37,6 @@ export const StaticMediumFour = ({ trails, containerPalette, showAge, - serverTime, imageLoading, showImage = true, aspectRatio, @@ -62,7 +60,6 @@ export const StaticMediumFour = ({ containerPalette={containerPalette} containerType="static/medium/4" showAge={showAge} - serverTime={serverTime} image={showImage ? card.image : undefined} imageLoading={imageLoading} mediaPositionOnDesktop={getMediaPositionOnDesktop( diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx index 36750024c7e..4b081b9788f 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx @@ -55,7 +55,6 @@ export type Props = { headlineSizes?: ResponsiveFontSize; webPublicationDate?: string; showClock?: boolean; - serverTime?: number; linkTo?: string; discussionApiUrl?: string; discussionId?: string; @@ -110,7 +109,6 @@ export const YoutubeAtom = ({ headlineSizes, webPublicationDate, showClock, - serverTime, linkTo, discussionApiUrl, discussionId, @@ -259,7 +257,6 @@ export const YoutubeAtom = ({ trailText={trailText} webPublicationDate={webPublicationDate} showClock={!!showClock} - serverTime={serverTime} linkTo={linkTo} discussionId={discussionId} discussionApiUrl={discussionApiUrl} diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomFeatureCardOverlay.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomFeatureCardOverlay.tsx index 788bbdaded6..7a620cad80c 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomFeatureCardOverlay.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomFeatureCardOverlay.tsx @@ -133,7 +133,6 @@ type Props = { trailText?: string; webPublicationDate?: string; showClock?: boolean; - serverTime?: number; linkTo?: string; discussionApiUrl?: string; discussionId?: string; @@ -159,7 +158,6 @@ export const YoutubeAtomFeatureCardOverlay = ({ trailText, webPublicationDate, showClock, - serverTime, linkTo, discussionId, discussionApiUrl, @@ -171,9 +169,7 @@ export const YoutubeAtomFeatureCardOverlay = ({ const hasDuration = !isUndefined(duration) && duration > 0; const isVideoArticle = format.design === ArticleDesign.Video; const showCardAge = - webPublicationDate !== undefined && - showClock !== undefined && - serverTime === undefined; + webPublicationDate !== undefined && showClock !== undefined; const showCommentCount = linkTo !== undefined && @@ -272,7 +268,6 @@ export const YoutubeAtomFeatureCardOverlay = ({ ) : undefined } diff --git a/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx b/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx index 6e76e915f8d..4c413faa979 100644 --- a/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx @@ -43,7 +43,6 @@ type Props = { headlineSizes?: ResponsiveFontSize; webPublicationDate?: string; showClock?: boolean; - serverTime?: number; linkTo?: string; discussionApiUrl?: string; discussionId?: string; @@ -85,7 +84,6 @@ export const YoutubeBlockComponent = ({ headlineSizes, webPublicationDate, showClock, - serverTime, linkTo, discussionApiUrl, discussionId, @@ -216,7 +214,6 @@ export const YoutubeBlockComponent = ({ headlineSizes={headlineSizes} webPublicationDate={webPublicationDate} showClock={!!showClock} - serverTime={serverTime} linkTo={linkTo} discussionId={discussionId} discussionApiUrl={discussionApiUrl} diff --git a/dotcom-rendering/src/layouts/AudioLayout.tsx b/dotcom-rendering/src/layouts/AudioLayout.tsx index d4327da1612..3a97a6a38b5 100644 --- a/dotcom-rendering/src/layouts/AudioLayout.tsx +++ b/dotcom-rendering/src/layouts/AudioLayout.tsx @@ -126,7 +126,6 @@ interface Props { article: ArticleDeprecated; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; } interface WebProps extends Props { @@ -135,7 +134,7 @@ interface WebProps extends Props { } export const AudioLayout = (props: WebProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const audioData = getAudioData(article.mainMediaElements); const { @@ -491,7 +490,6 @@ export const AudioLayout = (props: WebProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -515,7 +513,6 @@ export const AudioLayout = (props: WebProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/CommentLayout.tsx b/dotcom-rendering/src/layouts/CommentLayout.tsx index 17341643b98..61461f2f973 100644 --- a/dotcom-rendering/src/layouts/CommentLayout.tsx +++ b/dotcom-rendering/src/layouts/CommentLayout.tsx @@ -260,7 +260,6 @@ interface CommonProps { article: ArticleDeprecated; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; } interface WebProps extends CommonProps { @@ -273,7 +272,7 @@ interface AppsProps extends CommonProps { } export const CommentLayout = (props: WebProps | AppsProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const isWeb = renderingTarget === 'Web'; const isApps = renderingTarget === 'Apps'; const { @@ -741,7 +740,6 @@ export const CommentLayout = (props: WebProps | AppsProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -765,7 +763,6 @@ export const CommentLayout = (props: WebProps | AppsProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/DecideLayout.tsx b/dotcom-rendering/src/layouts/DecideLayout.tsx index 57edc35d105..aa3ae3731ce 100644 --- a/dotcom-rendering/src/layouts/DecideLayout.tsx +++ b/dotcom-rendering/src/layouts/DecideLayout.tsx @@ -41,8 +41,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { theme: article.theme, }; - const serverTime = article.serverTime; - switch (article.display) { case ArticleDisplay.Immersive: { switch (article.design) { @@ -61,7 +59,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); } @@ -77,7 +74,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Comment: @@ -88,7 +84,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Picture: @@ -97,7 +92,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); default: @@ -106,7 +100,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); } @@ -120,7 +113,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); @@ -140,7 +132,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Comment: @@ -151,7 +142,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.NewsletterSignup: @@ -162,7 +152,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { ); case ArticleDesign.HostedArticle: @@ -188,7 +177,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { article={article.frontendData} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); } @@ -203,8 +191,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { theme: article.theme, }; - const serverTime = article.serverTime; - switch (article.display) { case ArticleDisplay.Immersive: { switch (article.design) { @@ -225,7 +211,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { format={format} NAV={NAV} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); } @@ -242,7 +227,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Comment: @@ -254,7 +238,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Picture: @@ -264,7 +247,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); default: @@ -274,7 +256,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); } @@ -289,7 +270,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.FullPageInteractive: { @@ -310,7 +290,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Comment: @@ -322,7 +301,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.NewsletterSignup: @@ -332,7 +310,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Audio: @@ -342,7 +319,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { format={format} NAV={NAV} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.Crossword: @@ -359,7 +335,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { gallery={article} NAV={NAV} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); case ArticleDesign.HostedArticle: @@ -386,7 +361,6 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => { NAV={NAV} format={format} renderingTarget={renderingTarget} - serverTime={serverTime} /> ); } diff --git a/dotcom-rendering/src/layouts/FrontLayout.tsx b/dotcom-rendering/src/layouts/FrontLayout.tsx index 3ebd4e8411e..279ba744b9b 100644 --- a/dotcom-rendering/src/layouts/FrontLayout.tsx +++ b/dotcom-rendering/src/layouts/FrontLayout.tsx @@ -113,8 +113,6 @@ export const FrontLayout = ({ front, NAV }: Props) => { editionId, } = front; - const serverTime = front.serverTime; - const renderAds = canRenderAds(front); const hasPageSkin = renderAds && hasPageSkinConfig; @@ -170,7 +168,6 @@ export const FrontLayout = ({ front, NAV }: Props) => { ]} groupedTrails={highlightsCollection.grouped} showAge={false} - serverTime={serverTime} imageLoading="eager" aspectRatio={ highlightsCollection.aspectRatio ?? @@ -510,7 +507,6 @@ export const FrontLayout = ({ front, NAV }: Props) => { ) } imageLoading={imageLoading} - serverTime={serverTime} aspectRatio={ collection.aspectRatio ?? fallbackAspectRatio( diff --git a/dotcom-rendering/src/layouts/GalleryLayout.tsx b/dotcom-rendering/src/layouts/GalleryLayout.tsx index a756a61b1ad..a9b7b3adfa6 100644 --- a/dotcom-rendering/src/layouts/GalleryLayout.tsx +++ b/dotcom-rendering/src/layouts/GalleryLayout.tsx @@ -55,7 +55,6 @@ import { BannerWrapper, Stuck } from './lib/stickiness'; interface Props { gallery: Gallery; renderingTarget: RenderingTarget; - serverTime?: number; } interface WebProps extends Props { @@ -77,7 +76,7 @@ const headerStyles = css` `; export const GalleryLayout = (props: WebProps | AppProps) => { - const { gallery, renderingTarget, serverTime } = props; + const { gallery, renderingTarget } = props; const { config: { @@ -201,7 +200,6 @@ export const GalleryLayout = (props: WebProps | AppProps) => { ajaxUrl={gallery.frontendData.config.ajaxUrl} guardianBaseUrl={gallery.frontendData.guardianBaseURL} discussionApiUrl={discussionApiUrl} - serverTime={serverTime} isAdFreeUser={frontendData.isAdFreeUser} format={format} /> @@ -214,7 +212,6 @@ export const GalleryLayout = (props: WebProps | AppProps) => { display={format.display} /> { editionId={frontendData.editionId} shortUrlId={frontendData.config.shortUrlId} discussionApiUrl={frontendData.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={frontendData.webURL} /> diff --git a/dotcom-rendering/src/layouts/ImmersiveLayout.tsx b/dotcom-rendering/src/layouts/ImmersiveLayout.tsx index dd427888131..08c33b5c933 100644 --- a/dotcom-rendering/src/layouts/ImmersiveLayout.tsx +++ b/dotcom-rendering/src/layouts/ImmersiveLayout.tsx @@ -186,7 +186,6 @@ const stretchLines = css` interface CommonProps { article: ArticleDeprecated; format: ArticleFormat; - serverTime?: number; } interface WebProps extends CommonProps { @@ -230,7 +229,7 @@ const Box = ({ children }: { children: React.ReactNode }) => ( ); export const ImmersiveLayout = (props: WebProps | AppProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const { config: { isPaidContent, host, hasSurveyAd }, @@ -828,7 +827,6 @@ export const ImmersiveLayout = (props: WebProps | AppProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -852,7 +850,6 @@ export const ImmersiveLayout = (props: WebProps | AppProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/InteractiveLayout.tsx b/dotcom-rendering/src/layouts/InteractiveLayout.tsx index 2b71ac014be..e246611f319 100644 --- a/dotcom-rendering/src/layouts/InteractiveLayout.tsx +++ b/dotcom-rendering/src/layouts/InteractiveLayout.tsx @@ -192,7 +192,6 @@ interface CommonProps { article: ArticleDeprecated; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; } interface WebProps extends CommonProps { @@ -205,7 +204,7 @@ interface AppsProps extends CommonProps { } export const InteractiveLayout = (props: WebProps | AppsProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const { config: { isPaidContent, host, hasSurveyAd }, editionId, @@ -644,7 +643,6 @@ export const InteractiveLayout = (props: WebProps | AppsProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -668,7 +666,6 @@ export const InteractiveLayout = (props: WebProps | AppsProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/LiveLayout.tsx b/dotcom-rendering/src/layouts/LiveLayout.tsx index a644e247f22..30765ebcaa2 100644 --- a/dotcom-rendering/src/layouts/LiveLayout.tsx +++ b/dotcom-rendering/src/layouts/LiveLayout.tsx @@ -235,7 +235,6 @@ interface BaseProps { article: ArticleDeprecated; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; } interface AppsProps extends BaseProps { @@ -248,7 +247,7 @@ interface WebProps extends BaseProps { } export const LiveLayout = (props: WebProps | AppsProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const { config: { isPaidContent, host, hasLiveBlogTopAd, hasSurveyAd }, } = article; @@ -546,7 +545,6 @@ export const LiveLayout = (props: WebProps | AppsProps) => { keyEvents={article.keyEvents} filterKeyEvents={article.filterKeyEvents} id={'key-events-carousel-desktop'} - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -816,7 +814,6 @@ export const LiveLayout = (props: WebProps | AppsProps) => { shouldHideAds={ article.shouldHideAds } - serverTime={serverTime} idApiUrl={article.config.idApiUrl} /> {pagination.totalPages > 1 && ( @@ -948,7 +945,6 @@ export const LiveLayout = (props: WebProps | AppsProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -974,7 +970,6 @@ export const LiveLayout = (props: WebProps | AppsProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx b/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx index d7becb2a647..45b78293697 100644 --- a/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx +++ b/dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx @@ -48,7 +48,6 @@ type Props = { NAV: NavType; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; }; const mainColWrapperStyle = css` @@ -191,7 +190,6 @@ export const NewsletterSignupLayout = ({ NAV, format, renderingTarget, - serverTime, }: Props) => { const { promotedNewsletter, @@ -436,7 +434,6 @@ export const NewsletterSignupLayout = ({ discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -460,7 +457,6 @@ export const NewsletterSignupLayout = ({ editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/PictureLayout.tsx b/dotcom-rendering/src/layouts/PictureLayout.tsx index ad255a0b135..91b0f73e3cc 100644 --- a/dotcom-rendering/src/layouts/PictureLayout.tsx +++ b/dotcom-rendering/src/layouts/PictureLayout.tsx @@ -239,7 +239,6 @@ interface CommonProps { article: ArticleDeprecated; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; } interface WebProps extends CommonProps { @@ -252,7 +251,7 @@ interface AppsProps extends CommonProps { } export const PictureLayout = (props: WebProps | AppsProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const { config: { isPaidContent, host, hasSurveyAd }, @@ -584,7 +583,6 @@ export const PictureLayout = (props: WebProps | AppsProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -611,7 +609,6 @@ export const PictureLayout = (props: WebProps | AppsProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/ShowcaseLayout.tsx b/dotcom-rendering/src/layouts/ShowcaseLayout.tsx index bc50b338eec..20c1a4bfc56 100644 --- a/dotcom-rendering/src/layouts/ShowcaseLayout.tsx +++ b/dotcom-rendering/src/layouts/ShowcaseLayout.tsx @@ -210,7 +210,6 @@ interface CommonProps { article: ArticleDeprecated; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; } interface WebProps extends CommonProps { @@ -223,7 +222,7 @@ interface AppsProps extends CommonProps { } export const ShowcaseLayout = (props: WebProps | AppsProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const { config: { isPaidContent, host, hasSurveyAd }, editionId, @@ -712,7 +711,6 @@ export const ShowcaseLayout = (props: WebProps | AppsProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -736,7 +734,6 @@ export const ShowcaseLayout = (props: WebProps | AppsProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/layouts/StandardLayout.tsx b/dotcom-rendering/src/layouts/StandardLayout.tsx index 95ac6cbd73f..813cb96e0e4 100644 --- a/dotcom-rendering/src/layouts/StandardLayout.tsx +++ b/dotcom-rendering/src/layouts/StandardLayout.tsx @@ -325,7 +325,6 @@ interface Props { article: ArticleDeprecated; format: ArticleFormat; renderingTarget: RenderingTarget; - serverTime?: number; } interface WebProps extends Props { @@ -338,7 +337,7 @@ interface AppProps extends Props { } export const StandardLayout = (props: WebProps | AppProps) => { - const { article, format, renderingTarget, serverTime } = props; + const { article, format, renderingTarget } = props; const { config: { isPaidContent, host, hasSurveyAd }, editionId, @@ -887,7 +886,6 @@ export const StandardLayout = (props: WebProps | AppProps) => { discussionApiUrl={ article.config.discussionApiUrl } - serverTime={serverTime} renderingTarget={renderingTarget} /> @@ -911,7 +909,6 @@ export const StandardLayout = (props: WebProps | AppProps) => { editionId={article.editionId} shortUrlId={article.config.shortUrlId} discussionApiUrl={article.config.discussionApiUrl} - serverTime={serverTime} renderingTarget={renderingTarget} webURL={article.webURL} /> diff --git a/dotcom-rendering/src/lib/cardWrappers.tsx b/dotcom-rendering/src/lib/cardWrappers.tsx index 7a70efebecf..9d1d79edef1 100644 --- a/dotcom-rendering/src/lib/cardWrappers.tsx +++ b/dotcom-rendering/src/lib/cardWrappers.tsx @@ -10,7 +10,6 @@ import type { type TrailProps = { trail: DCRFrontCard; imageLoading: Loading; - serverTime?: number; showAge?: boolean; containerPalette?: DCRContainerPalette; isTagPage?: boolean; @@ -55,7 +54,6 @@ export const Card100Media50 = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -65,7 +63,6 @@ export const Card100Media50 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'medium', tablet: 'xxsmall' }} image={trail.image} mediaSize="medium" @@ -109,7 +106,6 @@ export const Card100Media75 = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -117,7 +113,6 @@ export const Card100Media75 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'medium', tablet: 'xsmall' }} image={trail.image} mediaSize="jumbo" @@ -164,7 +159,6 @@ export const Card100Media100 = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -172,7 +166,6 @@ export const Card100Media100 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'medium', tablet: 'xsmall' }} image={trail.image} mediaPositionOnDesktop="top" @@ -208,7 +201,6 @@ export const Card100Media100Tall = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -216,7 +208,6 @@ export const Card100Media100Tall = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} headlineSizes={{ desktop: 'xsmall', tablet: 'xsmall' }} image={trail.image} mediaPositionOnDesktop="top" @@ -251,7 +242,6 @@ export const Card75Media50Right = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -259,7 +249,6 @@ export const Card75Media50Right = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} trailText={trail.trailText} supportingContent={trail.supportingContent?.slice(0, 3)} supportingContentAlignment={ @@ -298,7 +287,6 @@ export const Card75Media50Left = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -306,7 +294,6 @@ export const Card75Media50Left = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} trailText={trail.trailText} supportingContent={trail.supportingContent?.slice(0, 3)} supportingContentAlignment={ @@ -345,7 +332,6 @@ export const Card25Media25 = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -355,7 +341,6 @@ export const Card25Media25 = ({ supportingContentAlignment="vertical" containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaPositionOnDesktop="top" mediaPositionOnMobile="left" mediaSize="small" @@ -388,7 +373,6 @@ export const Card25Media25SmallHeadline = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -398,7 +382,6 @@ export const Card25Media25SmallHeadline = ({ supportingContentAlignment="vertical" containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaPositionOnDesktop="top" mediaPositionOnMobile="left" mediaSize="small" @@ -432,7 +415,6 @@ export const Card25Media25Tall = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -440,7 +422,6 @@ export const Card25Media25Tall = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaPositionOnDesktop="top" mediaPositionOnMobile="left" mediaSize="small" @@ -481,7 +462,6 @@ export const Card25Media25TallNoTrail = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -489,7 +469,6 @@ export const Card25Media25TallNoTrail = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaPositionOnDesktop="top" mediaPositionOnMobile="left" mediaSize="small" @@ -523,7 +502,6 @@ export const Card25Media25TallSmallHeadline = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -531,7 +509,6 @@ export const Card25Media25TallSmallHeadline = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaPositionOnDesktop="top" mediaPositionOnMobile="left" mediaSize="small" @@ -565,7 +542,6 @@ export const Card50Media50 = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -579,7 +555,6 @@ export const Card50Media50 = ({ imageLoading={imageLoading} isTagPage={isTagPage} showAge={showAge} - serverTime={serverTime} supportingContent={trail.supportingContent?.slice(0, 3)} supportingContentAlignment="horizontal" aspectRatio={aspectRatio} @@ -608,7 +583,6 @@ export const Card50Media50Tall = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -616,7 +590,6 @@ export const Card50Media50Tall = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} trailText={trail.trailText} supportingContent={trail.supportingContent?.slice(0, 3)} supportingContentAlignment="horizontal" @@ -651,7 +624,6 @@ export const Card66Media66 = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -659,7 +631,6 @@ export const Card66Media66 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} trailText={trail.trailText} headlineSizes={{ desktop: 'xsmall', tablet: 'xxsmall' }} mediaPositionOnDesktop="top" @@ -692,7 +663,6 @@ export const Card33Media33 = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -700,7 +670,6 @@ export const Card33Media33 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} trailText={trail.trailText} mediaSize="medium" mediaPositionOnDesktop="top" @@ -732,7 +701,6 @@ export const Card33Media33Tall = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -740,7 +708,6 @@ export const Card33Media33Tall = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaSize="medium" mediaPositionOnDesktop="top" mediaPositionOnMobile="left" @@ -774,7 +741,6 @@ export const Card33Media33MobileTopTall = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -782,7 +748,6 @@ export const Card33Media33MobileTopTall = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} trailText={trail.trailText} mediaSize="medium" mediaPositionOnDesktop="top" @@ -813,7 +778,6 @@ export const CardDefault = ({ trail, showAge, containerPalette, - serverTime, isTagPage, aspectRatio, }: Omit) => { @@ -822,7 +786,6 @@ export const CardDefault = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} image={undefined} imageLoading={'lazy'} avatarUrl={undefined} @@ -852,7 +815,6 @@ export const CardDefaultMedia = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -860,7 +822,6 @@ export const CardDefaultMedia = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaSize="small" mediaPositionOnDesktop="left" mediaPositionOnMobile="none" @@ -891,7 +852,6 @@ export const CardDefaultMediaMobile = ({ containerPalette, imageLoading, isTagPage, - serverTime, aspectRatio, }: TrailProps) => { return ( @@ -899,7 +859,6 @@ export const CardDefaultMediaMobile = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} mediaSize="small" mediaPositionOnDesktop="left" mediaPositionOnMobile="left" diff --git a/dotcom-rendering/src/lib/dynamicSlices.tsx b/dotcom-rendering/src/lib/dynamicSlices.tsx index 1ee18f285ad..c08876e9e94 100644 --- a/dotcom-rendering/src/lib/dynamicSlices.tsx +++ b/dotcom-rendering/src/lib/dynamicSlices.tsx @@ -36,14 +36,12 @@ export const Card50_Card50 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const cards50 = cards.slice(0, 2); @@ -60,7 +58,6 @@ export const Card50_Card50 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -78,14 +75,12 @@ export const Card75_Card25 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const card75 = cards.slice(0, 1); const card25 = cards.slice(1, 2); @@ -97,7 +92,6 @@ export const Card75_Card25 = ({ @@ -113,7 +107,6 @@ export const Card75_Card25 = ({ @@ -132,14 +125,12 @@ export const Card25_Card75 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const card25 = cards.slice(0, 1); const card75 = cards.slice(1, 2); @@ -151,7 +142,6 @@ export const Card25_Card75 = ({ @@ -167,7 +157,6 @@ export const Card25_Card75 = ({ @@ -186,14 +175,12 @@ export const Card50_Card25_Card25 = ({ cards, containerPalette, showAge, - serverTime, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; containerPalette?: DCRContainerPalette; showAge?: boolean; - serverTime?: number; }) => { const card50 = cards.slice(0, 1); const cards25 = cards.slice(1, 3); @@ -206,7 +193,6 @@ export const Card50_Card25_Card25 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -223,7 +209,6 @@ export const Card50_Card25_Card25 = ({ trail={trail} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -243,12 +228,10 @@ export const Card100PictureTop = ({ showAge, containerPalette, imageLoading, - serverTime, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { const card100 = cards.slice(0, 1); @@ -260,7 +243,6 @@ export const Card100PictureTop = ({ @@ -273,14 +255,12 @@ export const Card100PictureTop = ({ export const Card25_Card25_Card25_Card25 = ({ cards, showAge, - serverTime, containerPalette, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { if (cards.length < 4) return null; @@ -301,7 +281,6 @@ export const Card25_Card25_Card25_Card25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -314,14 +293,12 @@ export const Card25_Card25_Card25_Card25 = ({ export const ColumnOfCards50_Card25_Card25 = ({ cards, showAge, - serverTime, containerPalette, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { const bigs = cards.slice(0, 2).reverse(); @@ -340,7 +317,6 @@ export const ColumnOfCards50_Card25_Card25 = ({ @@ -360,7 +336,6 @@ export const ColumnOfCards50_Card25_Card25 = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> @@ -381,14 +356,12 @@ export const ColumnOfCards50_Card25_Card25 = ({ export const Card100PictureRight = ({ cards, showAge, - serverTime, containerPalette, imageLoading, }: { cards: DCRFrontCard[]; imageLoading: Loading; showAge?: boolean; - serverTime?: number; containerPalette?: DCRContainerPalette; }) => { const card100 = cards.slice(0, 1); @@ -401,7 +374,6 @@ export const Card100PictureRight = ({ trail={card} containerPalette={containerPalette} showAge={showAge} - serverTime={serverTime} imageLoading={imageLoading} /> diff --git a/dotcom-rendering/src/server/handler.front.web.ts b/dotcom-rendering/src/server/handler.front.web.ts index dc468d119d4..abd75f21298 100644 --- a/dotcom-rendering/src/server/handler.front.web.ts +++ b/dotcom-rendering/src/server/handler.front.web.ts @@ -23,8 +23,6 @@ import { renderFront, renderTagPage } from './render.front.web'; const enhanceFront = (body: unknown): Front => { const data: FEFront = validateAsFEFront(body); - const serverTime = Date.now(); - const isInPersonalisedContainerTest = data.config.serverSideABTests[ `fronts-and-curation-personalised-container` @@ -86,7 +84,6 @@ const enhanceFront = (body: unknown): Front => { ), deeplyRead: data.deeplyRead?.map((trail) => decideTrail(trail)), canonicalUrl: data.canonicalUrl, - serverTime, }; }; diff --git a/dotcom-rendering/src/types/article.ts b/dotcom-rendering/src/types/article.ts index fce46392341..ac961b84bcd 100644 --- a/dotcom-rendering/src/types/article.ts +++ b/dotcom-rendering/src/types/article.ts @@ -44,7 +44,6 @@ export type ArticleFields = { display: ArticleDisplay; theme: ArticleTheme; storyPackage: StoryPackage | undefined; - serverTime?: number | undefined; }; export type Gallery = ArticleFields & { @@ -89,8 +88,6 @@ export const enhanceArticleType = ( ): Article => { const format = decideFormat(data.format); - const serverTime = Date.now(); - const imagesForLightbox = data.config.switches.lightbox ? buildLightboxImages(data.format, data.blocks, data.mainMediaElements) : []; @@ -150,7 +147,6 @@ export const enhanceArticleType = ( design, display: format.display, theme: format.theme, - serverTime, bodyElements: blocks.flatMap((block) => block.elements.filter( (element) => @@ -173,7 +169,6 @@ export const enhanceArticleType = ( display: format.display, theme: format.theme, storyPackage, - serverTime, frontendData: { ...data, mainMediaElements, diff --git a/dotcom-rendering/src/types/front.ts b/dotcom-rendering/src/types/front.ts index 7aefd077479..dc2b80c567c 100644 --- a/dotcom-rendering/src/types/front.ts +++ b/dotcom-rendering/src/types/front.ts @@ -38,7 +38,6 @@ export interface Front { pageId: string; webURL: string; guardianBaseURL: string; - serverTime?: number; } interface PressedPage { @@ -102,7 +101,6 @@ export type DCRFrontCard = { slideshowImages?: DCRSlideshowImage[]; showVideo?: boolean; uniqueId?: string; - serverTime?: number; }; export type DCRSlideshowImage = { From d6897ecd53487ed94ff7b01d6cb2851902764248 Mon Sep 17 00:00:00 2001 From: James Mockett <1166188+jamesmockett@users.noreply.github.com> Date: Mon, 12 Jan 2026 17:46:31 +0000 Subject: [PATCH 5/5] Add DateTime context to tests where required --- .../src/components/ArticleMeta.web.test.tsx | 77 ++++++++++--------- .../src/components/Island.test.tsx | 3 +- .../src/components/IslandContext.test.tsx | 75 ++++++++++-------- .../src/components/MostViewedFooter.test.tsx | 61 +++++++++------ .../src/components/MostViewedRight.test.tsx | 13 +++- 5 files changed, 133 insertions(+), 96 deletions(-) diff --git a/dotcom-rendering/src/components/ArticleMeta.web.test.tsx b/dotcom-rendering/src/components/ArticleMeta.web.test.tsx index afcf262ac5c..4b9c99d6a8c 100644 --- a/dotcom-rendering/src/components/ArticleMeta.web.test.tsx +++ b/dotcom-rendering/src/components/ArticleMeta.web.test.tsx @@ -3,6 +3,7 @@ import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStylin import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/articleFormat'; import { ArticleMeta, shouldShowContributor } from './ArticleMeta.web'; import { ConfigProvider } from './ConfigContext'; +import { DateTimeProvider } from './DateTimeContext'; jest.mock('../lib/bridgetApi', () => jest.fn()); jest.mock('../lib/useMatchMedia', () => ({ @@ -25,24 +26,26 @@ describe('ArticleMeta', () => { editionId: 'UK', }} > - + + + , ); @@ -72,24 +75,26 @@ describe('ArticleMeta', () => { editionId: 'UK', }} > - + + + , ); diff --git a/dotcom-rendering/src/components/Island.test.tsx b/dotcom-rendering/src/components/Island.test.tsx index e670fbd1752..4c801a95ad9 100644 --- a/dotcom-rendering/src/components/Island.test.tsx +++ b/dotcom-rendering/src/components/Island.test.tsx @@ -12,6 +12,7 @@ import { BrazeMessaging } from './BrazeMessaging.importable'; import { CardCommentCount } from './CardCommentCount.importable'; import { CommentCount } from './CommentCount.importable'; import { ConfigProvider } from './ConfigContext'; +import { DateTimeProvider } from './DateTimeContext'; import { DiscussionLayout } from './DiscussionLayout'; import { DiscussionMeta } from './DiscussionMeta.importable'; import { EnhanceAffiliateLinks } from './EnhanceAffiliateLinks.importable'; @@ -102,7 +103,7 @@ describe('Island: server-side rendering', () => { editionId: 'UK', }} > - {children} + {children} ); diff --git a/dotcom-rendering/src/components/IslandContext.test.tsx b/dotcom-rendering/src/components/IslandContext.test.tsx index 75ee4163926..a0dabcf76ab 100644 --- a/dotcom-rendering/src/components/IslandContext.test.tsx +++ b/dotcom-rendering/src/components/IslandContext.test.tsx @@ -1,12 +1,16 @@ import { render } from '@testing-library/react'; +import { DateTimeProvider } from './DateTimeContext'; import { Island } from './Island'; describe('IslandContext tracks nesting of islands', () => { test('Single island', () => { const { container } = render( - - 🏝️ - , + + + 🏝️ + + , + , ); const islands = container.querySelectorAll('gu-island'); expect(islands.length).toBe(1); @@ -14,13 +18,16 @@ describe('IslandContext tracks nesting of islands', () => { test('Nested island', () => { const { container } = render( - -
    - - 🏝️ - -
    -
    , + + +
    + + 🏝️ + +
    +
    + , +
    , ); const islands = container.querySelectorAll('gu-island'); expect(islands.length).toBe(1); @@ -28,20 +35,23 @@ describe('IslandContext tracks nesting of islands', () => { test('Multiple nested islands', () => { const { container } = render( - -
    - -
    - - 🏝️ - - - 🏝️ - -
    -
    -
    -
    , + + +
    + +
    + + 🏝️ + + + 🏝️ + +
    +
    +
    +
    + , +
    , ); const islands = container.querySelectorAll('gu-island'); expect(islands.length).toBe(1); @@ -49,13 +59,16 @@ describe('IslandContext tracks nesting of islands', () => { test('Parent island includes props for child islands', () => { const { container } = render( - -
    - - 🏝️ - -
    -
    , + + +
    + + 🏝️ + +
    +
    + , +
    , ); const island = container.querySelector('gu-island'); expect(island).toHaveAttribute( diff --git a/dotcom-rendering/src/components/MostViewedFooter.test.tsx b/dotcom-rendering/src/components/MostViewedFooter.test.tsx index 71b7427d641..83284fdf31c 100644 --- a/dotcom-rendering/src/components/MostViewedFooter.test.tsx +++ b/dotcom-rendering/src/components/MostViewedFooter.test.tsx @@ -1,6 +1,7 @@ import { fireEvent, render } from '@testing-library/react'; import { useApi as useApi_ } from '../lib/useApi'; import { ConfigProvider } from './ConfigContext'; +import { DateTimeProvider } from './DateTimeContext'; import { responseWithTwoTabs } from './MostViewed.mocks'; import { MostViewedFooterData } from './MostViewedFooterData.importable'; @@ -30,11 +31,13 @@ describe('MostViewedFooterData', () => { editionId: 'UK', }} > - + + + , ); @@ -73,11 +76,13 @@ describe('MostViewedFooterData', () => { editionId: 'UK', }} > - + + + , ); @@ -135,11 +140,13 @@ describe('MostViewedFooterData', () => { editionId: 'UK', }} > - + + + , ); @@ -182,11 +189,13 @@ describe('MostViewedFooterData', () => { editionId: 'UK', }} > - + + + , ); @@ -205,11 +214,13 @@ describe('MostViewedFooterData', () => { editionId: 'UK', }} > - + + + , ); diff --git a/dotcom-rendering/src/components/MostViewedRight.test.tsx b/dotcom-rendering/src/components/MostViewedRight.test.tsx index 3e1a83ecb30..bdd1226d610 100644 --- a/dotcom-rendering/src/components/MostViewedRight.test.tsx +++ b/dotcom-rendering/src/components/MostViewedRight.test.tsx @@ -1,6 +1,7 @@ import { render } from '@testing-library/react'; import { useApi as useApi_ } from '../lib/useApi'; import { ConfigProvider } from './ConfigContext'; +import { DateTimeProvider } from './DateTimeContext'; import { responseWithTwoTabs } from './MostViewed.mocks'; import { MostViewedRight } from './MostViewedRight'; @@ -27,7 +28,9 @@ describe('MostViewedList', () => { editionId: 'UK', }} > - + + + , ); @@ -77,7 +80,9 @@ describe('MostViewedList', () => { editionId: 'UK', }} > - + + + , ); @@ -106,7 +111,9 @@ describe('MostViewedList', () => { editionId: 'UK', }} > - + + + , );