fix: branching styles

This commit is contained in:
IlyaDoronin 2023-08-15 15:20:09 +03:00
parent 1de71c73d2
commit fb545cb242
2 changed files with 80 additions and 15 deletions

@ -1,11 +1,16 @@
import { IconButton } from "@mui/material"; import { IconButton } from "@mui/material";
export default function Info() { type InfoProps = {
width?: number;
height?: number;
};
export default function Info({ width = 20, height = 20 }: InfoProps) {
return ( return (
<IconButton> <IconButton>
<svg <svg
width="20" width={width}
height="20" height={height}
viewBox="0 0 20 20" viewBox="0 0 20 20"
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

@ -18,10 +18,11 @@ import {
import * as React from "react"; import * as React from "react";
import ArrowDown from "@icons/ArrowDownIcon"; import ArrowDown from "@icons/ArrowDownIcon";
import { useState } from "react"; import { useState } from "react";
import { questionStore, resetSomeField } from "@root/questions";
import DeleteIcon from "@icons/questionsPage/deleteIcon"; import DeleteIcon from "@icons/questionsPage/deleteIcon";
import RadioCheck from "@ui_kit/RadioCheck"; import RadioCheck from "@ui_kit/RadioCheck";
import RadioIcon from "@ui_kit/RadioIcon"; import RadioIcon from "@ui_kit/RadioIcon";
import { questionStore, resetSomeField } from "@root/questions"; import InfoIcon from "../../assets/icons/Info";
export default function BranchingQuestions() { export default function BranchingQuestions() {
const { openedModalSettings } = questionStore(); const { openedModalSettings } = questionStore();
@ -52,6 +53,7 @@ export default function BranchingQuestions() {
<Box <Box
sx={{ sx={{
position: "absolute" as "absolute", position: "absolute" as "absolute",
overflow: "hidden",
top: "50%", top: "50%",
left: "50%", left: "50%",
transform: "translate(-50%, -50%)", transform: "translate(-50%, -50%)",
@ -63,6 +65,18 @@ export default function BranchingQuestions() {
p: 0, p: 0,
}} }}
> >
<Box
sx={{
boxSizing: "border-box",
background: "#F2F3F7",
padding: "25px",
height: "70px",
display: "flex",
}}
>
<Typography sx={{ color: "#9A9AAF" }}>()</Typography>
<InfoIcon width={24} height={24} />
</Box>
<Box <Box
sx={{ sx={{
padding: "20px", padding: "20px",
@ -140,7 +154,7 @@ export default function BranchingQuestions() {
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
gap: "20px", gap: "20px",
p: "4px", padding: "10px",
borderRadius: "5px", borderRadius: "5px",
color: theme.palette.grey2.main, color: theme.palette.grey2.main,
}} }}
@ -153,7 +167,7 @@ export default function BranchingQuestions() {
display: "flex", display: "flex",
alignItems: "center", alignItems: "center",
gap: "20px", gap: "20px",
p: "4px", padding: "10px",
borderRadius: "5px", borderRadius: "5px",
color: theme.palette.grey2.main, color: theme.palette.grey2.main,
}} }}
@ -162,11 +176,27 @@ export default function BranchingQuestions() {
</MenuItem> </MenuItem>
</Select> </Select>
</FormControl> </FormControl>
<Typography sx={{ color: theme.palette.grey2.main }}>если в ответе на вопрос</Typography> <Typography sx={{ color: theme.palette.grey2.main }}>
если в ответе на вопрос
</Typography>
</Box> </Box>
{condition ? ( {condition ? (
<Box sx={{ padding: "20px", borderRadius: "8px", height: "100%", bgcolor: "#F2F3F7" }}> <Box
<Box sx={{ display: "flex", justifyContent: "space-between", alignItems: "center", pb: "14px" }}> sx={{
padding: "20px",
borderRadius: "8px",
height: "100%",
bgcolor: "#F2F3F7",
}}
>
<Box
sx={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
pb: "14px",
}}
>
<Typography>Условие 1</Typography> <Typography>Условие 1</Typography>
<IconButton sx={{ borderRadius: "6px", padding: "2px" }}> <IconButton sx={{ borderRadius: "6px", padding: "2px" }}>
<DeleteIcon color={"#4D4D4D"} /> <DeleteIcon color={"#4D4D4D"} />
@ -195,7 +225,9 @@ export default function BranchingQuestions() {
/> />
<Box sx={{ display: "flex", alignItems: "center", pb: "14px" }}> <Box sx={{ display: "flex", alignItems: "center", pb: "14px" }}>
<Typography>Дан ответ</Typography> <Typography>Дан ответ</Typography>
<Typography sx={{ color: "#7E2AEA", pl: "10px" }}>(Укажите один или несколько вариантов)</Typography> <Typography sx={{ color: "#7E2AEA", pl: "10px" }}>
(Укажите один или несколько вариантов)
</Typography>
</Box> </Box>
<TextField <TextField
// value={text} // value={text}
@ -230,7 +262,10 @@ export default function BranchingQuestions() {
<Link <Link
component="button" component="button"
variant="body2" variant="body2"
sx={{ color: theme.palette.brightPurple.main }} sx={{
color: theme.palette.brightPurple.main,
marginBottom: "10px",
}}
onClick={() => setCondition(true)} onClick={() => setCondition(true)}
> >
Добавить условие Добавить условие
@ -246,23 +281,48 @@ export default function BranchingQuestions() {
<FormControlLabel <FormControlLabel
sx={{ color: theme.palette.grey2.main }} sx={{ color: theme.palette.grey2.main }}
value="1" value="1"
control={<Radio checkedIcon={<RadioCheck />} icon={<RadioIcon />} />} control={
<Radio
checkedIcon={<RadioCheck />}
icon={<RadioIcon />}
/>
}
label="Все условия обязательны" label="Все условия обязательны"
/> />
<FormControlLabel <FormControlLabel
sx={{ color: theme.palette.grey2.main }} sx={{ color: theme.palette.grey2.main }}
value="2" value="2"
control={<Radio checkedIcon={<RadioCheck />} icon={<RadioIcon />} />} control={
<Radio
checkedIcon={<RadioCheck />}
icon={<RadioIcon />}
/>
}
label="Обязательно хотя бы одно условие" label="Обязательно хотя бы одно условие"
/> />
</RadioGroup> </RadioGroup>
</FormControl> </FormControl>
</Box> </Box>
<Box sx={{ display: "flex", justifyContent: "end", gap: "10px" }}> <Box sx={{ display: "flex", justifyContent: "end", gap: "10px" }}>
<Button variant="outlined" onClick={handleClose}> <Button
variant="outlined"
onClick={handleClose}
sx={{
width: "100%",
maxWidth: "130px",
}}
>
Отмена Отмена
</Button> </Button>
<Button variant="contained">Готово</Button> <Button
variant="contained"
sx={{
width: "100%",
maxWidth: "130px",
}}
>
Готово
</Button>
</Box> </Box>
</Box> </Box>
</Box> </Box>