2023-05-14 11:00:37 +00:00
|
|
|
|
import {Typography, Box, Button, SxProps, Theme} from "@mui/material";
|
2023-05-10 17:35:30 +00:00
|
|
|
|
import ComplexNavText from "./ComplexNavText";
|
|
|
|
|
import QuizCard from "./QuizCard";
|
2023-05-10 11:40:39 +00:00
|
|
|
|
import SectionWrapper from "@ui_kit/SectionWrapper";
|
|
|
|
|
import React from "react";
|
2023-05-14 11:00:37 +00:00
|
|
|
|
import {quizStore} from "@root/quizes";
|
2023-05-10 11:40:39 +00:00
|
|
|
|
interface Props {
|
|
|
|
|
outerContainerSx?: SxProps<Theme>;
|
|
|
|
|
children?: React.ReactNode;
|
|
|
|
|
}
|
2022-12-09 11:48:15 +00:00
|
|
|
|
|
2023-05-10 11:40:39 +00:00
|
|
|
|
export default function MyQuizzesFull({outerContainerSx: sx, children}: Props) {
|
2023-05-14 14:25:07 +00:00
|
|
|
|
const {listQuizes, updateQuizesList, removeQuiz} = quizStore()
|
|
|
|
|
|
2022-12-09 11:48:15 +00:00
|
|
|
|
return (
|
|
|
|
|
<SectionWrapper
|
|
|
|
|
maxWidth="lg"
|
|
|
|
|
sx={{
|
|
|
|
|
mt: "25px",
|
|
|
|
|
mb: "70px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
2023-05-14 14:25:07 +00:00
|
|
|
|
<Button onClick={() => {
|
|
|
|
|
removeQuiz(2)
|
|
|
|
|
console.log(Object.values(listQuizes))
|
|
|
|
|
}}>УДАЛИ МЕНЯ</Button>
|
|
|
|
|
<Button onClick={() => {
|
|
|
|
|
console.log(Object.values(listQuizes))
|
|
|
|
|
}}>Узнай МЕНЯ</Button>
|
|
|
|
|
<Button onClick={() => {
|
|
|
|
|
updateQuizesList({
|
|
|
|
|
"id": 2,
|
|
|
|
|
"qid": "string",
|
|
|
|
|
"deleted": false,
|
|
|
|
|
"archived": true,
|
|
|
|
|
"fingerprinting": true,
|
|
|
|
|
"repeatable": true,
|
|
|
|
|
"note_prevented": true,
|
|
|
|
|
"mail_notifications": true,
|
|
|
|
|
"unique_answers": true,
|
|
|
|
|
"name": "string",
|
|
|
|
|
"description": "string",
|
|
|
|
|
"config": "string",
|
|
|
|
|
"status": "string",
|
|
|
|
|
"limit": 0,
|
|
|
|
|
"due_to": 0,
|
|
|
|
|
"time_of_passing": 0,
|
|
|
|
|
"pausable": true,
|
|
|
|
|
"version": 0,
|
|
|
|
|
"version_comment": "string",
|
|
|
|
|
"created_at": "string",
|
|
|
|
|
"updated_at": "string",
|
|
|
|
|
"question_cnt": 0,
|
|
|
|
|
"passed_count": 0,
|
|
|
|
|
"average_time": 0,
|
|
|
|
|
"super": true,
|
|
|
|
|
"group_id": 0
|
|
|
|
|
})
|
|
|
|
|
}}>добавь МЕНЯ</Button>
|
2023-05-10 11:40:39 +00:00
|
|
|
|
<ComplexNavText text1="Кабинет квизов"/>
|
2022-12-09 11:48:15 +00:00
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
justifyContent: "space-between",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
mt: "20px",
|
|
|
|
|
mb: "30px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Typography variant="h4">Мои квизы</Typography>
|
2023-04-26 17:24:19 +00:00
|
|
|
|
<Button
|
2022-12-09 11:48:15 +00:00
|
|
|
|
variant="contained"
|
2023-04-26 17:24:19 +00:00
|
|
|
|
>Создать +</Button>
|
2022-12-09 11:48:15 +00:00
|
|
|
|
</Box>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
py: "10px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexWrap: "wrap",
|
|
|
|
|
gap: "40px",
|
|
|
|
|
mb: "60px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
2023-05-14 14:25:07 +00:00
|
|
|
|
{Object.values(listQuizes).map((e, i) =>(
|
2023-05-14 11:00:37 +00:00
|
|
|
|
<QuizCard name={e.name} openCount={0} applicationCount={0} conversionPercent={0}/>
|
|
|
|
|
)
|
|
|
|
|
)}
|
|
|
|
|
|
2022-12-09 11:48:15 +00:00
|
|
|
|
</Box>
|
2023-05-10 11:40:39 +00:00
|
|
|
|
{children}
|
2022-12-09 11:48:15 +00:00
|
|
|
|
</SectionWrapper>
|
2023-05-10 11:40:39 +00:00
|
|
|
|
)
|
2022-12-09 11:48:15 +00:00
|
|
|
|
}
|