feat(mobile/split): hide sidebar button for secondary item

This commit is contained in:
Elian Doran 2025-11-30 23:34:37 +02:00
parent 99da145d65
commit 309fbab2e6
No known key found for this signature in database

View File

@ -1,18 +1,19 @@
import { useContext } from "preact/hooks";
import ActionButton from "../react/ActionButton"; import ActionButton from "../react/ActionButton";
import { ParentComponent } from "../react/react_utils";
import { t } from "../../services/i18n"; import { t } from "../../services/i18n";
import { useNoteContext } from "../react/hooks";
export default function ToggleSidebarButton() { export default function ToggleSidebarButton() {
const parentComponent = useContext(ParentComponent); const { noteContext, parentComponent } = useNoteContext();
return ( return (
<ActionButton <div style={{ contain: "none", minWidth: 8 }}>
{ noteContext?.isMainContext() && <ActionButton
icon="bx bx-sidebar" icon="bx bx-sidebar"
text={t("note_tree.toggle-sidebar")} text={t("note_tree.toggle-sidebar")}
onClick={() => parentComponent?.triggerCommand("setActiveScreen", { onClick={() => parentComponent?.triggerCommand("setActiveScreen", {
screen: "tree" screen: "tree"
})} })}
/> />}
</div>
) )
} }