From b2d41824dc7bd5a94636c9234d737419d1499996 Mon Sep 17 00:00:00 2001 From: Georges Lebreton <102960844+Georges-GNM@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:07:32 +0000 Subject: [PATCH] replace AspectRatio type previously from CardPicture with the one defined in types/front --- dotcom-rendering/src/components/Card/Card.tsx | 3 ++- dotcom-rendering/src/components/CardPicture.tsx | 2 +- dotcom-rendering/src/components/FeatureCard.tsx | 3 ++- dotcom-rendering/src/components/MaintainAspectRatio.tsx | 2 +- dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx | 2 +- .../src/components/YoutubeAtom/YoutubeAtomOverlay.tsx | 2 +- .../src/components/YoutubeBlockComponent.importable.tsx | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dotcom-rendering/src/components/Card/Card.tsx b/dotcom-rendering/src/components/Card/Card.tsx index 3bc2f3afdd2..3b35840725b 100644 --- a/dotcom-rendering/src/components/Card/Card.tsx +++ b/dotcom-rendering/src/components/Card/Card.tsx @@ -14,6 +14,7 @@ import { palette } from '../../palette'; import type { Branding } from '../../types/branding'; import type { StarRating as Rating } from '../../types/content'; import type { + AspectRatio, DCRContainerPalette, DCRContainerType, DCRFrontImage, @@ -26,7 +27,7 @@ import type { OnwardsSource } from '../../types/onwards'; import { Avatar } from '../Avatar'; import { CardCommentCount } from '../CardCommentCount.importable'; import { CardHeadline, type ResponsiveFontSize } from '../CardHeadline'; -import type { AspectRatio, Loading } from '../CardPicture'; +import type { Loading } from '../CardPicture'; import { CardPicture } from '../CardPicture'; import { Island } from '../Island'; import { LatestLinks } from '../LatestLinks.importable'; diff --git a/dotcom-rendering/src/components/CardPicture.tsx b/dotcom-rendering/src/components/CardPicture.tsx index 798a1afa2f4..772d9ec599f 100644 --- a/dotcom-rendering/src/components/CardPicture.tsx +++ b/dotcom-rendering/src/components/CardPicture.tsx @@ -2,12 +2,12 @@ import { css } from '@emotion/react'; import { breakpoints, space } from '@guardian/source/foundations'; import type { ImgHTMLAttributes } from 'react'; import React from 'react'; +import type { AspectRatio } from '../types/front'; import type { ImageSizeType } from './Card/components/ImageWrapper'; import type { ImageWidthType } from './Picture'; import { generateSources, getFallbackSource } from './Picture'; export type Loading = NonNullable['loading']>; -export type AspectRatio = '5:3' | '5:4' | '4:5'; type Props = { imageSize: ImageSizeType; diff --git a/dotcom-rendering/src/components/FeatureCard.tsx b/dotcom-rendering/src/components/FeatureCard.tsx index 7a22c8d128b..6fa4b9ac6fc 100644 --- a/dotcom-rendering/src/components/FeatureCard.tsx +++ b/dotcom-rendering/src/components/FeatureCard.tsx @@ -7,6 +7,7 @@ import { DISCUSSION_ID_DATA_ATTRIBUTE } from '../lib/useCommentCount'; import { palette } from '../palette'; import type { StarRating as Rating } from '../types/content'; import type { + AspectRatio, DCRContainerPalette, DCRFrontImage, DCRSupportingContent, @@ -22,7 +23,7 @@ import type { import { TrailText } from './Card/components/TrailText'; import { CardCommentCount } from './CardCommentCount.importable'; import { CardHeadline, type ResponsiveFontSize } from './CardHeadline'; -import type { AspectRatio, Loading } from './CardPicture'; +import type { Loading } from './CardPicture'; import { CardPicture } from './CardPicture'; import { ContainerOverrides } from './ContainerOverrides'; import { FormatBoundary } from './FormatBoundary'; diff --git a/dotcom-rendering/src/components/MaintainAspectRatio.tsx b/dotcom-rendering/src/components/MaintainAspectRatio.tsx index f0cf8cd0c60..f348df07ca0 100644 --- a/dotcom-rendering/src/components/MaintainAspectRatio.tsx +++ b/dotcom-rendering/src/components/MaintainAspectRatio.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/react'; -import type { AspectRatio } from './CardPicture'; +import type { AspectRatio } from '../types/front'; type Props = { height: number; diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx index 175debe4419..c95843d9fa5 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtom.tsx @@ -3,12 +3,12 @@ import type { ConsentState } from '@guardian/libs'; import { useCallback, useState } from 'react'; import type { ArticleFormat } from '../../lib/articleFormat'; import type { AdTargeting } from '../../types/commercial'; +import type { AspectRatio } from '../../types/front'; import type { RenderingTarget } from '../../types/renderingTarget'; import type { ImagePositionType, ImageSizeType, } from '../Card/components/ImageWrapper'; -import type { AspectRatio } from '../CardPicture'; import { MaintainAspectRatio } from '../MaintainAspectRatio'; import type { VideoCategory } from './YoutubeAtomOverlay'; import { YoutubeAtomOverlay } from './YoutubeAtomOverlay'; diff --git a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx index 8a45884499a..2523669a105 100644 --- a/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx +++ b/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomOverlay.tsx @@ -10,12 +10,12 @@ import { } from '@guardian/source/foundations'; import type { ArticleFormat } from '../../lib/articleFormat'; import { palette } from '../../palette'; +import type { AspectRatio } from '../../types/front'; import type { ImagePositionType, ImageSizeType, } from '../Card/components/ImageWrapper'; import { PlayIcon } from '../Card/components/PlayIcon'; -import type { AspectRatio } from '../CardPicture'; import { FormatBoundary } from '../FormatBoundary'; import { Kicker } from '../Kicker'; import { secondsToDuration } from '../MediaDuration'; diff --git a/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx b/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx index 9a65e63d57e..8ab21422a34 100644 --- a/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx +++ b/dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx @@ -4,12 +4,12 @@ import type { ArticleFormat } from '../lib/articleFormat'; import { useAB } from '../lib/useAB'; import { useAdTargeting } from '../lib/useAdTargeting'; import type { AdTargeting } from '../types/commercial'; +import type { AspectRatio } from '../types/front'; import { Caption } from './Caption'; import type { ImagePositionType, ImageSizeType, } from './Card/components/ImageWrapper'; -import type { AspectRatio } from './CardPicture'; import { useConfig } from './ConfigContext'; import { ophanTrackerApps, ophanTrackerWeb } from './YoutubeAtom/eventEmitters'; import { YoutubeAtom } from './YoutubeAtom/YoutubeAtom';