2023-06-17 14:26:27 +00:00
|
|
|
|
import {
|
|
|
|
|
Box,
|
|
|
|
|
Button,
|
|
|
|
|
ButtonBase,
|
|
|
|
|
Checkbox,
|
|
|
|
|
FormControl, FormControlLabel,
|
|
|
|
|
MenuItem,
|
|
|
|
|
Select,
|
|
|
|
|
Typography,
|
|
|
|
|
useTheme
|
|
|
|
|
} from "@mui/material";
|
2022-12-26 10:00:03 +00:00
|
|
|
|
import { useState } from "react";
|
2023-03-15 22:56:53 +00:00
|
|
|
|
import CustomCheckbox from "@ui_kit/CustomCheckbox";
|
2023-05-03 19:21:00 +00:00
|
|
|
|
import AlignLeftIcon from "../../assets/icons/AlignLeftIcon";
|
|
|
|
|
import AlignRightIcon from "../../assets/icons/AlignRightIcon";
|
|
|
|
|
import ArrowDown from "../../assets/icons/ArrowDownIcon";
|
|
|
|
|
import InfoIcon from "../../assets/icons/InfoIcon";
|
|
|
|
|
import LayoutCenteredIcon from "../../assets/icons/LayoutCenteredIcon";
|
|
|
|
|
import LayoutExpandedIcon from "../../assets/icons/LayoutExpandedIcon";
|
|
|
|
|
import LayoutStandartIcon from "../../assets/icons/LayoutStandartIcon";
|
|
|
|
|
import MobilePhoneIcon from "../../assets/icons/MobilePhoneIcon";
|
|
|
|
|
import UploadIcon from "../../assets/icons/UploadIcon";
|
2023-05-10 17:35:30 +00:00
|
|
|
|
import SelectableButton from "@ui_kit/SelectableButton";
|
|
|
|
|
import SelectableIconButton from "./SelectableIconButton";
|
|
|
|
|
import UploadBox from "@ui_kit/UploadBox";
|
2023-03-10 01:38:31 +00:00
|
|
|
|
import CustomTextField from "@ui_kit/CustomTextField";
|
2023-06-07 14:20:45 +00:00
|
|
|
|
import {quizStore} from "@root/quizes";
|
2023-06-23 13:42:35 +00:00
|
|
|
|
import {useNavigate, useParams} from "react-router-dom";
|
2023-06-10 07:33:16 +00:00
|
|
|
|
import * as React from "react";
|
2023-06-17 22:26:12 +00:00
|
|
|
|
import ModalSizeImage from "./ModalSizeImage";
|
2023-06-21 02:38:13 +00:00
|
|
|
|
import DropZone from "./dropZone";
|
2023-06-23 13:42:35 +00:00
|
|
|
|
import Extra from "./extra";
|
|
|
|
|
import AlignCenterIcon from "@icons/AlignCenterIcon";
|
2023-06-27 22:26:23 +00:00
|
|
|
|
import DropFav from "./dropfavicon";
|
2023-07-20 22:02:20 +00:00
|
|
|
|
import {createQuestion} from "@root/questions";
|
2022-12-26 10:00:03 +00:00
|
|
|
|
|
2023-06-28 23:32:43 +00:00
|
|
|
|
interface HandleNext {
|
|
|
|
|
handleNext: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-26 10:00:03 +00:00
|
|
|
|
const designTypes = [
|
2023-06-10 07:33:16 +00:00
|
|
|
|
["standard", (color: string) => <LayoutStandartIcon color={color} />, "Standard"],
|
|
|
|
|
["expanded", (color: string) => <LayoutExpandedIcon color={color} />, "Expanded"],
|
|
|
|
|
["centered", (color: string) => <LayoutCenteredIcon color={color} />, "Centered"]
|
2022-12-26 10:00:03 +00:00
|
|
|
|
] as const;
|
2023-06-10 07:33:16 +00:00
|
|
|
|
// type DesignType = typeof designTypes[number][0];
|
2022-12-26 10:00:03 +00:00
|
|
|
|
|
|
|
|
|
type BackgroundType = "image" | "video";
|
2023-06-23 13:42:35 +00:00
|
|
|
|
type AlignType = "left" | "right" | "center";
|
2022-12-26 10:00:03 +00:00
|
|
|
|
|
2023-06-28 23:32:43 +00:00
|
|
|
|
export default function StartPageSettings({ handleNext }: HandleNext) {
|
2023-06-07 14:20:45 +00:00
|
|
|
|
const {listQuizes, updateQuizesList, removeQuiz, createBlank} = quizStore();
|
|
|
|
|
const params = Number(useParams().quizId);
|
2022-12-26 10:00:03 +00:00
|
|
|
|
const theme = useTheme();
|
2023-06-07 14:20:45 +00:00
|
|
|
|
const designType = listQuizes[params].startpage
|
2023-06-13 21:59:16 +00:00
|
|
|
|
const StartPageClone = listQuizes[params]
|
|
|
|
|
console.log(StartPageClone)
|
2023-06-17 22:26:12 +00:00
|
|
|
|
const [backgroundType, setBackgroundType] = useState(listQuizes[params].config.startpage.background.type);
|
2022-12-26 10:00:03 +00:00
|
|
|
|
const [alignType, setAlignType] = useState<AlignType>("left");
|
2023-06-17 14:26:27 +00:00
|
|
|
|
|
|
|
|
|
// для видео
|
|
|
|
|
const videoHC = (videoInp:any) => {
|
|
|
|
|
const [file] = videoInp.files
|
|
|
|
|
setVideo(URL.createObjectURL(file))
|
|
|
|
|
}
|
|
|
|
|
const [video, setVideo] = React.useState("");
|
|
|
|
|
|
2023-06-13 21:59:16 +00:00
|
|
|
|
const mutationHC = (e: any) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-13 21:59:16 +00:00
|
|
|
|
SPageClone.startpage.description = e.target.value
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mutationButtonHC = (e: any) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-13 21:59:16 +00:00
|
|
|
|
SPageClone.startpage.button = e.target.value
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mutationPhoneHC = (e: any) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-13 21:59:16 +00:00
|
|
|
|
SPageClone.info.phonenumber = e.target.value
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mutationSiteHC = (e: any) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-13 21:59:16 +00:00
|
|
|
|
SPageClone.info.site = e.target.value
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mutationLawHC = (e: any) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-13 21:59:16 +00:00
|
|
|
|
SPageClone.info.law = e.target.value
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}
|
2023-06-10 07:33:16 +00:00
|
|
|
|
|
2023-06-13 21:59:16 +00:00
|
|
|
|
const mutationOrgNameHC = (e: any) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-13 21:59:16 +00:00
|
|
|
|
SPageClone.info.orgname = e.target.value
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-06-23 13:42:35 +00:00
|
|
|
|
const mutationPositionHC = (e: any) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-23 13:42:35 +00:00
|
|
|
|
SPageClone.startpage.position = e.target.value
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}
|
2022-12-26 10:00:03 +00:00
|
|
|
|
|
2023-07-01 23:33:35 +00:00
|
|
|
|
const [mobileVersion, setMobileVersion] = React.useState(false);
|
|
|
|
|
const MobileVersionHC = (bool:boolean) => {
|
|
|
|
|
setMobileVersion(bool)
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-26 10:00:03 +00:00
|
|
|
|
return (
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<Typography variant="h5" sx={{marginTop: "60px"}}>Стартовая страница</Typography>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Box sx={{
|
|
|
|
|
backgroundColor: "white",
|
|
|
|
|
borderRadius: "12px",
|
|
|
|
|
p: "20px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "20px",
|
2023-06-17 14:26:27 +00:00
|
|
|
|
marginTop: "40px",
|
|
|
|
|
maxWidth: "1160px",
|
|
|
|
|
width: "100%",
|
2023-06-07 14:20:45 +00:00
|
|
|
|
boxShadow: `0px 100px 309px rgba(210, 208, 225, 0.24),
|
2022-12-26 10:00:03 +00:00
|
|
|
|
0px 41.7776px 129.093px rgba(210, 208, 225, 0.172525),
|
|
|
|
|
0px 22.3363px 69.0192px rgba(210, 208, 225, 0.143066),
|
|
|
|
|
0px 12.5216px 38.6916px rgba(210, 208, 225, 0.12),
|
|
|
|
|
0px 6.6501px 20.5488px rgba(210, 208, 225, 0.0969343),
|
|
|
|
|
0px 2.76726px 8.55082px rgba(210, 208, 225, 0.0674749)`,
|
|
|
|
|
}}>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Box sx={{
|
|
|
|
|
pr: "20px",
|
|
|
|
|
borderRight: `1px solid ${theme.palette.grey2.main}`,
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexDirection: "column",
|
2023-06-17 14:26:27 +00:00
|
|
|
|
flex: `1 1 342px`,
|
2023-06-07 14:20:45 +00:00
|
|
|
|
}}>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mb: "14px" }}>Дизайн</Typography>
|
|
|
|
|
<FormControl
|
|
|
|
|
fullWidth
|
|
|
|
|
size="small"
|
2022-12-26 10:00:03 +00:00
|
|
|
|
sx={{
|
2023-06-07 14:20:45 +00:00
|
|
|
|
width: "100%",
|
|
|
|
|
minWidth: "200px",
|
2022-12-26 10:00:03 +00:00
|
|
|
|
height: "48px",
|
|
|
|
|
}}
|
2023-06-07 14:20:45 +00:00
|
|
|
|
>
|
|
|
|
|
<Select
|
|
|
|
|
id="category-select"
|
|
|
|
|
variant="outlined"
|
|
|
|
|
value={designType}
|
|
|
|
|
displayEmpty
|
2023-06-10 07:33:16 +00:00
|
|
|
|
onChange={e => updateQuizesList(params, {startpage: e.target.value})}
|
2023-06-07 14:20:45 +00:00
|
|
|
|
sx={{
|
|
|
|
|
height: "48px",
|
|
|
|
|
borderRadius: "8px",
|
|
|
|
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
|
|
|
border: `1px solid ${theme.palette.brightPurple.main} !important`,
|
2022-12-26 10:00:03 +00:00
|
|
|
|
},
|
2023-06-07 14:20:45 +00:00
|
|
|
|
}}
|
|
|
|
|
MenuProps={{
|
|
|
|
|
PaperProps: {
|
|
|
|
|
sx: {
|
|
|
|
|
mt: "8px",
|
|
|
|
|
p: "4px",
|
|
|
|
|
borderRadius: "8px",
|
|
|
|
|
border: "1px solid #EEE4FC",
|
|
|
|
|
boxShadow: "0px 8px 24px rgba(210, 208, 225, 0.4)",
|
|
|
|
|
},
|
2022-12-26 10:00:03 +00:00
|
|
|
|
},
|
2023-06-07 14:20:45 +00:00
|
|
|
|
MenuListProps: {
|
|
|
|
|
sx: {
|
|
|
|
|
py: 0,
|
|
|
|
|
display: "flex",
|
|
|
|
|
flexDirection: "column",
|
|
|
|
|
gap: "8px",
|
|
|
|
|
"& .Mui-selected": {
|
|
|
|
|
backgroundColor: theme.palette.background.default,
|
|
|
|
|
color: theme.palette.brightPurple.main,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
inputProps={{
|
|
|
|
|
sx: {
|
|
|
|
|
color: theme.palette.brightPurple.main,
|
2022-12-26 10:00:03 +00:00
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
2023-06-07 14:20:45 +00:00
|
|
|
|
px: "9px",
|
2022-12-26 10:00:03 +00:00
|
|
|
|
gap: "20px",
|
2023-06-07 14:20:45 +00:00
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
IconComponent={props => <ArrowDown {...props} />}
|
|
|
|
|
>
|
|
|
|
|
{designTypes.map(type =>
|
|
|
|
|
<MenuItem
|
|
|
|
|
key={type[0]}
|
|
|
|
|
value={type[0]}
|
2022-12-26 10:00:03 +00:00
|
|
|
|
|
2023-06-07 14:20:45 +00:00
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
gap: "20px",
|
|
|
|
|
p: "4px",
|
|
|
|
|
borderRadius: "5px",
|
|
|
|
|
color: theme.palette.grey2.main,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{type[1](type[0] === designType ? theme.palette.orange.main : theme.palette.grey2.main)}
|
2023-06-10 07:33:16 +00:00
|
|
|
|
{type[2]}
|
2023-06-07 14:20:45 +00:00
|
|
|
|
</MenuItem>
|
|
|
|
|
)}
|
|
|
|
|
</Select>
|
|
|
|
|
</FormControl>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Фон</Typography>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<SelectableButton isSelected={backgroundType === "image"} onClick={() => {
|
|
|
|
|
setBackgroundType("image")
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-17 14:26:27 +00:00
|
|
|
|
SPageClone.startpage.background.type = "image"
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-17 14:26:27 +00:00
|
|
|
|
}}>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
Изображение
|
|
|
|
|
</SelectableButton>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<SelectableButton isSelected={backgroundType === "video"} onClick={() => {
|
|
|
|
|
setBackgroundType("video")
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-17 14:26:27 +00:00
|
|
|
|
SPageClone.startpage.background.type = "video"
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-17 14:26:27 +00:00
|
|
|
|
}}>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
Видео
|
|
|
|
|
</SelectableButton>
|
|
|
|
|
</Box>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: backgroundType === "image" ? "flex" : "none",
|
|
|
|
|
flexDirection: "column"
|
|
|
|
|
}}>
|
2023-07-01 23:33:35 +00:00
|
|
|
|
<Box sx={{
|
|
|
|
|
display: mobileVersion ? "none" : "flex",
|
|
|
|
|
flexDirection: "column"
|
|
|
|
|
}}>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>
|
|
|
|
|
Изображение</Typography>
|
|
|
|
|
<DropZone text={"5 MB максимум"} heightImg={"110px"}/>
|
|
|
|
|
</Box>
|
|
|
|
|
|
|
|
|
|
|
2023-06-17 22:26:12 +00:00
|
|
|
|
<ModalSizeImage/>
|
2023-06-10 07:33:16 +00:00
|
|
|
|
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Box sx={{
|
|
|
|
|
mt: "20px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "10px",
|
2023-07-01 23:33:35 +00:00
|
|
|
|
flexDirection: "column"
|
2023-06-07 14:20:45 +00:00
|
|
|
|
|
|
|
|
|
}}>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<FormControlLabel
|
|
|
|
|
control={
|
|
|
|
|
<Checkbox
|
|
|
|
|
icon={<IconCheck/>}
|
|
|
|
|
checkedIcon={<MobilePhoneIcon bgcolor={"#EEE4FC"}/>}
|
|
|
|
|
/>}
|
|
|
|
|
label= "мобильная версия"
|
|
|
|
|
sx={{
|
|
|
|
|
color: theme.palette.brightPurple.main,
|
|
|
|
|
textDecorationLine: "underline",
|
|
|
|
|
textDecorationColor: theme.palette.brightPurple.main,
|
|
|
|
|
ml: "-9px",
|
|
|
|
|
userSelect: "none",
|
|
|
|
|
}}
|
2023-07-01 23:33:35 +00:00
|
|
|
|
onClick={() => {MobileVersionHC(!mobileVersion)}}
|
2023-06-17 14:26:27 +00:00
|
|
|
|
/>
|
2023-07-01 23:33:35 +00:00
|
|
|
|
{mobileVersion ?
|
|
|
|
|
<Box sx={{display: "flex", flexDirection: "column"}}>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "11px", mb: "14px" }}>
|
|
|
|
|
Изображение для мобильной версии</Typography>
|
|
|
|
|
<DropZone text={"5 MB максимум"} heightImg={"110px"}/>
|
|
|
|
|
</Box>
|
|
|
|
|
:
|
|
|
|
|
<></>
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-07 14:20:45 +00:00
|
|
|
|
</Box>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
</Box>
|
|
|
|
|
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: backgroundType === "image" ? "none" : "flex",
|
|
|
|
|
flexDirection: "column"
|
|
|
|
|
}}>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
gap: "7px",
|
|
|
|
|
mt: "20px",
|
|
|
|
|
mb: "14px",
|
|
|
|
|
}}>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main }}>Добавить видео</Typography>
|
|
|
|
|
<InfoIcon />
|
|
|
|
|
</Box>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<ButtonBase component="label" sx={{justifyContent: 'flex-start'}} >
|
|
|
|
|
<input onChange={event => videoHC(event.target) } hidden accept=".mp4" multiple type="file" />
|
|
|
|
|
<UploadBox
|
2023-06-07 14:20:45 +00:00
|
|
|
|
icon={<UploadIcon />}
|
|
|
|
|
sx={{
|
|
|
|
|
height: "48px",
|
|
|
|
|
width: "48px",
|
2023-06-17 14:26:27 +00:00
|
|
|
|
marginBottom: "20px"
|
2023-06-07 14:20:45 +00:00
|
|
|
|
}}
|
2023-06-17 14:26:27 +00:00
|
|
|
|
/>
|
|
|
|
|
</ButtonBase>
|
|
|
|
|
{video ?
|
|
|
|
|
<video src={video} width="400" controls/>
|
|
|
|
|
:
|
|
|
|
|
null
|
|
|
|
|
}
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "5px" }}>Настройки видео</Typography>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<CustomCheckbox
|
|
|
|
|
label="Зацикливать видео"
|
2023-06-17 22:26:12 +00:00
|
|
|
|
checked={listQuizes[params].config.startpage.background.cycle}
|
2023-06-17 14:26:27 +00:00
|
|
|
|
handleChange={(e) => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-17 14:26:27 +00:00
|
|
|
|
SPageClone.startpage.background.cycle = e.target.checked
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })}}
|
2023-06-17 14:26:27 +00:00
|
|
|
|
/>
|
2023-06-21 21:00:38 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "11px", mb: "14px" }}>
|
|
|
|
|
Изображение для мобильной версии</Typography>
|
|
|
|
|
<DropZone text={"5 MB максимум"} heightImg={"110px"}/>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
</Box>
|
|
|
|
|
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Расположение элементов</Typography>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}>
|
2023-06-23 13:42:35 +00:00
|
|
|
|
<SelectableIconButton onClick={() => {
|
|
|
|
|
setAlignType("left")
|
|
|
|
|
let SPageClone = listQuizes[params].config
|
|
|
|
|
SPageClone.startpage.position = "ltr"
|
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
|
|
|
|
}} isActive={alignType === "left"} Icon={AlignLeftIcon} />
|
|
|
|
|
<SelectableIconButton onClick={() => {
|
|
|
|
|
setAlignType("center")
|
|
|
|
|
let SPageClone = listQuizes[params].config
|
|
|
|
|
SPageClone.startpage.position = "cnt"
|
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
|
|
|
|
}} isActive={alignType === "center"} Icon={AlignCenterIcon} sx={{display: designType === "centered" ? "flex" : "none"}}/>
|
|
|
|
|
<SelectableIconButton onClick={() => {
|
|
|
|
|
setAlignType("right")
|
|
|
|
|
let SPageClone = listQuizes[params].config
|
|
|
|
|
SPageClone.startpage.position = "rtl"
|
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
|
|
|
|
}} isActive={alignType === "right"} Icon={AlignRightIcon} />
|
2023-06-07 14:20:45 +00:00
|
|
|
|
</Box>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: backgroundType === "image" ? "flex" : "none",
|
|
|
|
|
flexDirection: "column"
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, margin: "20px 0" }}>
|
|
|
|
|
Логотип</Typography>
|
2023-06-21 21:00:38 +00:00
|
|
|
|
<DropZone text={"5 MB максимум"} heightImg={"110px"}/>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
</Box>
|
|
|
|
|
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>
|
|
|
|
|
Favicon</Typography>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "end",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}>
|
2023-07-14 18:29:09 +00:00
|
|
|
|
<DropFav sx={{height: "48px", width: "48px"}} heightImg={"48px"} widthImg={"48px"}/>
|
2023-06-27 22:26:23 +00:00
|
|
|
|
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{
|
|
|
|
|
color: theme.palette.orange.main,
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "19px",
|
|
|
|
|
textDecoration: "underline",
|
|
|
|
|
}}>5 MB максимум</Typography>
|
|
|
|
|
</Box>
|
2023-07-14 18:29:09 +00:00
|
|
|
|
|
2022-12-26 10:00:03 +00:00
|
|
|
|
</Box>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
{/*Правая сторона*/}
|
2022-12-26 10:00:03 +00:00
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
2023-06-07 14:20:45 +00:00
|
|
|
|
flexDirection: "column",
|
|
|
|
|
flex: `1 1 795px`,
|
2022-12-26 10:00:03 +00:00
|
|
|
|
}}>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mb: "14px" }}>Заголовок</Typography>
|
2023-06-13 21:59:16 +00:00
|
|
|
|
<CustomTextField
|
|
|
|
|
placeholder="Текст-заполнитель — это текст, который"
|
|
|
|
|
text={listQuizes[params].name}
|
|
|
|
|
onChange={e => updateQuizesList(params, {name: e.target.value})}
|
|
|
|
|
/>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Текст</Typography>
|
2023-06-13 21:59:16 +00:00
|
|
|
|
<CustomTextField
|
|
|
|
|
placeholder="Текст-заполнитель — это текст, который "
|
2023-06-17 22:26:12 +00:00
|
|
|
|
text={listQuizes[params].config.startpage.description}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
onChange={mutationHC}
|
|
|
|
|
/>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Текст кнопки</Typography>
|
2023-06-13 21:59:16 +00:00
|
|
|
|
<CustomTextField
|
|
|
|
|
placeholder="Начать"
|
2023-06-17 22:26:12 +00:00
|
|
|
|
text={listQuizes[params].config.startpage.button}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
onChange={mutationButtonHC}
|
|
|
|
|
/>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Телефон</Typography>
|
2023-06-13 21:59:16 +00:00
|
|
|
|
<CustomTextField
|
|
|
|
|
placeholder="+7 900 000 00 00"
|
2023-06-17 22:26:12 +00:00
|
|
|
|
text={listQuizes[params].config.info.phonenumber}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
onChange={mutationPhoneHC}
|
|
|
|
|
/>
|
|
|
|
|
<CustomCheckbox label="Кликабельный"
|
2023-06-17 22:26:12 +00:00
|
|
|
|
checked={listQuizes[params].config.info.clickable}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
handleChange={(e) => {console.log(e.target.checked)
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-13 21:59:16 +00:00
|
|
|
|
SPageClone.info.clickable = e.target.checked
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
}/>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "11px", mb: "14px" }}>Название или слоган компании</Typography>
|
2023-06-13 21:59:16 +00:00
|
|
|
|
<CustomTextField
|
|
|
|
|
placeholder="Текст-заполнитель — это текст, который "
|
2023-06-17 22:26:12 +00:00
|
|
|
|
text={listQuizes[params].config.info.orgname}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
onChange={mutationOrgNameHC}
|
|
|
|
|
/>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Сайт</Typography>
|
2023-06-13 21:59:16 +00:00
|
|
|
|
<CustomTextField
|
|
|
|
|
placeholder="Текст-заполнитель — это текст, который "
|
2023-06-17 22:26:12 +00:00
|
|
|
|
text={listQuizes[params].config.info.site}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
onChange={mutationSiteHC}
|
|
|
|
|
/>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Юридическая информация</Typography>
|
2023-06-13 21:59:16 +00:00
|
|
|
|
<CustomTextField
|
|
|
|
|
placeholder="Текст-заполнитель — это текст, который "
|
2023-06-17 22:26:12 +00:00
|
|
|
|
text={listQuizes[params].config.info.law}
|
2023-06-13 21:59:16 +00:00
|
|
|
|
onChange={mutationLawHC}
|
|
|
|
|
/>
|
2023-06-23 13:42:35 +00:00
|
|
|
|
<Extra/>
|
2022-12-26 10:00:03 +00:00
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "20px",
|
|
|
|
|
justifyContent: "flex-end",
|
|
|
|
|
marginTop: "20px",
|
|
|
|
|
maxWidth: "1200px"
|
|
|
|
|
}}
|
|
|
|
|
>
|
2023-07-12 20:10:43 +00:00
|
|
|
|
<FormControlLabel
|
|
|
|
|
control={
|
|
|
|
|
<Checkbox
|
|
|
|
|
icon={<Button variant="outlined" sx={{backgroundColor: "transparent", color: theme.palette.brightPurple.main}}>Отключить стартовую страницу</Button>}
|
|
|
|
|
checkedIcon={<Button variant="outlined" sx={{backgroundColor: theme.palette.brightPurple.main, color: "white"}}>Включить стартовую страницу</Button>}
|
|
|
|
|
sx={{
|
|
|
|
|
borderRadius: 0,
|
|
|
|
|
padding: 0}}
|
|
|
|
|
onChange={(e) => {
|
|
|
|
|
let SPageClone = listQuizes[params].config
|
|
|
|
|
SPageClone.noStartPage = e.target.checked
|
|
|
|
|
updateQuizesList(params, {config: SPageClone })}}
|
|
|
|
|
checked={listQuizes[params].config.noStartPage}
|
|
|
|
|
/>}
|
|
|
|
|
label= ""
|
|
|
|
|
sx={{
|
|
|
|
|
color: theme.palette.brightPurple.main,
|
|
|
|
|
ml: "-9px",
|
|
|
|
|
userSelect: "none",
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/>
|
2023-06-17 14:26:27 +00:00
|
|
|
|
<Button
|
|
|
|
|
variant="contained"
|
|
|
|
|
onClick={() => {
|
2023-06-17 22:26:12 +00:00
|
|
|
|
let SPageClone = listQuizes[params].config
|
2023-06-17 14:26:27 +00:00
|
|
|
|
SPageClone.startpage.background.desktop = "https://happypik.ru/wp-content/uploads/2019/09/njashnye-kotiki8.jpg"
|
|
|
|
|
SPageClone.startpage.background.mobile = "https://krot.info/uploads/posts/2022-03/1646156155_3-krot-info-p-smeshnie-tolstie-koti-smeshnie-foto-3.png"
|
|
|
|
|
SPageClone.startpage.background.video = "https://youtu.be/dbaPkCiLPKQ"
|
2023-06-17 22:26:12 +00:00
|
|
|
|
updateQuizesList(params, {config: SPageClone })
|
2023-06-28 23:32:43 +00:00
|
|
|
|
handleNext()
|
2023-06-30 14:39:07 +00:00
|
|
|
|
createQuestion(params)
|
2023-06-17 14:26:27 +00:00
|
|
|
|
}}
|
|
|
|
|
>Настроить вопросы</Button>
|
2022-12-26 10:00:03 +00:00
|
|
|
|
</Box>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
</>
|
|
|
|
|
|
2022-12-26 10:00:03 +00:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-17 14:26:27 +00:00
|
|
|
|
function IconCheck() {
|
|
|
|
|
return (
|
|
|
|
|
<Box sx={{
|
|
|
|
|
height: "36px",
|
|
|
|
|
width: "36px",
|
|
|
|
|
borderRadius: "8px",
|
|
|
|
|
backgroundColor: "#EEE4FC",
|
|
|
|
|
}} />
|
|
|
|
|
);
|
|
|
|
|
}
|