import {
Box,
Button,
ButtonBase,
Checkbox,
FormControl, FormControlLabel,
Link,
MenuItem,
Select,
Typography,
useTheme
} from "@mui/material";
import { useState } from "react";
import CustomCheckbox from "@ui_kit/CustomCheckbox";
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";
import SelectableButton from "@ui_kit/SelectableButton";
import SelectableIconButton from "./SelectableIconButton";
import UploadBox from "@ui_kit/UploadBox";
import CustomTextField from "@ui_kit/CustomTextField";
import {quizStore} from "@root/quizes";
import {useParams} from "react-router-dom";
import * as React from "react";
import ModalSizeImage from "./ModalSizeImage";
import DropZone from "./dropZone";
const designTypes = [
["standard", (color: string) => , "Standard"],
["expanded", (color: string) => , "Expanded"],
["centered", (color: string) => , "Centered"]
] as const;
// type DesignType = typeof designTypes[number][0];
type BackgroundType = "image" | "video";
type AlignType = "left" | "right";
export default function StartPageSettings() {
const {listQuizes, updateQuizesList, removeQuiz, createBlank} = quizStore();
const params = Number(useParams().quizId);
const theme = useTheme();
const designType = listQuizes[params].startpage
const StartPageClone = listQuizes[params]
console.log(StartPageClone)
const [backgroundType, setBackgroundType] = useState(listQuizes[params].config.startpage.background.type);
const [alignType, setAlignType] = useState("left");
// для видео
const videoHC = (videoInp:any) => {
const [file] = videoInp.files
setVideo(URL.createObjectURL(file))
}
const [video, setVideo] = React.useState("");
const mutationHC = (e: any) => {
let SPageClone = listQuizes[params].config
SPageClone.startpage.description = e.target.value
updateQuizesList(params, {config: SPageClone })
}
const mutationButtonHC = (e: any) => {
let SPageClone = listQuizes[params].config
SPageClone.startpage.button = e.target.value
updateQuizesList(params, {config: SPageClone })
}
const mutationPhoneHC = (e: any) => {
let SPageClone = listQuizes[params].config
SPageClone.info.phonenumber = e.target.value
updateQuizesList(params, {config: SPageClone })
}
const mutationSiteHC = (e: any) => {
let SPageClone = listQuizes[params].config
SPageClone.info.site = e.target.value
updateQuizesList(params, {config: SPageClone })
}
const mutationLawHC = (e: any) => {
let SPageClone = listQuizes[params].config
SPageClone.info.law = e.target.value
updateQuizesList(params, {config: SPageClone })
}
const mutationOrgNameHC = (e: any) => {
let SPageClone = listQuizes[params].config
SPageClone.info.orgname = e.target.value
updateQuizesList(params, {config: SPageClone })
}
const mutationOrgMetaHC = (e: any) => {
let SPageClone = listQuizes[params].config
SPageClone.meta = e.target.value
updateQuizesList(params, {config: SPageClone })
}
return (
<>
Стартовая страница
Дизайн
Фон
{
setBackgroundType("image")
let SPageClone = listQuizes[params].config
SPageClone.startpage.background.type = "image"
updateQuizesList(params, {config: SPageClone })
}}>
Изображение
{
setBackgroundType("video")
let SPageClone = listQuizes[params].config
SPageClone.startpage.background.type = "video"
updateQuizesList(params, {config: SPageClone })
}}>
Видео
Изображение
}
checkedIcon={}
/>}
label= "мобильная версия"
sx={{
color: theme.palette.brightPurple.main,
textDecorationLine: "underline",
textDecorationColor: theme.palette.brightPurple.main,
ml: "-9px",
userSelect: "none",
}}
/>
Добавить видео
videoHC(event.target) } hidden accept=".mp4" multiple type="file" />
}
sx={{
height: "48px",
width: "48px",
marginBottom: "20px"
}}
/>
{video ?
:
null
}
Настройки видео
{
let SPageClone = listQuizes[params].config
SPageClone.startpage.background.cycle = e.target.checked
updateQuizesList(params, {config: SPageClone })}}
/>
Изображение для мобильной версии
Расположение элементов
setAlignType("left")} isActive={alignType === "left"} Icon={AlignLeftIcon} />
setAlignType("right")} isActive={alignType === "right"} Icon={AlignRightIcon} />
Логотип
Favicon
5 MB максимум
{/*Правая сторона*/}
Заголовок
updateQuizesList(params, {name: e.target.value})}
/>
Текст
Текст кнопки
Телефон
{console.log(e.target.checked)
let SPageClone = listQuizes[params].config
SPageClone.info.clickable = e.target.checked
updateQuizesList(params, {config: SPageClone })}
}/>
Название или слоган компании
Сайт
Юридическая информация
Дополнительно
Mета заголовок
Текст-заполнитель —
это текст, который имеет Текст-заполнитель —
это текст, который имеет Текст-заполнитель —
это текст, который имеет Текст-заполнитель —
это текст, который имеет Текст-заполнитель
>
);
}
function IconCheck() {
return (
);
}