Contacts: Hide the story toggler when the contact search component is displayed (#5434)
This commit is contained in:
parent
7c90a86d6c
commit
c649fd004f
@ -120,7 +120,9 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
|
|||||||
|
|
||||||
const [isBotMenuOpen, markBotMenuOpen, unmarkBotMenuOpen] = useFlag();
|
const [isBotMenuOpen, markBotMenuOpen, unmarkBotMenuOpen] = useFlag();
|
||||||
|
|
||||||
|
const areContactsVisible = content === LeftColumnContent.Contacts;
|
||||||
const hasMenu = content === LeftColumnContent.ChatList;
|
const hasMenu = content === LeftColumnContent.ChatList;
|
||||||
|
|
||||||
const selectedSearchDate = useMemo(() => {
|
const selectedSearchDate = useMemo(() => {
|
||||||
return searchDate
|
return searchDate
|
||||||
? formatDateToString(new Date(searchDate * 1000))
|
? formatDateToString(new Date(searchDate * 1000))
|
||||||
@ -215,6 +217,8 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
|
|||||||
const headerRef = useRef<HTMLDivElement>(null);
|
const headerRef = useRef<HTMLDivElement>(null);
|
||||||
useElectronDrag(headerRef);
|
useElectronDrag(headerRef);
|
||||||
|
|
||||||
|
const withStoryToggler = !isSearchFocused && !selectedSearchDate && !globalSearchChatId && !areContactsVisible;
|
||||||
|
|
||||||
const searchContent = useMemo(() => {
|
const searchContent = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -293,7 +297,9 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
|
|||||||
onSpinnerClick={connectionStatusPosition === 'minimized' ? toggleConnectionStatus : undefined}
|
onSpinnerClick={connectionStatusPosition === 'minimized' ? toggleConnectionStatus : undefined}
|
||||||
>
|
>
|
||||||
{searchContent}
|
{searchContent}
|
||||||
<StoryToggler canShow={!isSearchFocused && !selectedSearchDate && !globalSearchChatId} />
|
<StoryToggler
|
||||||
|
canShow={withStoryToggler}
|
||||||
|
/>
|
||||||
</SearchInput>
|
</SearchInput>
|
||||||
{isCurrentUserPremium && <StatusButton />}
|
{isCurrentUserPremium && <StatusButton />}
|
||||||
{hasPasscode && (
|
{hasPasscode && (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user