feat(react/floating_buttons): add mobile support

This commit is contained in:
Elian Doran
2025-08-28 20:10:21 +03:00
parent 03a7fe1282
commit f82667066f
4 changed files with 23 additions and 23 deletions

View File

@@ -40,7 +40,9 @@ function FloatingButton({ className, ...props }: ActionButtonProps) {
/>
}
export const FLOATING_BUTTONS: ((context: FloatingButtonContext) => false | VNode)[] = [
export type FloatingButtonsList = ((context: FloatingButtonContext) => false | VNode)[];
export const DESKTOP_FLOATING_BUTTONS: FloatingButtonsList = [
RefreshBackendLogButton,
SwitchSplitOrientationButton,
ToggleReadOnlyButton,
@@ -58,6 +60,14 @@ export const FLOATING_BUTTONS: ((context: FloatingButtonContext) => false | VNod
Backlinks
];
export const MOBILE_FLOATING_BUTTONS: FloatingButtonsList = [
RefreshBackendLogButton,
EditButton,
RelationMapButtons,
ExportImageButtons,
Backlinks
]
function RefreshBackendLogButton({ note, parentComponent, noteContext, isDefaultViewMode }: FloatingButtonContext) {
const isEnabled = note.noteId === "_backendLog" && isDefaultViewMode;
return isEnabled && <FloatingButton