mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
chore(react): port create_pane_button
This commit is contained in:
parent
a4e8e62452
commit
88bc6739ca
@ -126,7 +126,7 @@ export default class DesktopLayout {
|
|||||||
.child(<MovePaneButton direction="left" />)
|
.child(<MovePaneButton direction="left" />)
|
||||||
.child(<MovePaneButton direction="right" />)
|
.child(<MovePaneButton direction="right" />)
|
||||||
.child(<ClosePaneButton />)
|
.child(<ClosePaneButton />)
|
||||||
.child(new CreatePaneButton())
|
.child(<CreatePaneButton />)
|
||||||
)
|
)
|
||||||
.child(<Ribbon />)
|
.child(<Ribbon />)
|
||||||
.child(<SharedInfo />)
|
.child(<SharedInfo />)
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import { t } from "../../services/i18n.js";
|
|
||||||
import OnClickButtonWidget from "./onclick_button.js";
|
|
||||||
|
|
||||||
export default class CreatePaneButton extends OnClickButtonWidget {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.icon("bx-dock-right")
|
|
||||||
.title(t("create_pane_button.create_new_split"))
|
|
||||||
.titlePlacement("bottom")
|
|
||||||
.onClick((widget, e) => {
|
|
||||||
widget.triggerCommand("openNewNoteSplit", { ntxId: widget.getClosestNtxId() });
|
|
||||||
e.stopPropagation();
|
|
||||||
})
|
|
||||||
.class("icon-action");
|
|
||||||
}
|
|
||||||
}
|
|
21
apps/client/src/widgets/buttons/create_pane_button.tsx
Normal file
21
apps/client/src/widgets/buttons/create_pane_button.tsx
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { useContext } from "preact/hooks";
|
||||||
|
import { t } from "../../services/i18n.js";
|
||||||
|
import ActionButton from "../react/ActionButton.jsx";
|
||||||
|
import { ParentComponent } from "../react/react_utils.jsx";
|
||||||
|
import BasicWidget from "../basic_widget.js";
|
||||||
|
|
||||||
|
export default function CreatePaneButton() {
|
||||||
|
const widget = useContext(ParentComponent) as BasicWidget | undefined;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ActionButton
|
||||||
|
icon="bx bx-dock-right"
|
||||||
|
text={t("create_pane_button.create_new_split")}
|
||||||
|
onClick={(e) => {
|
||||||
|
widget?.triggerCommand("openNewNoteSplit", { ntxId: widget.getClosestNtxId() });
|
||||||
|
e.stopPropagation();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user