mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 08:45:50 +01:00
client: allow the isNoteReadOnly hook operate on a note and context other of the current one
This commit is contained in:
@@ -4,8 +4,8 @@ import { useIsNoteReadOnly, useNoteContext, useTriliumEvent } from "./react/hook
|
||||
import Button from "./react/Button";
|
||||
|
||||
export default function ReadOnlyNoteInfoBar(props: {zenModeOnly?: boolean}) {
|
||||
const {isReadOnly, enableEditing} = useIsNoteReadOnly();
|
||||
const {note} = useNoteContext();
|
||||
const {note, noteContext} = useNoteContext();
|
||||
const {isReadOnly, enableEditing} = useIsNoteReadOnly(note, noteContext);
|
||||
|
||||
return <div class={`read-only-note-info-bar-widget ${(isReadOnly) ? "visible" : ""} ${(props.zenModeOnly) ? "zen-mode-only" : ""}`}>
|
||||
{isReadOnly && <>
|
||||
|
||||
Reference in New Issue
Block a user