diff --git a/apps/client/src/widgets/layout/StatusBar.tsx b/apps/client/src/widgets/layout/StatusBar.tsx index 6a154730a..e4724b31c 100644 --- a/apps/client/src/widgets/layout/StatusBar.tsx +++ b/apps/client/src/widgets/layout/StatusBar.tsx @@ -17,7 +17,6 @@ import server from "../../services/server"; import { openInAppHelpFromUrl } from "../../services/utils"; import { formatDateTime } from "../../utils/formatters"; import { BacklinksList, useBacklinkCount } from "../FloatingButtonsDefinitions"; -import Collapsible from "../react/Collapsible"; import Dropdown, { DropdownProps } from "../react/Dropdown"; import { FormDropdownDivider, FormListItem } from "../react/FormList"; import { useActiveNoteContext, useLegacyImperativeHandlers, useNoteLabel, useNoteProperty, useStaticTooltip, useTriliumEvent, useTriliumEvents } from "../react/hooks"; @@ -44,19 +43,27 @@ interface StatusBarContext { export default function StatusBar() { const { note, notePath, noteContext, viewScope, hoistedNoteId } = useActiveNoteContext(); - const [ attributesShown, setAttributesShown ] = useState(false); - const [ similarNotesShown, setSimilarNotesShown ] = useState(false); + const [ activePane, setActivePane ] = useState<"attributes" | "similar-notes" | null>(null); const context: StatusBarContext | undefined | null = note && noteContext && { note, notePath, noteContext, viewScope, hoistedNoteId }; - const attributesContext: AttributesProps | undefined | null = context && { ...context, attributesShown, setAttributesShown }; + const attributesContext: AttributesProps | undefined | null = context && { + ...context, + attributesShown: activePane === "attributes", + setAttributesShown: () => setActivePane("attributes") + }; + const noteInfoContext: NoteInfoContext | undefined | null = context && { + ...context, + similarNotesShown: activePane === "similar-notes", + setSimilarNotesShown: () => setActivePane("similar-notes") + }; const isHiddenNote = note?.isInHiddenSubtree(); return (