поправила значения типов вопросов в свиче, добавилаисчезновение блока с иконками на плашках при свертывании их

This commit is contained in:
Tamara 2023-07-01 23:48:23 +03:00
parent b7efee31a5
commit 67c7fb8493
2 changed files with 34 additions and 27 deletions

@ -50,6 +50,7 @@ export default function QuestionsPageCard({totalIndex, DeleteClick}: Props) {
sx={{ width: "100%", maxWidth: "760px", display: "flex", alignItems: "center", gap: "10px", padding: "20px" }} sx={{ width: "100%", maxWidth: "760px", display: "flex", alignItems: "center", gap: "10px", padding: "20px" }}
> >
<CustomTextField placeholder="Заголовок вопроса" text={""} <CustomTextField placeholder="Заголовок вопроса" text={""}
//sx={{"& .MuiInputBase-root": {backgroundColor: isExpanded ? theme.palette.background.default : "transparent"}}}
onChange={e => {updateQuestionsList(params, totalIndex, {title: e.target.value}) onChange={e => {updateQuestionsList(params, totalIndex, {title: e.target.value})
console.log(listQuestions[params][totalIndex].title) console.log(listQuestions[params][totalIndex].title)
} }
@ -61,7 +62,10 @@ export default function QuestionsPageCard({totalIndex, DeleteClick}: Props) {
:<ExpandLessIcon fill="#7E2AEA"/> :<ExpandLessIcon fill="#7E2AEA"/>
} }
</IconButton> </IconButton>
<Box sx={{display: "flex"}}> {isExpanded ?
<></>
:
<Box sx={{display: "flex", borderRight: "solid 1px white"}}>
<FormControlLabel <FormControlLabel
control={ control={
<Checkbox <Checkbox
@ -82,6 +86,9 @@ export default function QuestionsPageCard({totalIndex, DeleteClick}: Props) {
<DeleteIcon /> <DeleteIcon />
</IconButton> </IconButton>
</Box> </Box>
}
<OneIcon /> <OneIcon />
<PointsIcon /> <PointsIcon />

@ -23,15 +23,15 @@ export default function SwitchQuestionsPage ({totalIndex }: Props) {
const {listQuestions, updateQuestionsList, createQuestion, removeQuestion} = questionStore() const {listQuestions, updateQuestionsList, createQuestion, removeQuestion} = questionStore()
const switchState = listQuestions[params][totalIndex].type const switchState = listQuestions[params][totalIndex].type
switch (switchState) { switch (switchState) {
case 'answer': case 'variant':
return (<AnswerOptions totalIndex={totalIndex}/>); return (<AnswerOptions totalIndex={totalIndex}/>);
break; break;
case 'answerpict': case 'images':
return (<OptionsPicture totalIndex={totalIndex}/>); return (<OptionsPicture totalIndex={totalIndex}/>);
break; break;
case 'answerandpict': case 'varimg':
return (<OptionsAndPicture totalIndex={totalIndex}/>); return (<OptionsAndPicture totalIndex={totalIndex}/>);
break; break;
@ -39,11 +39,11 @@ export default function SwitchQuestionsPage ({totalIndex }: Props) {
return (<Emoji totalIndex={totalIndex}/>); return (<Emoji totalIndex={totalIndex}/>);
break; break;
case 'textfield': case 'text':
return (<OwnTextField totalIndex={totalIndex}/>); return (<OwnTextField totalIndex={totalIndex}/>);
break; break;
case 'dropdown': case 'select':
return (<DropDown totalIndex={totalIndex}/>); return (<DropDown totalIndex={totalIndex}/>);
break; break;
@ -51,11 +51,11 @@ export default function SwitchQuestionsPage ({totalIndex }: Props) {
return (<DataOptions totalIndex={totalIndex}/>); return (<DataOptions totalIndex={totalIndex}/>);
break; break;
case 'slider': case 'number':
return (<SliderOptions totalIndex={totalIndex}/>); return (<SliderOptions totalIndex={totalIndex}/>);
break; break;
case 'uploader': case 'file':
return (<UploadFile totalIndex={totalIndex}/>); return (<UploadFile totalIndex={totalIndex}/>);
break; break;