mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 06:45:49 +01:00
client/floating buttons: hide the "Edit note" button for the moment
This commit is contained in:
@@ -99,12 +99,12 @@ function ToggleReadOnlyButton({ note, viewType, isDefaultViewMode }: FloatingBut
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
function EditButton({ note, noteContext, isDefaultViewMode }: FloatingButtonContext) {
|
function EditButton({ note, noteContext }: FloatingButtonContext) {
|
||||||
const [animationClass, setAnimationClass] = useState("");
|
const [animationClass, setAnimationClass] = useState("");
|
||||||
const {isReadOnly, enableEditing} = useIsNoteReadOnly(note, noteContext);
|
const {isReadOnly, enableEditing} = useIsNoteReadOnly(note, noteContext);
|
||||||
|
|
||||||
// make the edit button stand out on the first display, otherwise
|
const isReadOnlyInfoBarDismissed = false; // TODO
|
||||||
// it's difficult to notice that the note is readonly
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isReadOnly) {
|
if (isReadOnly) {
|
||||||
setAnimationClass("bx-tada bx-lg");
|
setAnimationClass("bx-tada bx-lg");
|
||||||
@@ -114,7 +114,7 @@ function EditButton({ note, noteContext, isDefaultViewMode }: FloatingButtonCont
|
|||||||
}
|
}
|
||||||
}, [ isReadOnly ]);
|
}, [ isReadOnly ]);
|
||||||
|
|
||||||
return isReadOnly && <FloatingButton
|
return !!isReadOnly && isReadOnlyInfoBarDismissed && <FloatingButton
|
||||||
text={t("edit_button.edit_this_note")}
|
text={t("edit_button.edit_this_note")}
|
||||||
icon="bx bx-pencil"
|
icon="bx bx-pencil"
|
||||||
className={animationClass}
|
className={animationClass}
|
||||||
|
|||||||
Reference in New Issue
Block a user