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 ?