diff --git a/dotcom-rendering/src/layouts/AudioLayout.stories.tsx b/dotcom-rendering/src/layouts/AudioLayout.stories.tsx deleted file mode 100644 index 9227a2e43d9..00000000000 --- a/dotcom-rendering/src/layouts/AudioLayout.stories.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react-webpack5'; -import { allModes } from '../../.storybook/modes'; -import { Audio as AudioFixture } from '../../fixtures/generated/fe-articles/Audio'; -import { ArticleDesign } from '../lib/articleFormat'; -import { getCurrentPillar } from '../lib/layoutHelpers'; -import { extractNAV } from '../model/extract-nav'; -import { enhanceArticleType } from '../types/article'; -import { AudioLayout } from './AudioLayout'; - -const meta = { - title: 'Layouts/Audio', - component: AudioLayout, -} satisfies Meta; - -export default meta; - -type Story = StoryObj; - -const appsArticle = enhanceArticleType(AudioFixture, 'Apps'); - -if (appsArticle.design !== ArticleDesign.Audio) { - throw new Error( - `Expected ArticleDesign.Audio, got: ${String(appsArticle.design)}`, - ); -} - -export const Apps: Story = { - args: { - renderingTarget: 'Apps', - article: appsArticle.frontendData, - format: { - design: appsArticle.design, - display: appsArticle.display, - theme: appsArticle.theme, - }, - }, - parameters: { - formats: [ - { - design: appsArticle.design, - display: appsArticle.display, - theme: appsArticle.theme, - }, - ], - config: { - renderingTarget: 'Apps', - darkModeAvailable: true, - }, - chromatic: { - modes: { - 'light mobileMedium': allModes['light mobileMedium'], - }, - }, - }, -}; - -const webArticle = enhanceArticleType(AudioFixture, 'Web'); - -if (webArticle.design !== ArticleDesign.Audio) { - throw new Error( - `Expected ArticleDesign.Audio, got: ${String(webArticle.design)}`, - ); -} - -export const Web: Story = { - args: { - renderingTarget: 'Web', - NAV: { - ...extractNAV(webArticle.frontendData.nav), - selectedPillar: getCurrentPillar(webArticle.frontendData), - }, - article: webArticle.frontendData, - format: { - design: webArticle.design, - display: webArticle.display, - theme: webArticle.theme, - }, - }, - parameters: { - formats: [ - { - design: webArticle.design, - display: webArticle.display, - theme: webArticle.theme, - }, - ], - chromatic: { - modes: { - 'light leftCol': allModes['light leftCol'], - }, - }, - }, -}; diff --git a/dotcom-rendering/src/layouts/AudioLayout.tsx b/dotcom-rendering/src/layouts/AudioLayout.tsx deleted file mode 100644 index 7a1260aaca5..00000000000 --- a/dotcom-rendering/src/layouts/AudioLayout.tsx +++ /dev/null @@ -1,725 +0,0 @@ -import { css } from '@emotion/react'; -import { - from, - palette as sourcePalette, - until, -} from '@guardian/source/foundations'; -import { StraightLines } from '@guardian/source-development-kitchen/react-components'; -import { AdPortals } from '../components/AdPortals.island'; -import { AdSlot, MobileStickyContainer } from '../components/AdSlot.web'; -import { AffiliateDisclaimer } from '../components/AffiliateDisclaimer'; -import { AppsFooter } from '../components/AppsFooter.island'; -import { ArticleBody } from '../components/ArticleBody'; -import { ArticleContainer } from '../components/ArticleContainer'; -import { ArticleHeadline } from '../components/ArticleHeadline'; -import { ArticleMetaApps } from '../components/ArticleMeta.apps'; -import { ArticleMeta } from '../components/ArticleMeta.web'; -import { ArticleTitle } from '../components/ArticleTitle'; -import { Border } from '../components/Border'; -import { Carousel } from '../components/Carousel.island'; -import { DirectoryPageNavIsland } from '../components/DirectoryPageNavIsland'; -import { DiscussionLayout } from '../components/DiscussionLayout'; -import { Footer } from '../components/Footer'; -import { GridItem } from '../components/GridItem'; -import { HeaderAdSlot } from '../components/HeaderAdSlot'; -import { Island } from '../components/Island'; -import { LabsHeader } from '../components/LabsHeader'; -import { MainMedia } from '../components/MainMedia'; -import { Masthead } from '../components/Masthead/Masthead'; -import { MostViewedFooterData } from '../components/MostViewedFooterData.island'; -import { MostViewedFooterLayout } from '../components/MostViewedFooterLayout'; -import { MostViewedRightWithAd } from '../components/MostViewedRightWithAd.island'; -import { OnwardsUpper } from '../components/OnwardsUpper.island'; -import { RightColumn } from '../components/RightColumn'; -import { Section } from '../components/Section'; -import { SlotBodyEnd } from '../components/SlotBodyEnd.island'; -import { Standfirst } from '../components/Standfirst'; -import { StickyBottomBanner } from '../components/StickyBottomBanner.island'; -import { SubMeta } from '../components/SubMeta'; -import { SubNav } from '../components/SubNav.island'; -import { type ArticleFormat, ArticleSpecial } from '../lib/articleFormat'; -import { canRenderAds } from '../lib/canRenderAds'; -import { getContributionsServiceUrl } from '../lib/contributions'; -import { decideStoryPackageTrails } from '../lib/decideTrail'; -import { parse } from '../lib/slot-machine-flags'; -import { worldCupTagId } from '../lib/worldCup2026'; -import type { NavType } from '../model/extract-nav'; -import { palette as themePalette } from '../palette'; -import type { ArticleDeprecated } from '../types/article'; -import type { RenderingTarget } from '../types/renderingTarget'; -import { BannerWrapper, Stuck } from './lib/stickiness'; - -const AudioGrid = ({ children }: { children: React.ReactNode }) => ( -
- {children} -
-); - -const maxWidth = css` - ${from.desktop} { - max-width: 620px; - } -`; - -interface Props { - article: ArticleDeprecated; - format: ArticleFormat; - renderingTarget: RenderingTarget; - serverTime?: number; -} - -interface WebProps extends Props { - NAV: NavType; - renderingTarget: 'Web'; -} - -interface AppProps extends Props { - renderingTarget: 'Apps'; -} - -export const AudioLayout = (props: WebProps | AppProps) => { - const { article, format, renderingTarget, serverTime } = props; - const isWeb = renderingTarget === 'Web'; - const isApps = renderingTarget === 'Apps'; - - const { - config: { isPaidContent, host, hasSurveyAd }, - editionId, - } = article; - - const showBodyEndSlot = parse(article.slotMachineFlags ?? '').showBodyEnd; - - const showComments = article.isCommentable && !isPaidContent; - - const { branding } = article.commercialProperties[article.editionId]; - - const contributionsServiceUrl = getContributionsServiceUrl(article); - - const isLabs = format.theme === ArticleSpecial.Labs; - - const isWorldCup2026 = article.tags.some((tag) => tag.id === worldCupTagId); - - const renderAds = canRenderAds(article); - - return ( - <> - {isWeb && ( -
- {renderAds && ( - -
- -
-
- )} - tag.id)} - contentType={article.contentType} - /> -
- )} - - {isWeb && format.theme === ArticleSpecial.Labs && ( - -
- -
-
- )} - - {isWeb && renderAds && hasSurveyAd && ( - - )} - -
- {isApps && renderAds && ( - - - - )} - - -
- - - - - - {format.theme === ArticleSpecial.Labs ? ( - <> - ) : ( - - )} - - -
- -
-
- -
- {renderingTarget === 'Web' ? ( - - ) : ( - - )} - {!!article.affiliateLinksDisclaimer && ( - - )} -
-
- - - - - - - - - - {isWeb && showBodyEndSlot && ( - - - - )} - - - - - - {isWeb && ( -
- - - - - -
- )} -
-
-
- - {isWeb && renderAds && !isLabs && ( -
- -
- )} - - {article.storyPackage && ( -
- - - -
- )} - - - - - {isWeb && showComments && ( -
- -
- )} - - {!isPaidContent && ( -
- - - - - -
- )} - - {isWeb && renderAds && !isLabs && ( -
- -
- )} -
- - {isWeb && ( - <> - {props.NAV.subNavSections && ( -
- - - -
- )} -
-
-
- - - - - - {renderAds && ( - - )} - - )} - {isApps && ( -
- - - -
- )} - - ); -}; diff --git a/dotcom-rendering/src/layouts/DecideLayout.tsx b/dotcom-rendering/src/layouts/DecideLayout.tsx index e0cc0efee13..77803138313 100644 --- a/dotcom-rendering/src/layouts/DecideLayout.tsx +++ b/dotcom-rendering/src/layouts/DecideLayout.tsx @@ -2,7 +2,6 @@ import { ArticleDesign, ArticleDisplay } from '../lib/articleFormat'; import type { NavType } from '../model/extract-nav'; import type { Article } from '../types/article'; import type { RenderingTarget } from '../types/renderingTarget'; -import { AudioLayout } from './AudioLayout'; import { CommentLayout } from './CommentLayout'; import { CrosswordLayout } from './CrosswordLayout'; import { FullPageInteractiveLayout } from './FullPageInteractiveLayout'; @@ -194,15 +193,6 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => { renderingTarget={renderingTarget} /> ); - case ArticleDesign.Audio: - return ( - - ); default: return ( { serverTime={serverTime} /> ); - case ArticleDesign.Audio: - return ( - - ); case ArticleDesign.Crossword: return ( ; + +export default meta; + +type Story = StoryObj; + +const appsAudioArticle = enhanceArticleType(AudioFixture, 'Apps'); + +if (appsAudioArticle.design !== ArticleDesign.Audio) { + throw new Error( + `Expected ArticleDesign.Audio, got: ${String(appsAudioArticle.design)}`, + ); +} + +export const AppsAudio: Story = { + args: { + renderingTarget: 'Apps', + article: appsAudioArticle.frontendData, + format: { + design: appsAudioArticle.design, + display: appsAudioArticle.display, + theme: appsAudioArticle.theme, + }, + }, + parameters: { + formats: [ + { + design: appsAudioArticle.design, + display: appsAudioArticle.display, + theme: appsAudioArticle.theme, + }, + ], + config: { + renderingTarget: 'Apps', + darkModeAvailable: true, + }, + chromatic: { + modes: { + 'light mobileMedium': allModes['light mobileMedium'], + }, + }, + }, +}; + +const webAudioArticle = enhanceArticleType(AudioFixture, 'Web'); + +if (webAudioArticle.design !== ArticleDesign.Audio) { + throw new Error( + `Expected ArticleDesign.Audio, got: ${String(webAudioArticle.design)}`, + ); +} + +export const WebAudio: Story = { + args: { + renderingTarget: 'Web', + NAV: { + ...extractNAV(webAudioArticle.frontendData.nav), + selectedPillar: getCurrentPillar(webAudioArticle.frontendData), + }, + article: webAudioArticle.frontendData, + format: { + design: webAudioArticle.design, + display: webAudioArticle.display, + theme: webAudioArticle.theme, + }, + }, + parameters: { + formats: [ + { + design: webAudioArticle.design, + display: webAudioArticle.display, + theme: webAudioArticle.theme, + }, + ], + chromatic: { + modes: { + 'light leftCol': allModes['light leftCol'], + }, + }, + }, +}; diff --git a/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx b/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx index 4d6aab78791..84fb7928e6d 100644 --- a/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx +++ b/dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx @@ -111,8 +111,6 @@ export const StandardLayoutArticleGrid = ({ format.design === ArticleDesign.Audio; const isShowcase = format.display === ArticleDisplay.Showcase; - const isVideo = format.design === ArticleDesign.Video; - const footballMatchUrl = article.matchType === 'FootballMatchType' ? article.matchUrl @@ -187,18 +185,20 @@ export const StandardLayoutArticleGrid = ({ -
- {isWeb && - format.theme === ArticleSpecial.Labs && - format.design !== ArticleDesign.Video ? ( - - ) : ( - - )} -
+ {format.design !== ArticleDesign.Audio && ( +
+ {isWeb && + format.theme === ArticleSpecial.Labs && + format.design !== ArticleDesign.Video ? ( + + ) : ( + + )} +
+ )} {isApps ? ( <> @@ -279,7 +279,7 @@ export const StandardLayoutArticleGrid = ({ {/* Only show Listen to Article button on App landscape views */} {isApps && ( - {!isVideo && ( + {!isMedia && (