frontPanel/src/pages/Questions/RatingOptions/settingRating.tsx

70 lines
2.9 KiB
TypeScript
Raw Normal View History

2023-04-23 08:39:34 +00:00
import React from "react";
import { Box, ButtonBase, Slider, Typography, useTheme } from "@mui/material";
import CustomCheckbox from "@ui_kit/CustomCheckbox";
2023-04-23 08:39:34 +00:00
import InfoIcon from "../../../assets/icons/InfoIcon";
import TropfyIcon from "../../../assets/icons/questionsPage/tropfyIcon";
import FlagIcon from "../../../assets/icons/questionsPage/FlagIcon";
import HeartIcon from "../../../assets/icons/questionsPage/heartIcon";
import LikeIcon from "../../../assets/icons/questionsPage/likeIcon";
import LightbulbIcon from "../../../assets/icons/questionsPage/lightbulbIcon";
import HashtagIcon from "../../../assets/icons/questionsPage/hashtagIcon";
import StarIconMini from "../../../assets/icons/questionsPage/StarIconMini";
export default function SettingSlider() {
2023-04-23 08:39:34 +00:00
const theme = useTheme();
const [current, setCurrent] = React.useState(1);
const buttonRatingForm: { icon: JSX.Element }[] = [
{ icon: <StarIconMini color={theme.palette.grey3.main} /> },
{ icon: <TropfyIcon color={theme.palette.grey3.main} /> },
{ icon: <FlagIcon color={theme.palette.grey3.main} /> },
{ icon: <HeartIcon color={theme.palette.grey3.main} /> },
{ icon: <LikeIcon color={theme.palette.grey3.main} /> },
{ icon: <LightbulbIcon color={theme.palette.grey3.main} /> },
{ icon: <HashtagIcon color={theme.palette.grey3.main} /> },
];
2023-04-23 08:39:34 +00:00
return (
<Box sx={{ display: "flex" }}>
<Box sx={{ padding: "20px" }}>
<Typography sx={{ marginBottom: "15px" }}>Настройки рейтинга</Typography>
<Typography sx={{ color: theme.palette.grey2.main, fontSize: "16px", fontWeight: 400 }}>Форма</Typography>
<Box sx={{ display: "flex", marginBottom: "15px" }}>
{buttonRatingForm.map((element, index) => (
<ButtonBase
key={index}
onClick={() => {
setCurrent(index);
}}
sx={{
backgroundColor: current === index ? theme.palette.brightPurple.main : "transparent",
color: current === index ? "#ffffff" : theme.palette.grey3.main,
width: "40px",
height: "40px",
borderRadius: "4px",
}}
>
{element.icon}
</ButtonBase>
))}
</Box>
2023-04-23 08:39:34 +00:00
<Typography sx={{ color: theme.palette.grey2.main, fontSize: "16px", fontWeight: 400 }}>Количество</Typography>
<Slider
defaultValue={5}
min={1}
max={10}
aria-label="Default"
valueLabelDisplay="auto"
sx={{ color: theme.palette.brightPurple.main }}
/>
</Box>
<Box sx={{ padding: "20px" }}>
<Typography>Настройки вопросов</Typography>
<CustomCheckbox label={"Необязательный вопрос"} />
<CustomCheckbox label={"Внутреннее название вопроса"} /> <InfoIcon />
</Box>
</Box>
);
}