From 010d2262b68571862cd4da63f34528ec6ca898b4 Mon Sep 17 00:00:00 2001 From: Nastya Date: Mon, 18 Dec 2023 02:29:31 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8-=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B9=D0=BA=D0=B8=20=D0=B8=D0=B7=20=D0=B8=D0=BD=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BB=D0=BB=D0=B0=20=D0=BE=D0=BF=D1=80=D0=BE=D1=81=D0=BD?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0,=20=D1=84=D1=83=D1=82=D0=B5=D1=80=20=D0=BE?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D1=8F=D0=B5=D1=82=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=D1=83=D0=BB=D1=82=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/InstallQuiz/InstallQuiz.tsx | 10 ---------- src/pages/ViewPublicationPage/ApologyPage.tsx | 5 +++-- src/pages/ViewPublicationPage/Footer.tsx | 2 ++ src/pages/ViewPublicationPage/Question.tsx | 2 +- src/pages/createQuize/FirstQuiz.tsx | 6 +++++- src/pages/createQuize/MyQuizzesFull.tsx | 6 +++++- src/pages/startPage/EditPage.tsx | 3 ++- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/pages/InstallQuiz/InstallQuiz.tsx b/src/pages/InstallQuiz/InstallQuiz.tsx index b2a9a984..fe8d086f 100644 --- a/src/pages/InstallQuiz/InstallQuiz.tsx +++ b/src/pages/InstallQuiz/InstallQuiz.tsx @@ -247,16 +247,6 @@ export default function InstallQuiz() { Не опубликован - - ) diff --git a/src/pages/ViewPublicationPage/ApologyPage.tsx b/src/pages/ViewPublicationPage/ApologyPage.tsx index 658abd54..ac275375 100644 --- a/src/pages/ViewPublicationPage/ApologyPage.tsx +++ b/src/pages/ViewPublicationPage/ApologyPage.tsx @@ -1,12 +1,13 @@ import { Box, Typography } from "@mui/material"; -export const ApologyPage = (message: string) => { +export const ApologyPage = ({message}:{message: string}) => { return ( id === question.id); const nextQuestion = questions[questionIndex + 1]; + console.log("questionIndex ", questionIndex); console.log(nextQuestion); + console.log(questions); if (nextQuestion && nextQuestion.type !== "result") { console.log("следующий вопрос результирующий ", nextQuestion.type === "result"); setCurrentQuestion(nextQuestion); diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index d46d7760..a0e9128a 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -98,7 +98,7 @@ export const Question = ({ questions }: QuestionProps) => { /> )} {showResultForm && quiz?.config.resultInfo.when === "after" && ( - createQuiz(navigate)} + onClick={() => { + resetEditConfig() + createQuiz(navigate) + }} > Создать + diff --git a/src/pages/createQuize/MyQuizzesFull.tsx b/src/pages/createQuize/MyQuizzesFull.tsx index 2254f08e..1ccf6a6e 100644 --- a/src/pages/createQuize/MyQuizzesFull.tsx +++ b/src/pages/createQuize/MyQuizzesFull.tsx @@ -4,6 +4,7 @@ import { useQuizes } from "@root/quizes/hooks"; import SectionWrapper from "@ui_kit/SectionWrapper"; import React from "react"; import { useNavigate } from "react-router-dom"; +import { resetEditConfig } from "@root/quizes/actions"; import ComplexNavText from "./ComplexNavText"; import FirstQuiz from "./FirstQuiz"; import QuizCard from "./QuizCard"; @@ -42,7 +43,10 @@ export default function MyQuizzesFull({ outerContainerSx: sx, children }: Props) padding: isMobile ? "10px" : "10px 47px", minWidth: "44px", }} - onClick={() => createQuiz(navigate)} + onClick={() => { + resetEditConfig(); + createQuiz(navigate) + }} data-cy="create-quiz" > {isMobile ? "+" : "Создать +"} diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index ca8835f7..a737756b 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -27,7 +27,7 @@ import Stepper from "@ui_kit/Stepper"; import SwitchStepPages from "@ui_kit/switchStepPages"; import { isAxiosError } from "axios"; import { enqueueSnackbar } from "notistack"; -import React, { useEffect, useState } from "react"; +import React, { useEffect, useLayoutEffect, useState } from "react"; import { Link, useNavigate } from "react-router-dom"; import useSWR from "swr"; import { SidebarMobile } from "./Sidebar/SidebarMobile"; @@ -77,6 +77,7 @@ export default function EditPage() { }, [] ); + console.log(currentStep) return ( <>