fix: Sidebar hidden when viewing shared document logged-in

This commit is contained in:
Tom Moor
2024-06-12 22:30:39 -04:00
parent 5b866a7451
commit 076d564aa3
2 changed files with 6 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ function AppSidebar() {
);
return (
<Sidebar ref={handleSidebarRef}>
<Sidebar hidden={!ui.readyToShow} ref={handleSidebarRef}>
<HistoryNavigation />
{dndArea && (
<DndProvider backend={HTML5Backend} options={html5Options}>

View File

@@ -24,11 +24,12 @@ const ANIMATION_MS = 250;
type Props = {
children: React.ReactNode;
hidden?: boolean;
className?: string;
};
const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
{ children, className }: Props,
{ children, hidden = false, className }: Props,
ref: React.RefObject<HTMLDivElement>
) {
const [isCollapsing, setCollapsing] = React.useState(false);
@@ -178,7 +179,7 @@ const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
<Container
ref={ref}
style={style}
$visible={ui.readyToShow}
$hidden={hidden}
$isHovering={isHovering}
$isAnimating={isAnimating}
$isSmallerThanMinimum={isSmallerThanMinimum}
@@ -250,7 +251,7 @@ type ContainerProps = {
$isSmallerThanMinimum: boolean;
$isHovering: boolean;
$collapsed: boolean;
$visible: boolean;
$hidden: boolean;
};
const hoverStyles = (props: ContainerProps) => `
@@ -269,7 +270,7 @@ const hoverStyles = (props: ContainerProps) => `
`;
const Container = styled(Flex)<ContainerProps>`
opacity: ${(props) => (props.$visible ? 1 : 0)};
opacity: ${(props) => (props.$hidden ? 0 : 1)};
position: fixed;
top: 0;
bottom: 0;