diff --git a/app/components/Sidebar/Shared.tsx b/app/components/Sidebar/Shared.tsx index 202b9a6fd9..59ad8c09cb 100644 --- a/app/components/Sidebar/Shared.tsx +++ b/app/components/Sidebar/Shared.tsx @@ -47,7 +47,7 @@ function SharedSidebar({ share }: Props) { } return ( - + {teamAvailable && ( history.push(user ? homePath() : sharedModelPath(shareId)) } - > - - + /> )} diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index e0c68da124..11b6f70489 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -25,13 +25,15 @@ import { useTranslation } from "react-i18next"; const ANIMATION_MS = 250; type Props = { - children: React.ReactNode; hidden?: boolean; + /** Whether the sidebar can be resized and collapsed, defaults to true. */ + canResize?: boolean; className?: string; + children: React.ReactNode; }; const Sidebar = React.forwardRef(function _Sidebar( - { children, hidden = false, className }: Props, + { children, hidden = false, canResize = true, className }: Props, ref: React.RefObject ) { const [isCollapsing, setCollapsing] = React.useState(false); @@ -43,7 +45,7 @@ const Sidebar = React.forwardRef(function _Sidebar( const user = useCurrentUser({ rejectOnEmpty: false }); const isMobile = useMobile(); const width = ui.sidebarWidth; - const collapsed = ui.sidebarIsClosed; + const collapsed = ui.sidebarIsClosed && canResize; const maxWidth = theme.sidebarMaxWidth; const minWidth = theme.sidebarMinWidth + 16; // padding @@ -254,10 +256,12 @@ const Sidebar = React.forwardRef(function _Sidebar( )} - + {canResize && ( + + )} {ui.mobileSidebarVisible && }