mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 06:45:49 +01:00
feat(react/floating_buttons): add mobile support
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user