diff --git a/base.scss b/base.scss index 359618de7..8c0d46496 100644 --- a/base.scss +++ b/base.scss @@ -111,6 +111,7 @@ @import "./src/stories/Library/card/card"; @import "./src/stories/Library/paragraphs/paragraphs"; @import "./src/stories/Library/video-embed/video-embed"; +@import "./src/stories/Library/video-embed/cookie-placeholder"; @import "./src/stories/Library/card-grid/card-grid"; @import "./src/stories/Library/promo-title/promo-title"; @import "./src/stories/Library/Modals/group-modal-item-skeleton"; diff --git a/src/stories/Library/paragraphs/Paragraphs.tsx b/src/stories/Library/paragraphs/Paragraphs.tsx index cba98fb9e..134911013 100644 --- a/src/stories/Library/paragraphs/Paragraphs.tsx +++ b/src/stories/Library/paragraphs/Paragraphs.tsx @@ -32,7 +32,12 @@ export const ArticleParagraphs = () => { - + diff --git a/src/stories/Library/video-embed/VideoEmbed.stories.tsx b/src/stories/Library/video-embed/VideoEmbed.stories.tsx index 4b4e8ca33..925d64d05 100644 --- a/src/stories/Library/video-embed/VideoEmbed.stories.tsx +++ b/src/stories/Library/video-embed/VideoEmbed.stories.tsx @@ -4,13 +4,32 @@ import VideoEmbed from "./VideoEmbed"; export default { title: "Library / Video Embed", component: VideoEmbed, + parameters: { + design: { + type: "figma", + url: "https://www.figma.com/design/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=16042-22933&t=kwXRJW0pZzoQmJHm-1", + }, + layout: "fullscreen", + }, argTypes: { + buttonText: { + defaultValue: "Manage consent", + type: "string", + }, + acceptCookies: { + control: "boolean", + defaultValue: false, + }, + info: { + defaultValue: + "To view this content, we need your consent to use marketing cookies.", + type: "string", + }, src: { defaultValue: "https://www.youtube.com/embed/CmzKQ3PSrow", type: "string", }, }, - parameters: {}, } as ComponentMeta; const Template: ComponentStory = (args) => ( diff --git a/src/stories/Library/video-embed/VideoEmbed.tsx b/src/stories/Library/video-embed/VideoEmbed.tsx index 37117103a..bbede99b3 100644 --- a/src/stories/Library/video-embed/VideoEmbed.tsx +++ b/src/stories/Library/video-embed/VideoEmbed.tsx @@ -1,20 +1,63 @@ -import { FC } from "react"; +import { FC, useState, useEffect } from "react"; +import { Button } from "../Buttons/button/Button"; type VideoEmbedProps = { + info: string; + buttonText: string; src: string; + acceptCookies: boolean; }; -const VideoEmbed: FC = ({ src }) => { +const VideoEmbed: FC = ({ + info, + buttonText, + src, + acceptCookies: acceptCookiesProp, +}: VideoEmbedProps) => { + const [acceptCookies, setAcceptCookies] = useState(acceptCookiesProp); + + useEffect(() => { + setAcceptCookies(acceptCookiesProp); + }, [acceptCookiesProp]); + + const handleButtonClick = () => { + setAcceptCookies(!acceptCookies); + }; + return (