mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 18:25:28 -06:00
feat(mobile/split): hide sidebar button for secondary item
This commit is contained in:
parent
99da145d65
commit
309fbab2e6
@ -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 }}>
|
||||||
icon="bx bx-sidebar"
|
{ noteContext?.isMainContext() && <ActionButton
|
||||||
text={t("note_tree.toggle-sidebar")}
|
icon="bx bx-sidebar"
|
||||||
onClick={() => parentComponent?.triggerCommand("setActiveScreen", {
|
text={t("note_tree.toggle-sidebar")}
|
||||||
screen: "tree"
|
onClick={() => parentComponent?.triggerCommand("setActiveScreen", {
|
||||||
})}
|
screen: "tree"
|
||||||
/>
|
})}
|
||||||
|
/>}
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user