Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(note_actions): integrate template switch into new layout
Elian Doran9262f9419010
diff --git a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsxindex f1f51b2223..0f186998b9 100644--- a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx+++ b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx@@ -33,7 +33,7 @@ export default function BasicPropertiesTab({ note }: TabContext) {<EditabilitySelect note={note} />{!isNewLayout && <BookmarkSwitch note={note} />}{!isNewLayout && <SharedSwitch note={note} />}- <TemplateSwitch note={note} />+ {!isNewLayout && <TemplateSwitch note={note} />}<NoteLanguageSwitch note={note} /></div>);@@ -247,7 +247,7 @@ function TemplateSwitch({ note }: { note?: FNote | null }) {currentValue={isTemplate} onChange={setIsTemplate}/></div>- )+ );}function SharedSwitch({ note }: { note?: FNote | null }) {diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsxindex 8cf1ffbebc..321ccda894 100644--- a/apps/client/src/widgets/ribbon/NoteActions.tsx+++ b/apps/client/src/widgets/ribbon/NoteActions.tsx@@ -14,7 +14,7 @@ import ws from "../../services/ws";import ActionButton from "../react/ActionButton";import Dropdown from "../react/Dropdown";import { FormDropdownDivider, FormDropdownSubmenu, FormListItem, FormListToggleableItem } from "../react/FormList";-import { useIsNoteReadOnly, useNoteContext, useNoteLabel, useNoteProperty, useTriliumOption } from "../react/hooks";+import { useIsNoteReadOnly, useNoteContext, useNoteLabel, useNoteLabelBoolean, useNoteProperty, useTriliumOption } from "../react/hooks";import { ParentComponent } from "../react/react_utils";import { isExperimentalFeatureEnabled } from "../../services/experimental_features";import { useNoteBookmarkState, useShareState } from "./BasicPropertiesTab";@@ -119,10 +119,12 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Notfunction NoteBasicProperties({ note }: { note: FNote }) {const [ isBookmarked, setIsBookmarked ] = useNoteBookmarkState(note);const [ isShared, switchShareState ] = useShareState(note);+ const [ isTemplate, setIsTemplate ] = useNoteLabelBoolean(note, "template");return <><FormListToggleableItem icon="bx bx-bookmark" title={t("bookmark_switch.bookmark")} currentValue={isBookmarked} onChange={setIsBookmarked} /><FormListToggleableItem icon="bx bx-share-alt" title={t("shared_switch.shared")} currentValue={isShared} onChange={switchShareState} />+ <FormListToggleableItem icon="bx bx-copy-alt" title={t("template_switch.template")} currentValue={isTemplate} onChange={setIsTemplate} /></>;}