Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
at main 49 lines 1.6 kB view raw
1import {useEffect} from 'react' 2import {View} from 'react-native' 3 4import {atoms as a} from '#/alf' 5import {FullWindowOverlay} from '#/components/FullWindowOverlay' 6import {usePolicyUpdateContext} from '#/components/PolicyUpdateOverlay/context' 7import {Portal} from '#/components/PolicyUpdateOverlay/Portal' 8import {Content} from '#/components/PolicyUpdateOverlay/updates/202508' 9import {IS_IOS} from '#/env' 10 11export {Provider} from '#/components/PolicyUpdateOverlay/context' 12export {usePolicyUpdateContext} from '#/components/PolicyUpdateOverlay/context' 13export {Outlet} from '#/components/PolicyUpdateOverlay/Portal' 14 15export function PolicyUpdateOverlay() { 16 const {state, setIsReadyToShowOverlay} = usePolicyUpdateContext() 17 18 useEffect(() => { 19 /** 20 * Tell the context that we are ready to show the overlay. 21 */ 22 setIsReadyToShowOverlay() 23 }, [setIsReadyToShowOverlay]) 24 25 /* 26 * See `window.clearNux` example in `/state/queries/nuxs` for a way to clear 27 * NUX state for local testing and debugging. 28 */ 29 30 if (state.completed) return null 31 32 return ( 33 <Portal> 34 <FullWindowOverlay> 35 <View 36 style={[ 37 a.fixed, 38 a.inset_0, 39 // setting a zIndex when using FullWindowOverlay on iOS 40 // means the taps pass straight through to the underlying content (???) 41 // so don't set it on iOS. FullWindowOverlay already does the job. 42 !IS_IOS && {zIndex: 9999}, 43 ]}> 44 <Content state={state} /> 45 </View> 46 </FullWindowOverlay> 47 </Portal> 48 ) 49}