From 8dd053ff70369e6c84bc8f3f4ebdb449ab77978c Mon Sep 17 00:00:00 2001 From: DmitriyB Date: Fri, 12 Aug 2022 11:21:30 +0500 Subject: [PATCH] =?UTF-8?q?fix=20change=20lang,=20=D1=83=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B?= =?UTF-8?q?=D1=82=D0=BE=D0=BC=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=20=D0=B4=D0=BE=D0=BF=20=D0=BA=D0=BD=D0=BE?= =?UTF-8?q?=D0=BF=D0=BE=D0=BA,=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=8E=D0=B7=D0=B5=D1=80=D0=B0=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D1=8C=20=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=BD=D0=B5=D0=B2=D0=B8=D0=B4=D0=B8=D0=BC=D0=BE=D0=B9?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D0=BE=D0=BC=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=B9=D0=BD=D0=B5?= =?UTF-8?q?=D1=80=D0=B5(=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=B1=D1=8B?= =?UTF-8?q?=D0=BB=D0=BE=20=D0=B2=D0=B8=D0=B4=D0=BD=D0=BE=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D1=83=20hover)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/mainScreen/mobileAddPart/langButton.tsx | 4 ++-- .../mainScreen/mobileAddPart/settingButtons.tsx | 9 +++++---- src/components/mainScreen/toolbar/buttonContainer.tsx | 3 ++- src/components/mainScreen/toolbar/toolbar.css | 4 ++++ src/components/mainScreen/toolbar/toolbarButton.tsx | 3 ++- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/components/mainScreen/mobileAddPart/langButton.tsx b/src/components/mainScreen/mobileAddPart/langButton.tsx index 2ee53f1..16d4ef3 100644 --- a/src/components/mainScreen/mobileAddPart/langButton.tsx +++ b/src/components/mainScreen/mobileAddPart/langButton.tsx @@ -5,11 +5,11 @@ type TProps = { title: string caption: string isSelected: boolean - onClick: () => void + onClick: (isSelected: boolean) => void } export const LangButton:React.FC = React.memo((props) => { - return
props.onClick()}> + return
props.onClick(props.isSelected)}>
{props.title} {props.caption} diff --git a/src/components/mainScreen/mobileAddPart/settingButtons.tsx b/src/components/mainScreen/mobileAddPart/settingButtons.tsx index d56dabf..35de643 100644 --- a/src/components/mainScreen/mobileAddPart/settingButtons.tsx +++ b/src/components/mainScreen/mobileAddPart/settingButtons.tsx @@ -16,8 +16,9 @@ type TProps = { export const SettingButtons:React.FC = React.memo((props) => { const [currentLang, setCurrentLang] = useState(true); //temp - function changeLang() { - setCurrentLang(!currentLang); + function changeLang(isSelected: boolean) { + if(!isSelected) + setCurrentLang(!currentLang); } return
@@ -46,14 +47,14 @@ export const SettingButtons:React.FC = React.memo((props) => { caption="Русский" isSelected={currentLang} // onClick={props.onClickSelectLang} - onClick={changeLang} + onClick={(isSelected) => changeLang(isSelected)} /> changeLang(isSelected)} /> } diff --git a/src/components/mainScreen/toolbar/buttonContainer.tsx b/src/components/mainScreen/toolbar/buttonContainer.tsx index 132902f..fa4ea83 100644 --- a/src/components/mainScreen/toolbar/buttonContainer.tsx +++ b/src/components/mainScreen/toolbar/buttonContainer.tsx @@ -46,6 +46,7 @@ export const ButtonContainer:React.FC = React.memo((props) => { active={button?.active} isCaption={button.isCaption} isSelected={button?.isSelected} + isVisible={openedAddButtons === button.type + index + 'areacont'} /> { button.type.includes('user') && windowHeight > 700 ? @@ -57,7 +58,7 @@ export const ButtonContainer:React.FC = React.memo((props) => { isNotification={button?.isNotification} caption={CaptionToolbarButtons[button.type]} active={button?.active} - isCaption={button.isCaption} + isCaption={false} isSelected={button?.isSelected} /> = React.memo((props) => { @@ -25,7 +26,7 @@ export const ToolbarButton:React.FC = React.memo((props) => { setShowAddButtons(!showAddButtons); } - return
+ return