diff --git a/src/pages/Questions/answerOptions/UploadImage.tsx b/src/pages/Questions/answerOptions/UploadImage.tsx index 85636e49..69306b6f 100644 --- a/src/pages/Questions/answerOptions/UploadImage.tsx +++ b/src/pages/Questions/answerOptions/UploadImage.tsx @@ -8,17 +8,20 @@ const Modalka = ({open, handleClose, imgHC}:any) => { const dropZone = React.useRef(null); const [ready, setReady] = React.useState(false); + + const dragenterHC = () => { + console.log("a") + setReady(true) + } + console.log(dropZone.current) React.useEffect(() => { console.log(dropZone.current) if (dropZone.current) { - dropZone.current.addEventListener("dragenter", () => { - console.log("a") - setReady(true) - }) + dropZone.current.addEventListener("dragenter", dragenterHC) } - return () => {console.log("end")} - }) + return () => {dropZone.current.removeEventListener("dragenter", dragenterHC)} + },) return ( { boxShadow: 24, p: 0,}}> Добавьте изображение imgHC(event.target)} hidden accept="image/*" multiple type="file" /> { justifyContent: "space-between", alignItems: "center", backgroundColor: theme.palette.background.default, - border: `1px solid ${theme.palette.grey2.main}`, + border: `1px solid ${ready? "red" : theme.palette.grey2.main}`, borderRadius: "8px", }} diff --git a/src/pages/Questions/answerOptions/branchingAnswerOptions.tsx b/src/pages/Questions/answerOptions/branchingAnswerOptions.tsx new file mode 100644 index 00000000..5bce2135 --- /dev/null +++ b/src/pages/Questions/answerOptions/branchingAnswerOptions.tsx @@ -0,0 +1,201 @@ +import { + Box, + Button, + FormControl, FormControlLabel, Link, + MenuItem, + Modal, Radio, RadioGroup, + Select, + SelectChangeEvent, + Typography, + useTheme +} from "@mui/material"; +import * as React from "react"; +import InfoIcon from "../../../components/icons/InfoIcon"; +import ArrowDown from "../../../components/icons/ArrowDownIcon"; +import CustomButton from "../../../components/CustomButton"; + + +export default function BranchingAnswerOptions() { + const theme = useTheme() + const [open, setOpen] = React.useState(false); + const handleOpen = () => setOpen(true); + const handleClose = () => setOpen(false); + + const [display, setDisplay] = React.useState('10'); + const handleChange = (event: SelectChangeEvent) => { + setDisplay(event.target.value); + } + + const [value, setValue] = React.useState('female'); + + const handleChangeRadio = (event: React.ChangeEvent) => { + setValue((event.target as HTMLInputElement).value); + }; + return( + <> + + + + + 0 + + + + + + + если в ответе на вопрос + + { + // }} + > + Добавить условие + + + + + } label="Все условия обязательны" /> + } label="Обязательно хотя бы одно условие" /> + + + + + + Отмена + Готово + + + + + + ); +} \ No newline at end of file diff --git a/src/pages/Questions/answerOptions/switchAnswerOptions.tsx b/src/pages/Questions/answerOptions/switchAnswerOptions.tsx index 5569c2f0..b28c0d56 100644 --- a/src/pages/Questions/answerOptions/switchAnswerOptions.tsx +++ b/src/pages/Questions/answerOptions/switchAnswerOptions.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import UploadImage from "./UploadImage"; import HelpAnswerOptions from "./helpAnswerOptions"; import ResponseSettings from "./responseSettings"; +import BranchingAnswerOptions from "./branchingAnswerOptions"; interface Props { @@ -18,7 +19,7 @@ export default function SwitchAnswerOptions({switchState = 'setting' }: Props) { return (); break case 'branching': - return (<>); + return (); break; case 'image': return ();