From 0dc20955bbcedc10cdfa9a09c8c86661d19ba440 Mon Sep 17 00:00:00 2001 From: Tamara Date: Tue, 18 Apr 2023 01:02:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=B4=D1=80=D0=B0=D0=B2=D0=B5=D1=80=D1=83=20=D0=B2?= =?UTF-8?q?=D0=BD=D1=83=D1=82=D1=80=D0=B8=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ContactFormPage/ContactFormPage.tsx | 33 +++++++--- src/pages/ContactFormPage/DrawerParent.tsx | 21 ++----- .../Massengers/WindowMessengers.tsx | 3 +- .../NewField/ButtonsNewField.tsx | 6 -- .../NewField/NewFieldParent.tsx | 2 +- .../NewField/SwitchNewField.tsx | 14 ++++- .../NewField/WindowNewField.tsx | 4 +- src/pages/ContactFormPage/SelectMask.tsx | 61 ++++++++++--------- 8 files changed, 80 insertions(+), 64 deletions(-) diff --git a/src/pages/ContactFormPage/ContactFormPage.tsx b/src/pages/ContactFormPage/ContactFormPage.tsx index 3bd46748..285399a9 100644 --- a/src/pages/ContactFormPage/ContactFormPage.tsx +++ b/src/pages/ContactFormPage/ContactFormPage.tsx @@ -13,6 +13,8 @@ import DrawerNewField from "./DrawerParent"; import WindowNewField from "./NewField/WindowNewField"; import WindowMessengers from "./Massengers/WindowMessengers"; + + export default function ContactFormPage() { @@ -26,6 +28,12 @@ export default function ContactFormPage() { setActiveStep((prevActiveStep) => prevActiveStep - 1); }; + const [drawerNewField, setDrawerNewField] = React.useState(false); + const [drawerMessenger, setDrawerMessenger] = React.useState(false); + + const drawerNewFieldHC = (bool:boolean) => {setDrawerNewField(bool)} + const drawerMessengerHC = (bool:boolean) => {setDrawerMessenger(bool)} + const theme = useTheme(); return ( <> @@ -50,15 +58,22 @@ export default function ContactFormPage() { Телефон* - - - {/* Добавить мессенджеры*/} + + + drawerMessengerHC(true)} + sx={{ + fontSize: "16px", + lineHeight: "19px", + color: theme.palette.brightPurple.main, + textDecorationColor: theme.palette.brightPurple.main, + textAlign: 'left' + }}>Добавить мессенджеры + + diff --git a/src/pages/ContactFormPage/DrawerParent.tsx b/src/pages/ContactFormPage/DrawerParent.tsx index 8a931ce0..df22bc8e 100644 --- a/src/pages/ContactFormPage/DrawerParent.tsx +++ b/src/pages/ContactFormPage/DrawerParent.tsx @@ -7,28 +7,17 @@ import {SxProps, Theme} from "@mui/material"; interface Props { outerContainerSx?: SxProps; children?: React.ReactNode; + isOpen: boolean; + openHC: (arg0: boolean) => void } -export default function DrawerNewField({outerContainerSx: sx, children }: Props) { - const [state, setState] = React.useState({ - right: false, - }); - - const toggleDrawer = - (anchor: 'right', open: boolean) => - () => { - setState({ ...state, 'right' : open }); - }; - +export default function DrawerNewField({outerContainerSx: sx, children, isOpen, openHC }: Props) { return ( <> - openHC(false)} > ("contact"); return( <> - + Настройки мессенджеров @@ -61,6 +61,7 @@ export default function WindowMessengers() { : <> } + ) } \ No newline at end of file diff --git a/src/pages/ContactFormPage/NewField/ButtonsNewField.tsx b/src/pages/ContactFormPage/NewField/ButtonsNewField.tsx index f65c770e..c79354f3 100644 --- a/src/pages/ContactFormPage/NewField/ButtonsNewField.tsx +++ b/src/pages/ContactFormPage/NewField/ButtonsNewField.tsx @@ -26,11 +26,6 @@ export default function ButtonsNewField ({SSHC, switchState}:Props) { ] return ( - ))} - ) } \ No newline at end of file diff --git a/src/pages/ContactFormPage/NewField/NewFieldParent.tsx b/src/pages/ContactFormPage/NewField/NewFieldParent.tsx index e7ae520a..04d47602 100644 --- a/src/pages/ContactFormPage/NewField/NewFieldParent.tsx +++ b/src/pages/ContactFormPage/NewField/NewFieldParent.tsx @@ -34,7 +34,7 @@ export default function NewFieldParent ({defaultValue, placeholderHelp, placehol { + setSwitchMask(bool) + } switch (switchState) { case 'name': return (); @@ -31,8 +35,16 @@ export default function SwitchNewField({switchState ='name'}: Props) { display: 'flex', justifyContent: 'space-between' }} + onClick={() => { + SwitchMaskHC(!SwitchMask) + }} /> - + {SwitchMask ? + + : + <> + } + ); break; diff --git a/src/pages/ContactFormPage/NewField/WindowNewField.tsx b/src/pages/ContactFormPage/NewField/WindowNewField.tsx index 5cb20fe6..467c6f96 100644 --- a/src/pages/ContactFormPage/NewField/WindowNewField.tsx +++ b/src/pages/ContactFormPage/NewField/WindowNewField.tsx @@ -10,7 +10,7 @@ import {useState} from "react"; export default function WindowNewField() { const theme = useTheme(); - const [switchState, setSwitchState] = React.useState('setting'); + const [switchState, setSwitchState] = React.useState('name'); const SSHC = (data: string) => { setSwitchState(data) } @@ -18,7 +18,7 @@ export default function WindowNewField() { return( <> - + Новое поле diff --git a/src/pages/ContactFormPage/SelectMask.tsx b/src/pages/ContactFormPage/SelectMask.tsx index 92ee556d..c7f35add 100644 --- a/src/pages/ContactFormPage/SelectMask.tsx +++ b/src/pages/ContactFormPage/SelectMask.tsx @@ -7,10 +7,10 @@ import {useState} from "react"; type SelectMask = 'country'| 'mymask'; export default function SelectMask () { - // const [State, setState] = React.useState(''); - // const StateHC = (data: string) => { - // setState(data) - // } + const [State, setState] = React.useState(false); + const StateHC = (bool:boolean) => { + setState(bool) + } const theme = useTheme() const [selectMask, setSelectMask] = useState("country"); @@ -37,34 +37,39 @@ export default function SelectMask () { component="button" variant="body2" sx={{color: theme.palette.brightPurple.main, textAlign: 'left'}} - // onClick={() => { - // StateHC() - // }} + onClick={() => { + StateHC(!State) + }} > Расширенные настройки - - - Страна по умолчанию - - Если ничего не выбрано, страна будет выбрана автоматически + {State ? + + + Страна по умолчанию + + Если ничего не выбрано, страна будет выбрана автоматически + + + Выделенные страны + + Выбранные страны будут показываться вверху списка + + + Показываемые страны + + Будут показываться только выбранные страны + + + Игнорируемые страны + + Выбранные страны будут не будут показываться в списке + - - Выделенные страны - - Выбранные страны будут показываться вверху списка - - - Показываемые страны - - Будут показываться только выбранные страны - - - Игнорируемые страны - - Выбранные страны будут не будут показываться в списке - - + : + <> + } + : <>