Merge branch 'fix-visual' into 'staging'

закомментированы ключи полей в форме контактов, фикс состояния кнопок там же

See merge request frontend/squiz!147
This commit is contained in:
Nastya 2024-01-26 00:30:14 +00:00
commit 44ffba41de
2 changed files with 42 additions and 34 deletions

@ -71,38 +71,38 @@ export default function NewFieldParent({
text={""}
/>
</Box>
<Box sx={{ display: "flex", flexDirection: "column", gap: "15px" }}>
<Typography>Ключ</Typography>
<TextField
value={quiz.config.formContact.fields[defaultValue].key}
onChange={({ target }) => {
updateQuiz(quiz.id, (quiz) => {
quiz.config.formContact.fields[defaultValue].key = target.value;
});
}}
placeholder="text"
sx={{
"& .css-1d3z3hw-MuiOutlinedInput-notchedOutline": {
border: "none",
},
"& .MuiInputBase-root": {
height: "48px",
borderRadius: "10px",
backgroundColor: "#EEE4FC",
},
}}
/>
<CustomCheckbox
checked={quiz.config.formContact.fields[defaultValue].required}
handleChange={({ target }) => {
updateQuiz(quiz.id, (quiz) => {
quiz.config.formContact.fields[defaultValue].required =
target.checked;
});
}}
label={"Обязательно к заполнению"}
/>
</Box>
{/*<Box sx={{ display: "flex", flexDirection: "column", gap: "15px" }}>*/}
{/* <Typography>Ключ</Typography>*/}
{/* <TextField*/}
{/* value={quiz.config.formContact.fields[defaultValue].key}*/}
{/* onChange={({ target }) => {*/}
{/* updateQuiz(quiz.id, (quiz) => {*/}
{/* quiz.config.formContact.fields[defaultValue].key = target.value;*/}
{/* });*/}
{/* }}*/}
{/* placeholder="text"*/}
{/* sx={{*/}
{/* "& .css-1d3z3hw-MuiOutlinedInput-notchedOutline": {*/}
{/* border: "none",*/}
{/* },*/}
{/* "& .MuiInputBase-root": {*/}
{/* height: "48px",*/}
{/* borderRadius: "10px",*/}
{/* backgroundColor: "#EEE4FC",*/}
{/* },*/}
{/* }}*/}
{/* />*/}
{/* <CustomCheckbox*/}
{/* checked={quiz.config.formContact.fields[defaultValue].required}*/}
{/* handleChange={({ target }) => {*/}
{/* updateQuiz(quiz.id, (quiz) => {*/}
{/* quiz.config.formContact.fields[defaultValue].required =*/}
{/* target.checked;*/}
{/* });*/}
{/* }}*/}
{/* label={"Обязательно к заполнению"}*/}
{/* />*/}
{/*</Box>*/}
{/* <Box>
<Typography>Запрашивать на</Typography>
<CustomCheckbox label={'Шаг 1'}/>

@ -128,7 +128,11 @@ export default function WindowNewField({ drawerState, closeDrawer }: Props) {
{buttonSetting.flatMap((e, i) =>
drawerState.field === e.value || drawerState.field === "all" ? (
<MiniButtonSetting
disabled={quiz.config.formContact.fields[e.value].used}
disabled={
drawerState.field === e.value
? false
: quiz.config.formContact.fields[e.value].used
}
key={i}
onClick={() => {
SSHC(e.value);
@ -139,9 +143,13 @@ export default function WindowNewField({ drawerState, closeDrawer }: Props) {
? theme.palette.brightPurple.main
: "transparent",
color:
switchState === e.value && drawerState.field === "all"
(switchState === e.value && drawerState.field === "all") ||
drawerState.field === e.value
? "#ffffff"
: theme.palette.grey3.main,
"&:hover": {
background: switchState === e.value ? "#581CA7" : "#f5f5f5",
},
}}
>
{e.icon}