mirror of
https://github.com/zadam/trilium.git
synced 2026-01-03 05:04:23 +01:00
20 lines
649 B
TypeScript
20 lines
649 B
TypeScript
import ActionButton from "../react/ActionButton";
|
|
import { t } from "../../services/i18n";
|
|
import { useNoteContext } from "../react/hooks";
|
|
|
|
export default function ToggleSidebarButton() {
|
|
const { noteContext, parentComponent } = useNoteContext();
|
|
|
|
return (
|
|
<div style={{ contain: "none", minWidth: 8 }}>
|
|
{ noteContext?.isMainContext() && <ActionButton
|
|
icon="bx bx-sidebar"
|
|
text={t("note_tree.toggle-sidebar")}
|
|
onClick={() => parentComponent?.triggerCommand("setActiveScreen", {
|
|
screen: "tree"
|
|
})}
|
|
/>}
|
|
</div>
|
|
)
|
|
}
|