feat(mobile): disable swipe back gesture when there is no back in header (#8876)

close AF-1663, AF-1756

- new global `ModalConfigContext`
- new logic to judge whether inside modal
- render `✕` for PageHeader back if inside modal
- only enable `NavigationGesture` when there is `<` in PageHeader
This commit is contained in:
CatsJuice
2024-11-25 03:12:21 +00:00
parent 922db5ced4
commit b369ee0cca
23 changed files with 260 additions and 26 deletions

View File

@@ -0,0 +1,5 @@
export interface NavigationGesturePlugin {
isEnabled: () => Promise<boolean>;
enable: () => Promise<void>;
disable: () => Promise<void>;
}

View File

@@ -0,0 +1,9 @@
import { registerPlugin } from '@capacitor/core';
import type { NavigationGesturePlugin } from './definitions';
const NavigationGesture =
registerPlugin<NavigationGesturePlugin>('NavigationGesture');
export * from './definitions';
export { NavigationGesture };