mirror of
https://github.com/zadam/trilium.git
synced 2025-12-20 14:24:27 +01:00
feat(right_pane_widget): hide highlights if disabled in settings
This commit is contained in:
parent
e94704ce64
commit
c0cd9e36d9
@ -8,7 +8,7 @@ import { t } from "../../services/i18n";
|
||||
import options from "../../services/options";
|
||||
import { DEFAULT_GUTTER_SIZE } from "../../services/resizer";
|
||||
import Button from "../react/Button";
|
||||
import { useActiveNoteContext, useNoteProperty, useTriliumOptionBool } from "../react/hooks";
|
||||
import { useActiveNoteContext, useNoteProperty, useTriliumOptionBool, useTriliumOptionJson } from "../react/hooks";
|
||||
import Icon from "../react/Icon";
|
||||
import HighlightsList from "./HighlightsList";
|
||||
import TableOfContents from "./TableOfContents";
|
||||
@ -17,13 +17,14 @@ const MIN_WIDTH_PERCENT = 5;
|
||||
|
||||
export default function RightPanelContainer() {
|
||||
const [ rightPaneVisible, setRightPaneVisible ] = useTriliumOptionBool("rightPaneVisible");
|
||||
const [ highlightsList ] = useTriliumOptionJson<string[]>("highlightsList");
|
||||
useSplit(rightPaneVisible);
|
||||
|
||||
const { note } = useActiveNoteContext();
|
||||
const noteType = useNoteProperty(note, "type");
|
||||
const items = (rightPaneVisible ? [
|
||||
(noteType === "text" || noteType === "doc") && <TableOfContents />,
|
||||
noteType === "text" && <HighlightsList />
|
||||
noteType === "text" && highlightsList.length > 0 && <HighlightsList />
|
||||
] : []).filter(Boolean);
|
||||
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user