diff --git a/@types/generated/contentful.d.ts b/@types/generated/contentful.d.ts index b2b92035..650afc85 100644 --- a/@types/generated/contentful.d.ts +++ b/@types/generated/contentful.d.ts @@ -3,6 +3,33 @@ import { Asset, Entry } from "contentful"; import { Document } from "@contentful/rich-text-types"; +export interface IBannerFields { + /** text in banner */ + textInBanner: Document; + + /** action */ + action?: string | undefined; +} + +/** A banner to display timely-relevant information */ + +export interface IBanner extends Entry { + sys: { + id: string; + type: string; + createdAt: string; + updatedAt: string; + locale: string; + contentType: { + sys: { + id: "banner"; + linkType: "ContentType"; + type: "Link"; + }; + }; + }; +} + export interface IBlogpostFields { /** Titel */ title?: string | undefined; @@ -634,6 +661,7 @@ export interface IPageFields { | ITrackingGa | IBlogPreview | ITeamSection + | IBanner )[]; /** seo */ @@ -776,6 +804,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; @@ -854,6 +940,9 @@ export interface IVideoPlayerFields { /** Show only on german page */ showOnlyOnGermanPage?: boolean | undefined; + + /** video alignment */ + videoAlignment?: boolean | undefined; } /** Component to display videos */ @@ -876,6 +965,7 @@ export interface IVideoPlayer extends Entry { } export type CONTENT_TYPE = + | "banner" | "blogpost" | "BlogPreview" | "centeredContent" @@ -899,11 +989,14 @@ export type CONTENT_TYPE = | "supporter" | "tag" | "teamSection" + | "testimonials" + | "testimonialSection" | "trackingGa" | "twoImages" | "videoPlayer"; export type IEntry = + | IBanner | IBlogpost | IBlogPreview | ICenteredContent @@ -927,6 +1020,8 @@ export type IEntry = | ISupporter | ITag | ITeamSection + | ITestimonials + | ITestimonialSection | ITrackingGa | ITwoImages | IVideoPlayer; diff --git a/app/components/ContentBlocks.tsx b/app/components/ContentBlocks.tsx index e721a39c..4686dfc6 100644 --- a/app/components/ContentBlocks.tsx +++ b/app/components/ContentBlocks.tsx @@ -1,4 +1,5 @@ import type { + IBannerFields, IBlogpostFields, ICenteredContentFields, IContentImageBgFields, @@ -13,6 +14,7 @@ import type { IVideoPlayerFields, LOCALE_CODE, } from "../../@types/generated/contentful"; +import Banner from "./ContentBlocks/Banner"; import ContentBlockBlogPreview from "./ContentBlocks/BlogPreview"; import ContentBlockCentered from "./ContentBlocks/Centered"; import ContentBlockImageCollection from "./ContentBlocks/ContentBlockImageCollection"; @@ -123,7 +125,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 +136,7 @@ export default function ContentBlocks({ content, locale }: ContentBlockProps) { key={item.sys.id} videoId={videoId} content={content} + videoAlignment={videoAlignment} /> ); } @@ -182,6 +185,17 @@ export default function ContentBlocks({ content, locale }: ContentBlockProps) { ); } + if (id === "banner") { + const { textInBanner, action } = item.fields as IBannerFields; + return ( + + ); + } + if (id === "coachList") { return null; } else { diff --git a/app/components/ContentBlocks/Banner.tsx b/app/components/ContentBlocks/Banner.tsx new file mode 100644 index 00000000..b174bf3e --- /dev/null +++ b/app/components/ContentBlocks/Banner.tsx @@ -0,0 +1,12 @@ +import type { IBannerFields } from "../../../@types/generated/contentful"; +import ContentfulRichText from "../ContentfulRichText"; + +export default function Banner({ textInBanner, action }: IBannerFields) { + return ( +
+ + + +
+ ); +} diff --git a/app/components/ContentBlocks/VideoPlayer.tsx b/app/components/ContentBlocks/VideoPlayer.tsx index f4bc978a..03a0031f 100644 --- a/app/components/ContentBlocks/VideoPlayer.tsx +++ b/app/components/ContentBlocks/VideoPlayer.tsx @@ -1,13 +1,36 @@ 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 && } -
-
+
+ {content && ( +
+ +
+ )} +