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