From e0fbbf8c1f5ee0bca1390a62a9fe62d456958d02 Mon Sep 17 00:00:00 2001 From: Nastya Date: Thu, 4 Jan 2024 21:38:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B2=D0=B8=D0=B4=D0=B5=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StartPageViewPublication.tsx | 2 + src/pages/createQuize/QuizCard.tsx | 2 +- src/pages/startPage/StartPageSettings.tsx | 89 ++++++++++++++----- .../StartPagePreview/YoutubeEmbedIframe.tsx | 20 ++++- 4 files changed, 89 insertions(+), 24 deletions(-) diff --git a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx index 1cbbdac9..1f48c65c 100644 --- a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx +++ b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx @@ -84,6 +84,8 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { ) : null ) : null; + console.log(background) + return ( +{quiz.config.startpage.background.type === "image" && - - - updateQuiz(quiz.id, (quiz) => { - quiz.config.startpage.background.video = e.target.value; - }) - } - /> - +} +{quiz.config.startpage.background.type === "video" && <> + + + Добавить видео + + + + + + + + + { + const file = event.target.files?.[0]; + if (file) { + uploadQuizImage(quiz.id, file, (quiz, url) => { + quiz.config.startpage.background.video = url; + }); + // setVideo(URL.createObjectURL(file)); + } + + }} + hidden + accept=".mp4" + multiple + type="file" + /> + } + sx={{ + height: "48px", + width: "48px", + }} + /> + + {quiz.config.startpage.background.video ?