(config: UseHideAnimationConfig)
| 85 | } |
| 86 | |
| 87 | export function useHideAnimation(config: UseHideAnimationConfig) { |
| 88 | const { |
| 89 | manifest, |
| 90 | ready = true, |
| 91 | |
| 92 | logo: logoSrc, |
| 93 | darkLogo: darkLogoSrc, |
| 94 | brand: brandSrc, |
| 95 | darkBrand: darkBrandSrc, |
| 96 | |
| 97 | animate, |
| 98 | |
| 99 | statusBarTranslucent, |
| 100 | navigationBarTranslucent, |
| 101 | } = config; |
| 102 | |
| 103 | // __DEV__ global is missing in react-native-web |
| 104 | if (typeof __DEV__ !== "undefined" && __DEV__) { |
| 105 | controlEdgeToEdgeValues({ statusBarTranslucent, navigationBarTranslucent }); |
| 106 | } |
| 107 | |
| 108 | const skipLogo = logoSrc == null; |
| 109 | const skipBrand = manifest.brand == null || brandSrc == null; |
| 110 | |
| 111 | const logoWidth = manifest.logo.width; |
| 112 | const logoHeight = manifest.logo.height; |
| 113 | const brandBottom = manifest.brand?.bottom; |
| 114 | const brandWidth = manifest.brand?.width; |
| 115 | const brandHeight = manifest.brand?.height; |
| 116 | |
| 117 | const [ |
| 118 | { |
| 119 | darkModeEnabled, |
| 120 | logoSizeRatio = 1, |
| 121 | navigationBarHeight = 0, |
| 122 | statusBarHeight = 0, |
| 123 | }, |
| 124 | ] = useState(() => NativeModule.getConstants()); |
| 125 | |
| 126 | const backgroundColor: string = |
| 127 | darkModeEnabled && manifest.darkBackground != null |
| 128 | ? manifest.darkBackground |
| 129 | : manifest.background; |
| 130 | |
| 131 | const logoFinalSrc: ImageRequireSource | undefined = skipLogo |
| 132 | ? undefined |
| 133 | : darkModeEnabled && darkLogoSrc != null |
| 134 | ? darkLogoSrc |
| 135 | : logoSrc; |
| 136 | |
| 137 | const brandFinalSrc: ImageRequireSource | undefined = skipBrand |
| 138 | ? undefined |
| 139 | : darkModeEnabled && darkBrandSrc != null |
| 140 | ? darkBrandSrc |
| 141 | : brandSrc; |
| 142 | |
| 143 | const ref = useRef({ |
| 144 | layoutReady: false, |
nothing calls this directly
no test coverage detected
searching dependent graphs…