diff --git a/app/components/Sidebar/App.tsx b/app/components/Sidebar/App.tsx index 61a6176bd..97fd3841e 100644 --- a/app/components/Sidebar/App.tsx +++ b/app/components/Sidebar/App.tsx @@ -65,15 +65,6 @@ function AppSidebar() { [dndArea] ); - const handleToggleSidebar = React.useCallback( - (ev) => { - ev.preventDefault(); - ev.stopPropagation(); - ui.toggleCollapsedSidebar(); - }, - [ui] - ); - return ( @@ -103,7 +94,7 @@ function AppSidebar() { } - onClick={handleToggleSidebar} + onClick={ui.toggleCollapsedSidebar} /> diff --git a/app/components/Sidebar/Settings.tsx b/app/components/Sidebar/Settings.tsx index a4e03552f..60b7cce2f 100644 --- a/app/components/Sidebar/Settings.tsx +++ b/app/components/Sidebar/Settings.tsx @@ -1,6 +1,6 @@ import groupBy from "lodash/groupBy"; import { observer } from "mobx-react"; -import { BackIcon } from "outline-icons"; +import { BackIcon, SidebarIcon } from "outline-icons"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; @@ -8,17 +8,21 @@ import styled from "styled-components"; import Flex from "~/components/Flex"; import Scrollable from "~/components/Scrollable"; import useSettingsConfig from "~/hooks/useSettingsConfig"; -import Desktop from "~/utils/Desktop"; +import useStores from "~/hooks/useStores"; import isCloudHosted from "~/utils/isCloudHosted"; +import { metaDisplay } from "~/utils/keyboard"; +import Tooltip from "../Tooltip"; import Sidebar from "./Sidebar"; import Header from "./components/Header"; import HistoryNavigation from "./components/HistoryNavigation"; import Section from "./components/Section"; import SidebarButton from "./components/SidebarButton"; import SidebarLink from "./components/SidebarLink"; +import ToggleButton from "./components/ToggleButton"; import Version from "./components/Version"; function SettingsSidebar() { + const { ui } = useStores(); const { t } = useTranslation(); const history = useHistory(); const configs = useSettingsConfig(); @@ -35,8 +39,19 @@ function SettingsSidebar() { title={t("Return to App")} image={} onClick={returnToApp} - minHeight={Desktop.hasInsetTitlebar() ? undefined : 48} - /> + > + + } + onClick={ui.toggleCollapsedSidebar} + /> + + diff --git a/app/components/Sidebar/components/SidebarButton.tsx b/app/components/Sidebar/components/SidebarButton.tsx index e06a91e58..07a1ab258 100644 --- a/app/components/Sidebar/components/SidebarButton.tsx +++ b/app/components/Sidebar/components/SidebarButton.tsx @@ -11,8 +11,6 @@ export type SidebarButtonProps = React.ComponentProps & { position: "top" | "bottom"; title: React.ReactNode; image: React.ReactNode; - minHeight?: number; - rounded?: boolean; showMoreMenu?: boolean; onClick: React.MouseEventHandler; children?: React.ReactNode; @@ -25,7 +23,6 @@ const SidebarButton = React.forwardRef( showMoreMenu, image, title, - minHeight = 0, children, ...rest }: SidebarButtonProps, @@ -40,7 +37,6 @@ const SidebarButton = React.forwardRef( >