центрация стартовой, форма контактов и модалка загрузки изображений

This commit is contained in:
Tamara 2024-01-05 23:59:40 +03:00
parent 24e0006a38
commit b47d095901
8 changed files with 16 additions and 11 deletions

@ -59,7 +59,9 @@ export const ResultSettings = () => {
useEffect(() => {
//Всегда должен существовать хоть 1 резулт - "line"
if (
!questions?.find( (q) => (q.type === "result" && q.content.rule.parentId === "line"))
!questions?.find(
(q) => q.type === "result" && q.content.rule.parentId === "line",
)
) {
createResult(quiz?.backendId, "line");
console.log("Я не нашёл линейный резулт и собираюсь создать новый");

@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { Box, useTheme } from "@mui/material";
import { Box, useMediaQuery, useTheme } from "@mui/material";
import { useCurrentQuiz } from "@root/quizes/hooks";
import { getQuestionByContentId } from "@root/questions/actions";
@ -46,6 +46,8 @@ const QUESTIONS_MAP: any = {
export const Question = ({ questions }: QuestionProps) => {
const quiz = useCurrentQuiz();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down(650));
const [currentQuestion, setCurrentQuestion] =
useState<AnyTypedQuizQuestion>();
const [showContactForm, setShowContactForm] = useState<boolean>(false);
@ -67,13 +69,13 @@ export const Question = ({ questions }: QuestionProps) => {
const QuestionComponent =
QUESTIONS_MAP[currentQuestion.type as Exclude<QuestionType, "nonselected">];
const theme = useTheme();
return (
<Box
sx={{
backgroundColor: theme.palette.background.default,
height: isMobile ? undefined : "100vh",
}}
height="100vh"
>
{!showContactForm && !showResultForm && (
<Box

@ -72,7 +72,7 @@ export const ResultForm = ({
flexDirection: "column",
alignItems: "center",
justifyContent: "space-between",
height: "100vh",
height: isMobile ? undefined : "100vh",
width: "100vw",
pt: "28px",
}}

@ -505,7 +505,7 @@ function QuizPreviewLayoutByType({
padding: "16px",
display: "flex",
flexDirection: "column",
justifyContent: "center",
justifyContent: "space-between",
alignItems: "center",
height: "100%",
"&::-webkit-scrollbar": { width: 0 },

@ -12,7 +12,7 @@ export type UiTools = {
deleteNodeId: string | null;
showConfirmLeaveModal: boolean;
someWorkBackend: boolean;
nextStep: number
nextStep: number;
};
export type WhyCantCreatePublic = {
@ -31,7 +31,7 @@ const initialState: UiTools = {
deleteNodeId: null,
showConfirmLeaveModal: false,
someWorkBackend: false,
nextStep: -1
nextStep: -1,
};
export const useUiTools = create<UiTools>()(

@ -173,7 +173,8 @@ export const CropModal: FC<Props> = ({
height: isMobile ? "80vh" : undefined,
display: isMobile ? "flex" : undefined,
flexDirection: isMobile ? "column" : undefined,
justifyContent: isMobile ? "space-evenly" : undefined,
justifyContent: isMobile ? "flex-start" : undefined,
overflow: isMobile ? "auto" : undefined,
}}
>
<Box

@ -38,7 +38,7 @@ export default function Sidebar({ changePage, disableCollapse }: SidebarProps) {
navigate("/edit");
}
updateNextStep(index)
updateNextStep(index);
changePage(index);
};