trilium/apps/client/src/widgets/mobile_widgets/toggle_sidebar_button.tsx
2025-08-29 19:39:46 +03:00

19 lines
576 B
TypeScript

import { useContext } from "preact/hooks";
import ActionButton from "../react/ActionButton";
import { ParentComponent } from "../react/react_utils";
import { t } from "../../services/i18n";
export default function ToggleSidebarButton() {
const parentComponent = useContext(ParentComponent);
return (
<ActionButton
icon="bx bx-sidebar"
text={t("note_tree.toggle-sidebar")}
onClick={() => parentComponent?.triggerCommand("setActiveScreen", {
screen: "tree"
})}
/>
)
}