mirror of
https://github.com/zadam/trilium.git
synced 2025-12-13 10:54:25 +01:00
feat(note_actions): integrate template switch into new layout
This commit is contained in:
parent
b36a0bd10b
commit
9262f94190
@ -33,7 +33,7 @@ export default function BasicPropertiesTab({ note }: TabContext) {
|
|||||||
<EditabilitySelect note={note} />
|
<EditabilitySelect note={note} />
|
||||||
{!isNewLayout && <BookmarkSwitch note={note} />}
|
{!isNewLayout && <BookmarkSwitch note={note} />}
|
||||||
{!isNewLayout && <SharedSwitch note={note} />}
|
{!isNewLayout && <SharedSwitch note={note} />}
|
||||||
<TemplateSwitch note={note} />
|
{!isNewLayout && <TemplateSwitch note={note} />}
|
||||||
<NoteLanguageSwitch note={note} />
|
<NoteLanguageSwitch note={note} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -247,7 +247,7 @@ function TemplateSwitch({ note }: { note?: FNote | null }) {
|
|||||||
currentValue={isTemplate} onChange={setIsTemplate}
|
currentValue={isTemplate} onChange={setIsTemplate}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SharedSwitch({ note }: { note?: FNote | null }) {
|
function SharedSwitch({ note }: { note?: FNote | null }) {
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import ws from "../../services/ws";
|
|||||||
import ActionButton from "../react/ActionButton";
|
import ActionButton from "../react/ActionButton";
|
||||||
import Dropdown from "../react/Dropdown";
|
import Dropdown from "../react/Dropdown";
|
||||||
import { FormDropdownDivider, FormDropdownSubmenu, FormListItem, FormListToggleableItem } from "../react/FormList";
|
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 { ParentComponent } from "../react/react_utils";
|
||||||
import { isExperimentalFeatureEnabled } from "../../services/experimental_features";
|
import { isExperimentalFeatureEnabled } from "../../services/experimental_features";
|
||||||
import { useNoteBookmarkState, useShareState } from "./BasicPropertiesTab";
|
import { useNoteBookmarkState, useShareState } from "./BasicPropertiesTab";
|
||||||
@ -119,10 +119,12 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
|
|||||||
function NoteBasicProperties({ note }: { note: FNote }) {
|
function NoteBasicProperties({ note }: { note: FNote }) {
|
||||||
const [ isBookmarked, setIsBookmarked ] = useNoteBookmarkState(note);
|
const [ isBookmarked, setIsBookmarked ] = useNoteBookmarkState(note);
|
||||||
const [ isShared, switchShareState ] = useShareState(note);
|
const [ isShared, switchShareState ] = useShareState(note);
|
||||||
|
const [ isTemplate, setIsTemplate ] = useNoteLabelBoolean(note, "template");
|
||||||
|
|
||||||
return <>
|
return <>
|
||||||
<FormListToggleableItem icon="bx bx-bookmark" title={t("bookmark_switch.bookmark")} currentValue={isBookmarked} onChange={setIsBookmarked} />
|
<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-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} />
|
||||||
</>;
|
</>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user