mirror of
https://github.com/zadam/trilium.git
synced 2025-11-26 02:24:23 +01:00
chore(quick_edit): address requested changes
This commit is contained in:
parent
6946da3571
commit
56c82d7f0f
@ -62,10 +62,10 @@ export function DialogWrapper({ children }: { children: ComponentChildren }) {
|
|||||||
if (!wrapperRef.current) return;
|
if (!wrapperRef.current) return;
|
||||||
const customHue = getComputedStyle(wrapperRef.current).getPropertyValue("--custom-color-hue");
|
const customHue = getComputedStyle(wrapperRef.current).getPropertyValue("--custom-color-hue");
|
||||||
setHasTint(!!customHue);
|
setHasTint(!!customHue);
|
||||||
}, [ note, colorClass ]);
|
}, [ note ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={wrapperRef} class={`quick-edit-dialog-wrapper ${note?.getColorClass()} ${hasTint ? "tinted-quick-edit-dialog" : ""}`}>
|
<div ref={wrapperRef} class={`quick-edit-dialog-wrapper ${note?.getColorClass() ?? ""} ${hasTint ? "tinted-quick-edit-dialog" : ""}`}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -271,6 +271,7 @@ export function useNoteContext() {
|
|||||||
setNote(noteContextContext.note);
|
setNote(noteContextContext.note);
|
||||||
setNotePath(noteContextContext.notePath);
|
setNotePath(noteContextContext.notePath);
|
||||||
setViewScope(noteContextContext.viewScope);
|
setViewScope(noteContextContext.viewScope);
|
||||||
|
setIsReadOnlyTemporarilyDisabled(noteContextContext?.viewScope?.readOnlyTemporarilyDisabled);
|
||||||
}, [ noteContextContext ]);
|
}, [ noteContextContext ]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -292,6 +293,7 @@ export function useNoteContext() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
useTriliumEvent("readOnlyTemporarilyDisabled", ({ noteContext: eventNoteContext }) => {
|
useTriliumEvent("readOnlyTemporarilyDisabled", ({ noteContext: eventNoteContext }) => {
|
||||||
|
if (noteContextContext) return;
|
||||||
if (eventNoteContext.ntxId === noteContext?.ntxId) {
|
if (eventNoteContext.ntxId === noteContext?.ntxId) {
|
||||||
setIsReadOnlyTemporarilyDisabled(eventNoteContext?.viewScope?.readOnlyTemporarilyDisabled);
|
setIsReadOnlyTemporarilyDisabled(eventNoteContext?.viewScope?.readOnlyTemporarilyDisabled);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user