29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
// Metro module 10664 (f10665).
|
|
import { useState, useEffect } from "react";
|
|
import { useAppEntryKey, DEFAULT_APP_ENTRY_KEY } from "../window/native/AppEntryKeyContext";
|
|
import { isAndroid } from "../../utils/PlatformUtils";
|
|
import Module1593 from "../../_bundle/Module1593";
|
|
import { getSafeAreaInsets } from "./useSafeAreaInsets.native";
|
|
import subscribeToSafeAreaInsets_native from "./subscribeToSafeAreaInsets.native";
|
|
export default function useStableSafeAreaInsets() {
|
|
const appEntryKey = useAppEntryKey();
|
|
const [state, setState] = useState(() => {
|
|
let r4 = appEntryKey;
|
|
if (appEntryKey === void 0) {
|
|
r4 = DEFAULT_APP_ENTRY_KEY;
|
|
}
|
|
return isAndroid() ? Module1593.getStableSafeAreaInsets(r4) : getSafeAreaInsets(r4);
|
|
});
|
|
useEffect(() => subscribeToSafeAreaInsets_native(() => {
|
|
let r5 = appEntryKey;
|
|
if (appEntryKey === void 0) {
|
|
r5 = DEFAULT_APP_ENTRY_KEY;
|
|
}
|
|
setState(isAndroid() ? Module1593.getStableSafeAreaInsets(r5) : getSafeAreaInsets(r5));
|
|
}, appEntryKey), [appEntryKey]);
|
|
return state;
|
|
};
|
|
export function getStableSafeAreaInsets(r4 = DEFAULT_APP_ENTRY_KEY) {
|
|
return isAndroid() ? Module1593.getStableSafeAreaInsets(r4) : getSafeAreaInsets(r4);
|
|
}
|