Skip to content

Commit

Permalink
replace AspectRatio type previously from CardPicture with the one def…
Browse files Browse the repository at this point in the history
…ined in types/front
  • Loading branch information
Georges-GNM committed Nov 20, 2024
1 parent e00fdc9 commit 9b22e71
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion dotcom-rendering/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/CardPicture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImgHTMLAttributes<unknown>['loading']>;
export type AspectRatio = '5:3' | '5:4' | '4:5';

type Props = {
imageSize: ImageSizeType;
Expand Down
3 changes: 2 additions & 1 deletion dotcom-rendering/src/components/FeatureCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/MaintainAspectRatio.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@emotion/react';
import type { AspectRatio } from './CardPicture';
import type { AspectRatio } from '../types/front';

type Props = {
height: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ImagePositionType,
ImageSizeType,
} from './Card/components/ImageWrapper';
import type { AspectRatio } from './CardPicture';
import type { AspectRatio } from '../types/front';

Check failure on line 12 in dotcom-rendering/src/components/YoutubeBlockComponent.importable.tsx

View workflow job for this annotation

GitHub Actions / lint / check

`../types/front` type import should occur before import of `./Caption`
import { useConfig } from './ConfigContext';
import { ophanTrackerApps, ophanTrackerWeb } from './YoutubeAtom/eventEmitters';
import { YoutubeAtom } from './YoutubeAtom/YoutubeAtom';
Expand Down

0 comments on commit 9b22e71

Please sign in to comment.