forked from
jollywhoppers.com/witchsky.app
fork
Configure Feed
Select the types of activity you want to include in your feed.
Bluesky app fork with some witchin' additions 馃挮
fork
Configure Feed
Select the types of activity you want to include in your feed.
1import React from 'react'
2
3type StateContext = boolean
4type SetContext = (v: boolean) => void
5
6const stateContext = React.createContext<StateContext>(false)
7stateContext.displayName = 'DrawerSwipeDisabledStateContext'
8const setContext = React.createContext<SetContext>((_: boolean) => {})
9setContext.displayName = 'DrawerSwipeDisabledSetContext'
10
11export function Provider({children}: React.PropsWithChildren<{}>) {
12 const [state, setState] = React.useState(false)
13 return (
14 <stateContext.Provider value={state}>
15 <setContext.Provider value={setState}>{children}</setContext.Provider>
16 </stateContext.Provider>
17 )
18}
19
20export function useIsDrawerSwipeDisabled() {
21 return React.useContext(stateContext)
22}
23
24export function useSetDrawerSwipeDisabled() {
25 return React.useContext(setContext)
26}