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 {isReadOnly, enableEditing} = useIsNoteReadOnly(note, noteContext);
// make the edit button stand out on the first display, otherwise
// it's difficult to notice that the note is readonly
const isReadOnlyInfoBarDismissed = false; // TODO
useEffect(() => {
if (isReadOnly) {
setAnimationClass("bx-tada bx-lg");
@ -114,7 +114,7 @@ function EditButton({ note, noteContext, isDefaultViewMode }: FloatingButtonCont
}
}, [ isReadOnly ]);
return isReadOnly && <FloatingButton
return !!isReadOnly && isReadOnlyInfoBarDismissed && <FloatingButton
text={t("edit_button.edit_this_note")}
icon="bx bx-pencil"
className={animationClass}