Skip to content

Commit

Permalink
Fix types again #2014
Browse files Browse the repository at this point in the history
  • Loading branch information
padms committed Mar 5, 2024
1 parent 3f5859f commit 0ce5ae3
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const IframeCarousel = ({ data, anchor, ...rest }: IframeCarouselProps) => {
const { background } = designOptions

return (
<BackgroundContainer background={{ backgroundColor: background }} {...rest} id={anchor}>
<BackgroundContainer background={background} {...rest} id={anchor}>
<Container>
{title && <StyledHeading value={title} />}
<Carousel>
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/shared/ImageCarousel/ImageCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ImageCarousel = ({ data, anchor, ...rest }: ImageCarouselProps) => {
const { autoplay, delay } = options

return (
<BackgroundContainer background={{ backgroundColor: background }} {...rest} id={anchor}>
<BackgroundContainer background={background} {...rest} id={anchor}>
<Container>
{title && <StyledHeading value={title} />}
<Swiper
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/shared/VideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const VideoPlayer = ({ anchor, data }: { data: VideoPlayerData; anchor?: string
const { background } = designOptions

return (
<BackgroundContainer background={{ backgroundColor: background }} id={anchor}>
<BackgroundContainer background={background} id={anchor}>
<Container>
{title && <StyledHeading value={title} />}
{ingress && (
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/shared/VideoPlayerCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const VideoPlayer = ({ anchor, data }: { data: VideoPlayerCarouselData; anchor?:
const { background, aspectRatio } = designOptions

return (
<BackgroundContainer background={{ backgroundColor: background }} id={anchor}>
<BackgroundContainer background={background} id={anchor}>
{title && (
<HeadingWrapper>
<StyledHeading value={title} />
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/shared/iframe/BasicIFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const BasicIFrame = ({
const { height, aspectRatio, background } = designOptions

return (
<BackgroundContainer background={{ backgroundColor: background }} {...rest}>
<BackgroundContainer background={background} {...rest}>
<Container>
{title && <StyledHeading value={title} />}
<IFrame
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/topicPages/FullWidthVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const FullWidthVideo = ({ anchor, data }: { data: FullWidthVideoData; anchor?: s
const { video, designOptions, spacing } = data
const { background, aspectRatio } = designOptions
return (
<BackgroundContainer background={{ backgroundColor: background }} id={anchor}>
<BackgroundContainer background={background} id={anchor}>
<Container $aspectRatio={aspectRatio} style={spacing ? { marginTop: '50px', marginBottom: '50px' } : {}}>
<StyledFigure>
<StyledHLSPlayer src={video.url} title={video.title} playsInline autoPlay muted loop />
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/topicPages/IFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const IFrame = ({
const { height, aspectRatio, background } = designOptions

return (
<BackgroundContainer background={{ backgroundColor: background }} {...rest} id={anchor}>
<BackgroundContainer background={background} {...rest} id={anchor}>
<Container>
{title && <StyledHeading value={title} />}
{ingress && (
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/topicPages/StockValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const StockValues = ({ data: { designOptions }, anchor, ...rest }: { data: Stock
const { background } = designOptions

return (
<BackgroundContainer background={{ backgroundColor: background }} {...rest} id={anchor}>
<BackgroundContainer background={background} {...rest} id={anchor}>
<Container>
<Item>
<p>
Expand Down
2 changes: 1 addition & 1 deletion web/pageComponents/topicPages/TwitterEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const TwitterEmbed = ({ data, anchor }: TwitterEmbedProps) => {
}
return (
<>
<BackgroundContainer background={{ backgroundColor: designOptions.background }} id={anchor}>
<BackgroundContainer background={designOptions.background} id={anchor}>
<Container>
{title && <StyledTitle value={title} />}
{ingress && (
Expand Down
39 changes: 14 additions & 25 deletions web/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ export type DesignOptions = {
background?: {
backgroundColor?: BackgroundColours
}
imagePosition?: TeaserImagePosition
imageSize?: TeaserImageSize
backgroundOption?: BackgroundOption
}

Expand Down Expand Up @@ -317,7 +315,10 @@ export type TeaserData = {
isBigText?: boolean
image: ImageWithAlt
action?: LinkData
designOptions: DesignOptions
designOptions: DesignOptions & {
imagePosition?: TeaserImagePosition
imageSize?: TeaserImageSize
}
}

export type TextTeaserData = {
Expand Down Expand Up @@ -366,7 +367,7 @@ export type FullWidthImageData = {
type: string
id: string
image: ImageWithCaptionData
designOptions: {
designOptions: DesignOptions & {
aspectRatio: number
}
}
Expand All @@ -382,9 +383,8 @@ export type FullWidthVideoData = {
spacing?: boolean
title?: PortableTextBlock[]
action?: LinkData
designOptions: {
designOptions: DesignOptions & {
aspectRatio: FullWidthVideoRatio
background: BackgroundColours
}
}

Expand Down Expand Up @@ -418,7 +418,7 @@ export type QuoteData = {
authorTitle?: string
quote: string
image?: ImageWithAlt
designOptions: DesignOptions
designOptions: DesignOptions & { imagePosition?: TeaserImagePosition }
}

export type AccordionListData = {
Expand Down Expand Up @@ -525,10 +525,9 @@ export type IFrameData = {
frameTitle: string
url: string
cookiePolicy: CookiePolicy
designOptions: {
designOptions: DesignOptions & {
aspectRatio: string
height?: number
background: BackgroundColours
}
}

Expand Down Expand Up @@ -669,9 +668,7 @@ export type NewsListData = {
export type StockValuesData = {
id: string
type: string
designOptions: {
background: BackgroundColours
}
designOptions: DesignOptions
}

export type TwitterEmbedData = {
Expand All @@ -681,9 +678,7 @@ export type TwitterEmbedData = {
ingress?: PortableTextBlock[]
embedType: string
embedValue: string
designOptions: {
background: BackgroundColours
}
designOptions: DesignOptions
}

export type AnchorLinkData = {
Expand Down Expand Up @@ -715,7 +710,6 @@ export type VideoControlsType = {

export type VideoDesignOptionsType = {
aspectRatio: VideoPlayerRatios
background: BackgroundColours
height?: number
}

Expand All @@ -724,7 +718,7 @@ export type VideoPlayerData = {
type: string
video: VideoType
videoControls: VideoControlsType
designOptions: VideoDesignOptionsType
designOptions: DesignOptions & VideoDesignOptionsType
title?: PortableTextBlock[]
ingress?: PortableTextBlock[]
action?: LinkData
Expand All @@ -742,9 +736,8 @@ export type VideoPlayerCarouselData = {
thumbnail: ImageWithAlt
}
}[]
designOptions: {
designOptions: DesignOptions & {
aspectRatio: VideoPlayerRatios
background: BackgroundColours
}
title?: PortableTextBlock[]
}
Expand All @@ -767,9 +760,7 @@ export type ImageCarouselData = {
autoplay: boolean
delay: number
}
designOptions: {
background: BackgroundColours
}
designOptions: DesignOptions
}

export type IFrameCarouselItemData = {
Expand All @@ -791,9 +782,7 @@ export type IframeCarouselData = {
id: string
title?: PortableTextBlock[]
items: IFrameCarouselItemData[]
designOptions: {
background: BackgroundColours
}
designOptions: DesignOptions
}

export type ContactFormCatalogType = 'humanRightsInformationRequest' | 'loginIssues'
Expand Down

0 comments on commit 0ce5ae3

Please sign in to comment.