mirror of
https://github.com/zadam/trilium.git
synced 2025-12-16 21:29:56 +01:00
feat(layout/note_actions): integrate add child for relation map
This commit is contained in:
@@ -54,6 +54,7 @@ export default function NoteActionsCustom(props: NoteActionsCustomProps) {
|
|||||||
|
|
||||||
return (innerProps &&
|
return (innerProps &&
|
||||||
<div className="note-actions-custom">
|
<div className="note-actions-custom">
|
||||||
|
<AddChildButton {...innerProps} />
|
||||||
<RunActiveNoteButton {...innerProps } />
|
<RunActiveNoteButton {...innerProps } />
|
||||||
<OpenTriliumApiDocsButton {...innerProps} />
|
<OpenTriliumApiDocsButton {...innerProps} />
|
||||||
<SwitchSplitOrientationButton {...innerProps} />
|
<SwitchSplitOrientationButton {...innerProps} />
|
||||||
@@ -221,4 +222,13 @@ function OpenTriliumApiDocsButton({ noteMime }: NoteActionsCustomInnerProps) {
|
|||||||
onClick={() => openInAppHelpFromUrl(noteMime.endsWith("frontend") ? "Q2z6av6JZVWm" : "MEtfsqa5VwNi")}
|
onClick={() => openInAppHelpFromUrl(noteMime.endsWith("frontend") ? "Q2z6av6JZVWm" : "MEtfsqa5VwNi")}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AddChildButton({ parentComponent, noteType, ntxId }: NoteActionsCustomInnerProps) {
|
||||||
|
const isEnabled = noteType === "relationMap";
|
||||||
|
return isEnabled && <ActionButton
|
||||||
|
icon="bx bx-folder-plus"
|
||||||
|
text={t("relation_map_buttons.create_child_note_title")}
|
||||||
|
onClick={() => parentComponent.triggerEvent("relationMapCreateChildNote", { ntxId })}
|
||||||
|
/>;
|
||||||
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user