2023-06-07 14:20:45 +00:00
|
|
|
|
import {Box, Button, FormControl, Link, 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";
|
|
|
|
|
import {useParams} from "react-router-dom";
|
2022-12-26 10:00:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const designTypes = [
|
2023-03-15 22:56:53 +00:00
|
|
|
|
["Standard", (color: string) => <LayoutStandartIcon color={color} />],
|
2022-12-26 10:00:03 +00:00
|
|
|
|
["Expanded", (color: string) => <LayoutExpandedIcon color={color} />],
|
|
|
|
|
["Centered", (color: string) => <LayoutCenteredIcon color={color} />]
|
|
|
|
|
] as const;
|
|
|
|
|
type DesignType = typeof designTypes[number][0];
|
|
|
|
|
|
|
|
|
|
type BackgroundType = "image" | "video";
|
|
|
|
|
type AlignType = "left" | "right";
|
|
|
|
|
|
|
|
|
|
export default function StartPageSettings() {
|
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
|
|
|
|
|
// const [designType, setDesignType] = useState<DesignType | "">(designTypes[0][0]);
|
2022-12-26 10:00:03 +00:00
|
|
|
|
const [backgroundType, setBackgroundType] = useState<BackgroundType>("image");
|
|
|
|
|
const [alignType, setAlignType] = useState<AlignType>("left");
|
|
|
|
|
|
|
|
|
|
return (
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
backgroundColor: "white",
|
|
|
|
|
borderRadius: "12px",
|
|
|
|
|
p: "20px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "20px",
|
|
|
|
|
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",
|
|
|
|
|
flex: `1 1 365px`,
|
|
|
|
|
}}>
|
|
|
|
|
<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
|
|
|
|
|
onChange={(e, i) => console.log(e.target, e.target.value, i)}
|
|
|
|
|
// onChange={e => setDesignType(e.target.value as DesignType)}
|
|
|
|
|
// onChange={updateQuizesList(params, {startpage: "standard"})}
|
|
|
|
|
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)}
|
|
|
|
|
{type[0]}
|
|
|
|
|
</MenuItem>
|
|
|
|
|
)}
|
|
|
|
|
</Select>
|
|
|
|
|
</FormControl>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Фон</Typography>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}>
|
|
|
|
|
<SelectableButton isSelected={backgroundType === "image"} onClick={() => setBackgroundType("image")}>
|
|
|
|
|
Изображение
|
|
|
|
|
</SelectableButton>
|
|
|
|
|
<SelectableButton isSelected={backgroundType === "video"} onClick={() => setBackgroundType("video")}>
|
|
|
|
|
Видео
|
|
|
|
|
</SelectableButton>
|
|
|
|
|
</Box>
|
|
|
|
|
{backgroundType === "image" ?
|
|
|
|
|
<>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Изображение</Typography>
|
|
|
|
|
<UploadBox icon={<UploadIcon />} text="5 MB максимум" />
|
2022-12-26 10:00:03 +00:00
|
|
|
|
<Link sx={{
|
2023-06-07 14:20:45 +00:00
|
|
|
|
mt: "20px",
|
2022-12-26 10:00:03 +00:00
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "19px",
|
2023-06-07 14:20:45 +00:00
|
|
|
|
color: theme.palette.orange.main,
|
|
|
|
|
textDecorationColor: theme.palette.orange.main
|
|
|
|
|
}}>Размер картинок</Link>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
mt: "20px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
<MobilePhoneIcon bgcolor="#EEE4FC" />
|
|
|
|
|
<Link sx={{
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "19px",
|
|
|
|
|
color: theme.palette.brightPurple.main,
|
|
|
|
|
textDecorationColor: theme.palette.brightPurple.main
|
|
|
|
|
}}>мобильная версия</Link>
|
|
|
|
|
</Box>
|
|
|
|
|
</>
|
|
|
|
|
:
|
|
|
|
|
<>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
gap: "7px",
|
|
|
|
|
mt: "20px",
|
|
|
|
|
mb: "14px",
|
|
|
|
|
}}>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main }}>Добавить видео</Typography>
|
|
|
|
|
<InfoIcon />
|
|
|
|
|
</Box>
|
|
|
|
|
<UploadBox
|
|
|
|
|
icon={<UploadIcon />}
|
|
|
|
|
sx={{
|
|
|
|
|
height: "48px",
|
|
|
|
|
width: "48px",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "5px" }}>Настройки видео</Typography>
|
|
|
|
|
<CustomCheckbox label="Зацикливать видео" />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "11px", mb: "14px" }}>Изображение для мобильной версии</Typography>
|
|
|
|
|
<UploadBox icon={<UploadIcon />} text="5 MB максимум" />
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Расположение элементов</Typography>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}>
|
|
|
|
|
<SelectableIconButton onClick={() => setAlignType("left")} isActive={alignType === "left"} Icon={AlignLeftIcon} />
|
|
|
|
|
<SelectableIconButton onClick={() => setAlignType("right")} isActive={alignType === "right"} Icon={AlignRightIcon} />
|
|
|
|
|
</Box>
|
|
|
|
|
{backgroundType === "image" &&
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px" }}>
|
|
|
|
|
Логотип</Typography>
|
|
|
|
|
}
|
|
|
|
|
<UploadBox sx={{ mt: "20px" }} icon={<UploadIcon />} text="5 MB максимум" />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>
|
|
|
|
|
Favicon</Typography>
|
|
|
|
|
<Box sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "end",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}>
|
2022-12-26 10:00:03 +00:00
|
|
|
|
<UploadBox
|
|
|
|
|
icon={<UploadIcon />}
|
|
|
|
|
sx={{
|
|
|
|
|
height: "48px",
|
|
|
|
|
width: "48px",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
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>
|
2022-12-26 10:00:03 +00:00
|
|
|
|
</Box>
|
|
|
|
|
<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>
|
|
|
|
|
<CustomTextField placeholder="Текст-заполнитель — это текст, который " text={""} />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Текст</Typography>
|
|
|
|
|
<CustomTextField placeholder="Текст-заполнитель — это текст, который " text={""} />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Текст кнопки</Typography>
|
|
|
|
|
<CustomTextField placeholder="Начать" text={""} />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Телефон</Typography>
|
|
|
|
|
<CustomTextField placeholder="+7 900 000 00 00" text={""} />
|
|
|
|
|
<CustomCheckbox label="Кликабельный" />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "11px", mb: "14px" }}>Название или слоган компании</Typography>
|
|
|
|
|
<CustomTextField placeholder="Текст-заполнитель — это текст, который " text={""} />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Сайт</Typography>
|
|
|
|
|
<CustomTextField placeholder="Текст-заполнитель — это текст, который " text={""} />
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Юридическая информация</Typography>
|
|
|
|
|
<CustomTextField placeholder="Текст-заполнитель — это текст, который " text={""} />
|
|
|
|
|
<Link sx={{
|
|
|
|
|
mt: "20px",
|
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "19px",
|
|
|
|
|
color: theme.palette.brightPurple.main,
|
|
|
|
|
textDecorationColor: theme.palette.brightPurple.main
|
|
|
|
|
}}>Дополнительно</Link>
|
|
|
|
|
<Typography sx={{ fontWeight: 500, color: theme.palette.grey3.main, mt: "20px", mb: "14px" }}>Mета заголовок</Typography>
|
|
|
|
|
<CustomTextField placeholder="Текст-заполнитель — это текст, который " text={""} />
|
2022-12-26 10:00:03 +00:00
|
|
|
|
<Typography sx={{
|
2023-06-07 14:20:45 +00:00
|
|
|
|
mt: "20px",
|
2022-12-26 10:00:03 +00:00
|
|
|
|
fontSize: "16px",
|
|
|
|
|
lineHeight: "19px",
|
2023-06-07 14:20:45 +00:00
|
|
|
|
maxWidth: "80%",
|
|
|
|
|
color: theme.palette.grey3.main,
|
|
|
|
|
}}>
|
|
|
|
|
Текст-заполнитель —
|
|
|
|
|
это текст, который имеет Текст-заполнитель —
|
|
|
|
|
это текст, который имеет Текст-заполнитель —
|
|
|
|
|
это текст, который имеет Текст-заполнитель —
|
|
|
|
|
это текст, который имеет Текст-заполнитель
|
|
|
|
|
</Typography>
|
2022-12-26 10:00:03 +00:00
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
2023-06-07 14:20:45 +00:00
|
|
|
|
<Box>
|
|
|
|
|
<Button variant="outlined">Отключить стартовую страницу</Button>
|
|
|
|
|
<Button variant="contained">Настроить вопросы</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
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|