Bluesky app fork with some witchin' additions 馃挮 witchsky.app
bluesky fork client
119
fork

Configure Feed

Select the types of activity you want to include in your feed.

at a876aae44ea07494ebea9727350aa060b81f317b 50 lines 1.1 kB view raw
1import {createContext, useContext, useMemo} from 'react' 2import {type SharedValue, useSharedValue} from 'react-native-reanimated' 3 4type StateContext = { 5 headerHeight: SharedValue<number> 6 footerHeight: SharedValue<number> 7} 8 9const stateContext = createContext<StateContext>({ 10 headerHeight: { 11 value: 0, 12 addListener() {}, 13 removeListener() {}, 14 modify() {}, 15 get() { 16 return 0 17 }, 18 set() {}, 19 }, 20 footerHeight: { 21 value: 0, 22 addListener() {}, 23 removeListener() {}, 24 modify() {}, 25 get() { 26 return 0 27 }, 28 set() {}, 29 }, 30}) 31stateContext.displayName = 'ShellLayoutContext' 32 33export function Provider({children}: React.PropsWithChildren<{}>) { 34 const headerHeight = useSharedValue(0) 35 const footerHeight = useSharedValue(0) 36 37 const value = useMemo( 38 () => ({ 39 headerHeight, 40 footerHeight, 41 }), 42 [headerHeight, footerHeight], 43 ) 44 45 return <stateContext.Provider value={value}>{children}</stateContext.Provider> 46} 47 48export function useShellLayout() { 49 return useContext(stateContext) 50}