diff --git a/src/app/pages/client/SidebarNav.tsx b/src/app/pages/client/SidebarNav.tsx index 2883bffd5..923458af4 100644 --- a/src/app/pages/client/SidebarNav.tsx +++ b/src/app/pages/client/SidebarNav.tsx @@ -5,7 +5,7 @@ import FocusTrap from 'focus-trap-react'; import { stopPropagation } from '$utils/keyboard'; import { useSetting } from '$state/hooks/settings'; import { settingsAtom } from '$state/settings'; -import { Sidebar, SidebarContent, SidebarStack } from '$components/sidebar'; +import { Sidebar, SidebarContent, SidebarStack, SidebarStackSeparator } from '$components/sidebar'; import { DirectTab, DirectDMsList, @@ -16,6 +16,7 @@ import { AccountSwitcherTab, } from './sidebar'; import { CreateTab } from './sidebar/CreateTab'; +import { SearchTab } from './sidebar/SearchTab'; export function SidebarNav() { const scrollRef = useRef(null); @@ -121,11 +122,15 @@ export function SidebarNav() { + + + + } sticky={ - + diff --git a/src/app/pages/client/sidebar/CreateTab.tsx b/src/app/pages/client/sidebar/CreateTab.tsx index d3383e28a..f547d94a2 100644 --- a/src/app/pages/client/sidebar/CreateTab.tsx +++ b/src/app/pages/client/sidebar/CreateTab.tsx @@ -26,18 +26,16 @@ import { Link, getPhosphorSize, SquaresFour, - Compass, - MagnifyingGlass, UsersThree, + Plus, } from '$components/icons/phosphor'; import { useMatrixClient } from '$hooks/useMatrixClient'; import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize'; import { useClientConfig } from '$hooks/useClientConfig'; -import { useAtom, useAtomValue } from 'jotai'; +import { useAtomValue } from 'jotai'; import { useNavToActivePathAtom } from '$state/hooks/navToActivePath'; import { getMxIdServer } from '$utils/mxIdHelper'; import { useExploreSelected } from '$hooks/router/useExploreSelected'; -import { searchModalAtom } from '$state/searchModal'; export function CreateTab() { const mx = useMatrixClient(); @@ -46,12 +44,11 @@ export function CreateTab() { const navToActivePath = useAtomValue(useNavToActivePathAtom()); const createSelected = useCreateSelected(); const exploreSelected = useExploreSelected(); - const [searchRoom, setSearchRoom] = useAtom(searchModalAtom); const navigate = useNavigate(); const [menuCords, setMenuCords] = useState(); const [joinAddress, setJoinAddress] = useState(false); - const isSelected = createSelected || exploreSelected || joinAddress || searchRoom; + const isSelected = createSelected || exploreSelected || joinAddress; const handleMenu: MouseEventHandler = (evt) => { setMenuCords(menuCords ? undefined : evt.currentTarget.getBoundingClientRect()); @@ -96,10 +93,6 @@ export function CreateTab() { navigate(getExplorePath()); setMenuCords(undefined); }; - const openSearchRoom = () => { - setSearchRoom(true); - setMenuCords(undefined); - }; return ( @@ -136,7 +129,7 @@ export function CreateTab() { onClick={handleCreateSpace} > - Create a New Community Space + Create a New Space - Explore Recommended Communities - - - - - Search amongst Your Rooms + Explore Recommended Spaces @@ -193,14 +172,13 @@ export function CreateTab() { outlined onClick={handleMenu} > - {(searchRoom && ) || - (joinAddress && ) || + {(joinAddress && ) || (exploreSelected && ( )) || (createSelected && ( - )) || } + )) || } {joinAddress && ( setOpen(true); + + return ( + + + {(triggerRef) => ( + + + + )} + + + ); +}