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
chore(highlights_list): start from scratch
Elian Dorandbf29ed23f2c
diff --git a/apps/client/src/widgets/sidebar/HighlightsList.tsx b/apps/client/src/widgets/sidebar/HighlightsList.tsxnew file mode 100644index 0000000000..c18f1770bc--- /dev/null+++ b/apps/client/src/widgets/sidebar/HighlightsList.tsx@@ -0,0 +1,28 @@+import { t } from "../../services/i18n";+import { useActiveNoteContext, useIsNoteReadOnly, useNoteProperty } from "../react/hooks";+import RightPanelWidget from "./RightPanelWidget";++export default function HighlightsList() {+ const { note, noteContext } = useActiveNoteContext();+ const noteType = useNoteProperty(note, "type");+ const { isReadOnly } = useIsNoteReadOnly(note, noteContext);++ return (+ <RightPanelWidget title={t("highlights_list_2.title")}>+ {((noteType === "text" && isReadOnly) || (noteType === "doc")) && <ReadOnlyTextHighlightsList />}+ {noteType === "text" && !isReadOnly && <EditableTextHighlightsList />}+ </RightPanelWidget>+ );+}++//#region Editable text (CKEditor)+function EditableTextHighlightsList() {+ return "Editable";+}+//#endregion++//#region Read-only text+function ReadOnlyTextHighlightsList() {+ return "Read-only";+}+//#endregiondiff --git a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx b/apps/client/src/widgets/sidebar/RightPanelContainer.tsxindex 7b838c5185..b5ad216fd8 100644--- a/apps/client/src/widgets/sidebar/RightPanelContainer.tsx+++ b/apps/client/src/widgets/sidebar/RightPanelContainer.tsx@@ -7,6 +7,7 @@ import { useEffect } from "preact/hooks";import options from "../../services/options";import { DEFAULT_GUTTER_SIZE } from "../../services/resizer";import { useActiveNoteContext } from "../react/hooks";+import HighlightsList from "./HighlightsList";import TableOfContents from "./TableOfContents";const MIN_WIDTH_PERCENT = 5;@@ -29,7 +30,8 @@ export default function RightPanelContainer() {return (<div id="right-pane">{note && <>- <TableOfContents note={note} />+ <TableOfContents />+ <HighlightsList /></>}</div>);