diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index 896468738..8798f313d 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -178,6 +178,7 @@ const Sidebar = React.forwardRef(function _Sidebar( ` @@ -267,13 +269,14 @@ const hoverStyles = (props: ContainerProps) => ` `; const Container = styled(Flex)` + opacity: ${(props) => (props.$visible ? 1 : 0)}; position: fixed; top: 0; bottom: 0; width: 100%; background: ${s("sidebarBackground")}; - transition: box-shadow 100ms ease-in-out, opacity 100ms ease-in-out, - transform 100ms ease-out, + transition: box-shadow 150ms ease-in-out, opacity 150ms ease-in-out, + transform 150ms ease-out, ${s("backgroundTransition")} ${(props: ContainerProps) => props.$isAnimating ? `,width ${ANIMATION_MS}ms ease-out` : ""}; @@ -316,7 +319,7 @@ const Container = styled(Flex)` & > div { opacity: 1; - } + } } `}; `; diff --git a/app/stores/UiStore.ts b/app/stores/UiStore.ts index 1f05f1e4c..7b57dcb06 100644 --- a/app/stores/UiStore.ts +++ b/app/stores/UiStore.ts @@ -3,6 +3,7 @@ import { light as defaultTheme } from "@shared/styles/theme"; import Storage from "@shared/utils/Storage"; import Document from "~/models/Document"; import type { ConnectionStatus } from "~/scenes/Document/components/MultiplayerEditor"; +import type RootStore from "./RootStore"; const UI_STORE = "UI_STORE"; @@ -82,7 +83,11 @@ class UiStore { @observable multiplayerErrorCode?: number; - constructor() { + rootStore: RootStore; + + constructor(rootStore: RootStore) { + this.rootStore = rootStore; + // Rehydrate const data: PersistedData = Storage.get(UI_STORE) || {}; this.languagePromptDismissed = data.languagePromptDismissed; @@ -270,6 +275,14 @@ class UiStore { this.mobileSidebarVisible = false; }; + @computed + get readyToShow() { + return ( + !this.rootStore.auth.user || + (this.rootStore.collections.isLoaded && this.rootStore.documents.isLoaded) + ); + } + /** * Returns the current state of the sidebar taking into account user preference * and whether the sidebar has been hidden as part of launching in a new