fix: rating stars

This commit is contained in:
IlyaDoronin 2023-09-21 15:15:49 +03:00
parent cf6109eb4e
commit d855833c96
2 changed files with 38 additions and 27 deletions

@ -51,8 +51,11 @@ export default function RatingOptions({ totalIndex }: Props) {
<> <>
<Box <Box
sx={{ sx={{
width: isMobile ? "auto" : "100%", width: isMobile
maxWidth: "310px", ? "auto"
: `${listQuestions[quizId][totalIndex].content.steps * 44}px`,
minWidth: "200px",
maxWidth: "440px",
display: "flex", display: "flex",
padding: "20px", padding: "20px",
flexDirection: "column", flexDirection: "column",
@ -96,32 +99,34 @@ export default function RatingOptions({ totalIndex }: Props) {
</Box> </Box>
))} ))}
</Box> </Box>
<Box {!listQuestions[quizId][totalIndex].content.ratingDescription && (
sx={{ <Box
display: "flex",
alignItems: "center",
justifyContent: "space-between",
}}
>
<Typography
sx={{ sx={{
color: theme.palette.grey2.main, display: "flex",
fontSize: "16px", alignItems: "center",
fontWeight: 400, justifyContent: "space-between",
}} }}
> >
Негативно <Typography
</Typography> sx={{
<Typography color: theme.palette.grey2.main,
sx={{ fontSize: "16px",
color: theme.palette.grey2.main, fontWeight: 400,
fontSize: "16px", }}
fontWeight: 400, >
}} Негативно
> </Typography>
Позитивно <Typography
</Typography> sx={{
</Box> color: theme.palette.grey2.main,
fontSize: "16px",
fontWeight: 400,
}}
>
Позитивно
</Typography>
</Box>
)}
{listQuestions[quizId][totalIndex].content.ratingExpanded && {listQuestions[quizId][totalIndex].content.ratingExpanded &&
(listQuestions[quizId][totalIndex].content.ratingDescription ? ( (listQuestions[quizId][totalIndex].content.ratingDescription ? (
<Typography> <Typography>

@ -115,7 +115,7 @@ export default function SettingSlider({ totalIndex }: SettingSliderProps) {
</Typography> </Typography>
<Slider <Slider
value={listQuestions[quizId][totalIndex].content.steps} value={listQuestions[quizId][totalIndex].content.steps}
min={1} min={2}
max={10} max={10}
aria-label="Default" aria-label="Default"
valueLabelDisplay="auto" valueLabelDisplay="auto"
@ -139,7 +139,13 @@ export default function SettingSlider({ totalIndex }: SettingSliderProps) {
}); });
}} }}
/> />
<Box sx={{ width: isMobile ? "90%" : "auto", display: "flex", alignItems: "center" }}> <Box
sx={{
width: isMobile ? "90%" : "auto",
display: "flex",
alignItems: "center",
}}
>
<CustomCheckbox <CustomCheckbox
sx={{ mr: isMobile ? "0px" : "16px" }} sx={{ mr: isMobile ? "0px" : "16px" }}
label={"Внутреннее название вопроса"} label={"Внутреннее название вопроса"}