From 827ef80bf91e2dd317ce10bffc41367e6f37f9cb Mon Sep 17 00:00:00 2001 From: NoeliaEle <88032788+NoeliaEle@users.noreply.github.com> Date: Fri, 12 Apr 2024 19:50:36 +0200 Subject: [PATCH 1/6] run contentful codegen --- @types/generated/contentful.d.ts | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/@types/generated/contentful.d.ts b/@types/generated/contentful.d.ts index b2b92035..22b74dcb 100644 --- a/@types/generated/contentful.d.ts +++ b/@types/generated/contentful.d.ts @@ -776,6 +776,64 @@ export interface ITeamSection extends Entry { }; } +export interface ITestimonialsFields { + /** image */ + image?: Asset | undefined; + + /** link */ + link?: string | undefined; + + /** testimonialText */ + testimonialText?: string | undefined; + + /** author */ + author?: string | undefined; +} + +export interface ITestimonials extends Entry { + sys: { + id: string; + type: string; + createdAt: string; + updatedAt: string; + locale: string; + contentType: { + sys: { + id: "testimonials"; + linkType: "ContentType"; + type: "Link"; + }; + }; + }; +} + +export interface ITestimonialSectionFields { + /** Title */ + title: string; + + /** Testimonials */ + testimonials: ITestimonials[]; +} + +/** Here you can find the testimonials grouped */ + +export interface ITestimonialSection extends Entry { + sys: { + id: string; + type: string; + createdAt: string; + updatedAt: string; + locale: string; + contentType: { + sys: { + id: "testimonialSection"; + linkType: "ContentType"; + type: "Link"; + }; + }; + }; +} + export interface ITrackingGaFields { /** Title */ title: string; @@ -899,6 +957,8 @@ export type CONTENT_TYPE = | "supporter" | "tag" | "teamSection" + | "testimonials" + | "testimonialSection" | "trackingGa" | "twoImages" | "videoPlayer"; @@ -927,6 +987,8 @@ export type IEntry = | ISupporter | ITag | ITeamSection + | ITestimonials + | ITestimonialSection | ITrackingGa | ITwoImages | IVideoPlayer; From d1db1e7e1a0316ea8e51ba0bf92bcdf85d1d6294 Mon Sep 17 00:00:00 2001 From: NoeliaEle <88032788+NoeliaEle@users.noreply.github.com> Date: Fri, 12 Apr 2024 20:16:38 +0200 Subject: [PATCH 2/6] Add video alignment prop on video content item --- @types/generated/contentful.d.ts | 3 +++ app/components/ContentBlocks.tsx | 3 ++- app/components/ContentBlocks/VideoPlayer.tsx | 18 +++++++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/@types/generated/contentful.d.ts b/@types/generated/contentful.d.ts index 22b74dcb..9d9074c4 100644 --- a/@types/generated/contentful.d.ts +++ b/@types/generated/contentful.d.ts @@ -912,6 +912,9 @@ export interface IVideoPlayerFields { /** Show only on german page */ showOnlyOnGermanPage?: boolean | undefined; + + /** video alignment */ + videoAlignment?: boolean | undefined; } /** Component to display videos */ diff --git a/app/components/ContentBlocks.tsx b/app/components/ContentBlocks.tsx index e721a39c..bc4bcb83 100644 --- a/app/components/ContentBlocks.tsx +++ b/app/components/ContentBlocks.tsx @@ -123,7 +123,7 @@ export default function ContentBlocks({ content, locale }: ContentBlockProps) { } if (id === "videoPlayer") { - const { videoId, content, showOnlyOnGermanPage } = + const { videoId, content, showOnlyOnGermanPage, videoAlignment } = item.fields as IVideoPlayerFields; if ( !showOnlyOnGermanPage || @@ -134,6 +134,7 @@ export default function ContentBlocks({ content, locale }: ContentBlockProps) { key={item.sys.id} videoId={videoId} content={content} + videoAlignment={videoAlignment} /> ); } diff --git a/app/components/ContentBlocks/VideoPlayer.tsx b/app/components/ContentBlocks/VideoPlayer.tsx index f4bc978a..46412d29 100644 --- a/app/components/ContentBlocks/VideoPlayer.tsx +++ b/app/components/ContentBlocks/VideoPlayer.tsx @@ -1,13 +1,25 @@ import type { IVideoPlayerFields } from "../../../@types/generated/contentful"; import ContentfulRichText from "../ContentfulRichText"; -export default function VideoPlayer({ videoId, content }: IVideoPlayerFields) { +export default function VideoPlayer({ + videoId, + content, + videoAlignment, +}: IVideoPlayerFields) { return (
-
+
{content && }
-
+