fix:переключение логики ветвления после переделки main

This commit is contained in:
Tamara 2024-01-04 14:00:13 +03:00
parent 97b2d3ac97
commit d35b65fc05
4 changed files with 20 additions and 10 deletions

@ -103,14 +103,14 @@ dayjs.locale("ru");
const routeslink = [
{
path: "/edit",
page: <EditPage />,
page: EditPage,
header: true,
sidebar: true,
footer: true,
},
{
path: "/design",
page: <DesignPage />,
page: DesignPage,
header: true,
sidebar: true,
footer: true,
@ -200,7 +200,7 @@ export default function App() {
path={e.path}
element={
<Main
page={e.page}
Page={e.page}
header={e.header}
sidebar={e.sidebar}
footer={e.footer}

@ -9,9 +9,9 @@ export const BackButtonIcon = () => (
<path
d="M7.86747 18C8.26104 18 9.9253 18 13.4337 18C17.8193 18 19 14.703 19 13.2194C19 11.7358 17.8193 8.93333 13.4337 8.93333C10.1773 8.93333 6.59726 8.93333 5 8.93333M5 8.93333L7.86747 6M5 8.93333L7.86747 11.8182"
stroke="white"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);

@ -27,7 +27,7 @@ interface Props {
sidebar: boolean;
header?: boolean;
footer?: boolean;
Page: JSX.Element;
Page?: React.Component;
}
export default function Main({ sidebar, header, footer, Page }: Props) {
@ -132,7 +132,10 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
boxSizing: "border-box",
}}
>
<Page state={openBranchingPage} HC={openBranchingPageHC} />
<Page
openBranchingPage={openBranchingPage}
setOpenBranchingPage={openBranchingPageHC}
/>
</Box>
{footer && (

@ -42,7 +42,14 @@ import { ModalInfoWhyCantCreate } from "./ModalInfoWhyCantCreate";
import { ConfirmLeaveModal } from "./ConfirmLeaveModal";
import { checkQuestionHint } from "@utils/checkQuestionHint";
export default function EditPage() {
interface Props {
openBranchingPage: boolean;
setOpenBranchingPage: (a: boolean) => void;
}
export default function EditPage({
openBranchingPage,
setOpenBranchingPage,
}: Props) {
const quiz = useCurrentQuiz();
const { editQuizId } = useQuizStore();
const { questions } = useQuestionsStore();
@ -55,7 +62,7 @@ export default function EditPage() {
const isMobile = useMediaQuery(theme.breakpoints.down(660));
const [nextStep, setNextStep] = useState<number>(0);
const quizConfig = quiz?.config;
const [openBranchingPage, setOpenBranchingPage] = useState<boolean>(false);
// const [openBranchingPage, setOpenBranchingPage] = useState<boolean>(false);
useEffect(() => {
if (editQuizId === null) navigate("/list");