chore(highlights_list): start from scratch

This commit is contained in:
Elian Doran 2025-12-18 12:38:45 +02:00
parent b0e1751dc7
commit dbf29ed23f
No known key found for this signature in database
2 changed files with 31 additions and 1 deletions

View File

@ -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";
}
//#endregion

View File

@ -7,6 +7,7 @@ import { useEffect } from "preact/hooks";
import options from "../../services/options"; import options from "../../services/options";
import { DEFAULT_GUTTER_SIZE } from "../../services/resizer"; import { DEFAULT_GUTTER_SIZE } from "../../services/resizer";
import { useActiveNoteContext } from "../react/hooks"; import { useActiveNoteContext } from "../react/hooks";
import HighlightsList from "./HighlightsList";
import TableOfContents from "./TableOfContents"; import TableOfContents from "./TableOfContents";
const MIN_WIDTH_PERCENT = 5; const MIN_WIDTH_PERCENT = 5;
@ -29,7 +30,8 @@ export default function RightPanelContainer() {
return ( return (
<div id="right-pane"> <div id="right-pane">
{note && <> {note && <>
<TableOfContents note={note} /> <TableOfContents />
<HighlightsList />
</>} </>}
</div> </div>
); );