mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-04 22:40:29 +03:00
remove search modal from searchTab
This commit is contained in:
parent
37470cf0ef
commit
c9fd61db1f
1 changed files with 9 additions and 14 deletions
|
|
@ -2,27 +2,22 @@ import React from 'react';
|
|||
import { Icon, Icons } from 'folds';
|
||||
import { useAtom } from 'jotai';
|
||||
import { SidebarAvatar, SidebarItem, SidebarItemTooltip } from '../../../components/sidebar';
|
||||
import { Search } from '../../../features/search';
|
||||
import { searchModalAtom } from '../../../state/searchModal';
|
||||
|
||||
export function SearchTab() {
|
||||
const [opened, setOpen] = useAtom(searchModalAtom);
|
||||
|
||||
const open = () => setOpen(true);
|
||||
const close = () => setOpen(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SidebarItem active={opened}>
|
||||
<SidebarItemTooltip tooltip="Search">
|
||||
{(triggerRef) => (
|
||||
<SidebarAvatar as="button" ref={triggerRef} outlined onClick={open}>
|
||||
<Icon src={Icons.Search} filled={opened} />
|
||||
</SidebarAvatar>
|
||||
)}
|
||||
</SidebarItemTooltip>
|
||||
</SidebarItem>
|
||||
{opened && <Search requestClose={close} />}
|
||||
</>
|
||||
<SidebarItem active={opened}>
|
||||
<SidebarItemTooltip tooltip="Search">
|
||||
{(triggerRef) => (
|
||||
<SidebarAvatar as="button" ref={triggerRef} outlined onClick={open}>
|
||||
<Icon src={Icons.Search} filled={opened} />
|
||||
</SidebarAvatar>
|
||||
)}
|
||||
</SidebarItemTooltip>
|
||||
</SidebarItem>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue