From eb7f8a8da07a34b1650bdab088f6871d79bc73cd Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 27 Feb 2022 23:53:59 -0800 Subject: [PATCH] Revert command bar launch from Search sidebar --- app/components/Sidebar/App.tsx | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/app/components/Sidebar/App.tsx b/app/components/Sidebar/App.tsx index aadc53a21..12a3a99d9 100644 --- a/app/components/Sidebar/App.tsx +++ b/app/components/Sidebar/App.tsx @@ -1,11 +1,9 @@ -import { useKBar } from "kbar"; import { observer } from "mobx-react"; import { EditIcon, SearchIcon, ShapesIcon, HomeIcon } from "outline-icons"; import * as React from "react"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; import { useTranslation } from "react-i18next"; -import { useHistory, useLocation } from "react-router-dom"; import styled from "styled-components"; import Flex from "~/components/Flex"; import Scrollable from "~/components/Scrollable"; @@ -37,12 +35,9 @@ import TrashLink from "./components/TrashLink"; function AppSidebar() { const { t } = useTranslation(); - const { ui, documents } = useStores(); + const { documents } = useStores(); const team = useCurrentTeam(); const user = useCurrentUser(); - const { query } = useKBar(); - const location = useLocation(); - const history = useHistory(); const can = usePolicy(team.id); React.useEffect(() => { @@ -59,16 +54,6 @@ function AppSidebar() { [dndArea] ); - const handleSearch = React.useCallback(() => { - const isSearching = location.pathname.startsWith(searchPath()); - if (isSearching) { - history.push(searchPath()); - } else { - ui.commandBarOpened(); - query.toggle(); - } - }, [ui, location, history, query]); - return ( {dndArea && ( @@ -94,7 +79,7 @@ function AppSidebar() { label={t("Home")} /> } label={t("Search")} exact={false}