mirror of
https://github.com/zadam/trilium.git
synced 2025-12-16 05:09:54 +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 &&
|
||||
<div className="note-actions-custom">
|
||||
<AddChildButton {...innerProps} />
|
||||
<RunActiveNoteButton {...innerProps } />
|
||||
<OpenTriliumApiDocsButton {...innerProps} />
|
||||
<SwitchSplitOrientationButton {...innerProps} />
|
||||
@@ -221,4 +222,13 @@ function OpenTriliumApiDocsButton({ noteMime }: NoteActionsCustomInnerProps) {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user