feat: wrap App in SafeAreaProvider
This commit is contained in:
parent
9af5c4a72f
commit
ea1aec9638
3 changed files with 17 additions and 2 deletions
15
src/core/patches/wrapSafeAreaProvider.tsx
Normal file
15
src/core/patches/wrapSafeAreaProvider.tsx
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { after } from "@lib/api/patcher";
|
||||||
|
import { _lazyContextSymbol } from "@metro/lazy";
|
||||||
|
import { findByNameLazy, findByPropsLazy } from "@metro/wrappers";
|
||||||
|
|
||||||
|
export default function wrapSafeAreaProvider() {
|
||||||
|
const { SafeAreaProvider } = findByPropsLazy('useSafeAreaInsets');
|
||||||
|
|
||||||
|
return after("default", findByNameLazy('App', false), function (_, ret) {
|
||||||
|
return (
|
||||||
|
<SafeAreaProvider>
|
||||||
|
{ret}
|
||||||
|
</SafeAreaProvider>
|
||||||
|
)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -17,12 +17,10 @@ const useStyles = createStyles({
|
||||||
backgroundColor: tokens.colors.BG_BASE_SECONDARY,
|
backgroundColor: tokens.colors.BG_BASE_SECONDARY,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
height: "100%",
|
height: "100%",
|
||||||
padding: 8,
|
|
||||||
gap: 12
|
gap: 12
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export default function ErrorBoundaryScreen(props: {
|
export default function ErrorBoundaryScreen(props: {
|
||||||
error: Error;
|
error: Error;
|
||||||
rerender: () => void;
|
rerender: () => void;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import patchErrorBoundary from "@core/debug/patches/patchErrorBoundary";
|
import patchErrorBoundary from "@core/debug/patches/patchErrorBoundary";
|
||||||
|
import wrapSafeAreaProvider from "@core/patches/wrapSafeAreaProvider";
|
||||||
import initFixes from "@core/fixes";
|
import initFixes from "@core/fixes";
|
||||||
import { initFetchI18nStrings } from "@core/i18n";
|
import { initFetchI18nStrings } from "@core/i18n";
|
||||||
import initSettings from "@core/ui/settings";
|
import initSettings from "@core/ui/settings";
|
||||||
|
|
@ -36,6 +37,7 @@ export default async () => {
|
||||||
|
|
||||||
// Load everything in parallel
|
// Load everything in parallel
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
|
wrapSafeAreaProvider(),
|
||||||
injectFluxInterceptor(),
|
injectFluxInterceptor(),
|
||||||
patchSettings(),
|
patchSettings(),
|
||||||
patchLogHook(),
|
patchLogHook(),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue