client/floating buttons: hide the "Edit note" button for the moment

This commit is contained in:
Adorian Doran
2025-11-06 08:08:56 +02:00
parent bec47c0bb2
commit 1a55d3433d

View File

@@ -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}