fix change lang, убраны подсказки при открытом контейнере доп кнопок, кнопка юзера теперь становится невидимой при открытом контейнере(чтобы было видно работу hover)
This commit is contained in:
@@ -5,11 +5,11 @@ type TProps = {
|
||||
title: string
|
||||
caption: string
|
||||
isSelected: boolean
|
||||
onClick: () => void
|
||||
onClick: (isSelected: boolean) => void
|
||||
}
|
||||
|
||||
export const LangButton:React.FC<TProps> = React.memo((props) => {
|
||||
return <div className="lang-button-container" onClick={() => props.onClick()}>
|
||||
return <div className="lang-button-container" onClick={() => props.onClick(props.isSelected)}>
|
||||
<div className="lang-button-text-part">
|
||||
<span className="lang-button-text-title">{props.title}</span>
|
||||
<span className="lang-button-text-caption">{props.caption}</span>
|
||||
|
||||
@@ -16,8 +16,9 @@ type TProps = {
|
||||
|
||||
export const SettingButtons:React.FC<TProps> = React.memo((props) => {
|
||||
const [currentLang, setCurrentLang] = useState<boolean>(true); //temp
|
||||
function changeLang() {
|
||||
setCurrentLang(!currentLang);
|
||||
function changeLang(isSelected: boolean) {
|
||||
if(!isSelected)
|
||||
setCurrentLang(!currentLang);
|
||||
}
|
||||
|
||||
return <div className="setting-buttons-container">
|
||||
@@ -46,14 +47,14 @@ export const SettingButtons:React.FC<TProps> = React.memo((props) => {
|
||||
caption="Русский"
|
||||
isSelected={currentLang}
|
||||
// onClick={props.onClickSelectLang}
|
||||
onClick={changeLang}
|
||||
onClick={(isSelected) => changeLang(isSelected)}
|
||||
/>
|
||||
<LangButton
|
||||
title="English"
|
||||
caption="Английский"
|
||||
isSelected={!currentLang}
|
||||
// onClick={props.onClickSelectLang}
|
||||
onClick={changeLang}
|
||||
onClick={(isSelected) => changeLang(isSelected)}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ export const ButtonContainer:React.FC<TProps> = 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<TProps> = React.memo((props) => {
|
||||
isNotification={button?.isNotification}
|
||||
caption={CaptionToolbarButtons[button.type]}
|
||||
active={button?.active}
|
||||
isCaption={button.isCaption}
|
||||
isCaption={false}
|
||||
isSelected={button?.isSelected}
|
||||
/>
|
||||
<ToolbarButton
|
||||
|
||||
@@ -87,6 +87,10 @@
|
||||
/* border-top-left-radius: 50px solid #4f4f4f; */
|
||||
}
|
||||
|
||||
.toolbar-button-area.hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.toolbar-button {
|
||||
position: relative;
|
||||
width: 40px;
|
||||
|
||||
@@ -11,6 +11,7 @@ type TProps = {
|
||||
isNotification?: boolean
|
||||
isSelected?: boolean
|
||||
isLarge?: boolean
|
||||
isVisible?: boolean | false
|
||||
}
|
||||
|
||||
export const ToolbarButton:React.FC<TProps> = React.memo((props) => {
|
||||
@@ -25,7 +26,7 @@ export const ToolbarButton:React.FC<TProps> = React.memo((props) => {
|
||||
setShowAddButtons(!showAddButtons);
|
||||
}
|
||||
|
||||
return <div className="toolbar-button-area">
|
||||
return <div className={`toolbar-button-area ${props?.isVisible ? 'hidden' : ''}`}>
|
||||
<button
|
||||
className={
|
||||
`toolbar-button
|
||||
|
||||
Reference in New Issue
Block a user