2023-03-03 20:07:19 +00:00
|
|
|
|
import Stepper from '@ui_kit/Stepper';
|
2023-06-30 14:39:07 +00:00
|
|
|
|
import SwitchStepPages from "@ui_kit/switchStepPages";
|
2023-03-03 23:54:19 +00:00
|
|
|
|
import React from "react";
|
2023-05-31 10:50:30 +00:00
|
|
|
|
import PenaLogo from "@ui_kit/PenaLogo";
|
|
|
|
|
import {Box, Button, Container, FormControl, IconButton, TextField, useTheme} from "@mui/material";
|
|
|
|
|
import BackArrowIcon from "@icons/BackArrowIcon";
|
|
|
|
|
import NavMenuItem from "@ui_kit/Header/NavMenuItem";
|
|
|
|
|
import EyeIcon from "@icons/EyeIcon";
|
|
|
|
|
import CustomAvatar from "@ui_kit/Header/Avatar";
|
|
|
|
|
import Sidebar from "@ui_kit/Sidebar";
|
|
|
|
|
import {quizStore} from "@root/quizes";
|
|
|
|
|
import {useParams} from "react-router-dom";
|
2023-03-03 20:07:19 +00:00
|
|
|
|
|
|
|
|
|
|
2023-07-20 22:02:20 +00:00
|
|
|
|
export default function StartPage() {
|
2023-05-31 10:50:30 +00:00
|
|
|
|
const {listQuizes, updateQuizesList, removeQuiz, createBlank} = quizStore();
|
|
|
|
|
const params = Number(useParams().quizId);
|
|
|
|
|
const activeStep = listQuizes[params].step
|
|
|
|
|
const theme = useTheme();
|
2023-03-03 23:54:19 +00:00
|
|
|
|
|
|
|
|
|
const handleNext = () => {
|
2023-05-31 10:50:30 +00:00
|
|
|
|
updateQuizesList(params, {step: listQuizes[params].step + 1})
|
|
|
|
|
}
|
2023-03-03 23:54:19 +00:00
|
|
|
|
|
|
|
|
|
const handleBack = () => {
|
2023-05-31 10:50:30 +00:00
|
|
|
|
let result = listQuizes[params].step - 1
|
2023-06-28 23:32:43 +00:00
|
|
|
|
updateQuizesList(params, {step: result ? result : 1})
|
2023-03-03 23:54:19 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-03-01 22:59:51 +00:00
|
|
|
|
return (
|
|
|
|
|
<>
|
2023-05-31 10:50:30 +00:00
|
|
|
|
{/*хедер*/}
|
|
|
|
|
<Container
|
|
|
|
|
component="nav"
|
|
|
|
|
maxWidth={false}
|
|
|
|
|
disableGutters
|
|
|
|
|
sx={{
|
|
|
|
|
px: "16px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
height: "80px",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
bgcolor: "white",
|
|
|
|
|
borderBottom: "1px solid #E3E3E3",
|
|
|
|
|
zIndex: theme.zIndex.drawer + 1,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<PenaLogo width={124} />
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
ml: "37px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<IconButton sx={{ p: "6px" }}
|
|
|
|
|
onClick={() => handleBack()}
|
|
|
|
|
>
|
|
|
|
|
<BackArrowIcon />
|
|
|
|
|
</IconButton>
|
|
|
|
|
<FormControl
|
|
|
|
|
fullWidth
|
|
|
|
|
variant="standard"
|
|
|
|
|
>
|
|
|
|
|
<TextField
|
|
|
|
|
fullWidth
|
|
|
|
|
id="project-name"
|
|
|
|
|
placeholder="Название проекта окно"
|
|
|
|
|
sx={{
|
|
|
|
|
width: "270px",
|
|
|
|
|
"& .MuiInputBase-root": {
|
|
|
|
|
height: "34px",
|
|
|
|
|
borderRadius: "8px",
|
|
|
|
|
p: 0,
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
inputProps={{
|
|
|
|
|
sx: {
|
|
|
|
|
height: "20px",
|
|
|
|
|
borderRadius: "8px",
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "20px",
|
|
|
|
|
p: "7px",
|
|
|
|
|
color: "black",
|
|
|
|
|
"&::placeholder": {
|
|
|
|
|
opacity: 1,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</FormControl>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "30px",
|
|
|
|
|
overflow: "hidden",
|
|
|
|
|
ml: "20px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<NavMenuItem text="Редактировать" isActive />
|
|
|
|
|
<NavMenuItem text="Заявки" />
|
|
|
|
|
<NavMenuItem text="Аналитика" />
|
|
|
|
|
<NavMenuItem text="История" />
|
|
|
|
|
<NavMenuItem text="Помощь" />
|
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
ml: "auto",
|
|
|
|
|
gap: "15px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outlined"
|
|
|
|
|
startIcon={<EyeIcon />}
|
|
|
|
|
sx={{
|
|
|
|
|
color: theme.palette.brightPurple.main,
|
|
|
|
|
fontSize: "14px",
|
|
|
|
|
lineHeight: "18px",
|
|
|
|
|
height: "34px",
|
|
|
|
|
"& .MuiButton-startIcon": {
|
|
|
|
|
mr: "3px",
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
>Предпросмотр</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="contained"
|
|
|
|
|
sx={{
|
|
|
|
|
fontSize: "14px",
|
|
|
|
|
lineHeight: "18px",
|
|
|
|
|
height: "34px",
|
|
|
|
|
}}
|
|
|
|
|
>Опубликовать</Button>
|
|
|
|
|
<CustomAvatar sx={{ ml: "11px", backgroundColor: theme.palette.orange.main, height: "36px", width: "36px" }} />
|
|
|
|
|
</Box>
|
|
|
|
|
</Container>
|
|
|
|
|
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: 'flex'
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Sidebar/>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
background: theme.palette.background.default,
|
|
|
|
|
width: '100%',
|
|
|
|
|
padding: '25px',
|
|
|
|
|
height: 'calc(100vh - 80px)',
|
|
|
|
|
overflow: 'auto',
|
|
|
|
|
boxSizing: "border-box"
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Stepper activeStep={activeStep} desc={"Настройка стартовой страницы"}/>
|
|
|
|
|
<SwitchStepPages activeStep={activeStep} handleNext={handleNext}/>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
2023-03-01 22:59:51 +00:00
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|