+6
-5
__mocks__/@gorhom/bottom-sheet.tsx
+6
-5
__mocks__/@gorhom/bottom-sheet.tsx
···
1
-
import React, {ReactNode} from 'react'
2
-
import {View, ScrollView, Modal, FlatList, TextInput} from 'react-native'
3
4
const BottomSheetModalContext = React.createContext(null)
5
6
const BottomSheetModalProvider = (props: any) => {
7
return <BottomSheetModalContext.Provider {...props} value={{}} />
···
47
export {useBottomSheetDynamicSnapPoints}
48
49
export {
50
-
BottomSheetModalProvider,
51
BottomSheetBackdrop,
52
BottomSheetHandle,
53
BottomSheetModal,
54
-
BottomSheetFooter,
55
BottomSheetScrollView,
56
-
BottomSheetFlatList,
57
BottomSheetTextInput,
58
}
59
···
1
+
import React, {type ReactNode} from 'react'
2
+
import {FlatList, Modal, ScrollView, TextInput, View} from 'react-native'
3
4
const BottomSheetModalContext = React.createContext(null)
5
+
BottomSheetModalContext.displayName = 'BottomSheetModalContext'
6
7
const BottomSheetModalProvider = (props: any) => {
8
return <BottomSheetModalContext.Provider {...props} value={{}} />
···
48
export {useBottomSheetDynamicSnapPoints}
49
50
export {
51
BottomSheetBackdrop,
52
+
BottomSheetFlatList,
53
+
BottomSheetFooter,
54
BottomSheetHandle,
55
BottomSheetModal,
56
+
BottomSheetModalProvider,
57
BottomSheetScrollView,
58
BottomSheetTextInput,
59
}
60
+1
modules/bottom-sheet/src/BottomSheetPortal.tsx
+1
modules/bottom-sheet/src/BottomSheetPortal.tsx
+1
modules/bottom-sheet/src/lib/Portal.tsx
+1
modules/bottom-sheet/src/lib/Portal.tsx
+3
-2
src/alf/index.tsx
+3
-2
src/alf/index.tsx
···
8
setFontScale as persistFontScale,
9
} from '#/alf/fonts'
10
import {createThemes, defaultTheme} from '#/alf/themes'
11
-
import {Theme, ThemeName} from '#/alf/types'
12
import {BLUE_HUE, GREEN_HUE, RED_HUE} from '#/alf/util/colorGeneration'
13
-
import {Device} from '#/storage'
14
15
export {atoms} from '#/alf/atoms'
16
export * from '#/alf/breakpoints'
···
61
},
62
flags: {},
63
})
64
65
export function ThemeProvider({
66
children,
···
8
setFontScale as persistFontScale,
9
} from '#/alf/fonts'
10
import {createThemes, defaultTheme} from '#/alf/themes'
11
+
import {type Theme, type ThemeName} from '#/alf/types'
12
import {BLUE_HUE, GREEN_HUE, RED_HUE} from '#/alf/util/colorGeneration'
13
+
import {type Device} from '#/storage'
14
15
export {atoms} from '#/alf/atoms'
16
export * from '#/alf/breakpoints'
···
61
},
62
flags: {},
63
})
64
+
Context.displayName = 'AlfContext'
65
66
export function ThemeProvider({
67
children,
+1
src/components/Admonition.tsx
+1
src/components/Admonition.tsx
+1
src/components/Button.tsx
+1
src/components/Button.tsx
+3
src/components/ContextMenu/context.tsx
+3
src/components/ContextMenu/context.tsx
···
7
} from '#/components/ContextMenu/types'
8
9
export const Context = React.createContext<ContextType | null>(null)
10
11
export const MenuContext = React.createContext<MenuContextType | null>(null)
12
13
export const ItemContext = React.createContext<ItemContextType | null>(null)
14
15
export function useContextMenuContext() {
16
const context = React.useContext(Context)
···
7
} from '#/components/ContextMenu/types'
8
9
export const Context = React.createContext<ContextType | null>(null)
10
+
Context.displayName = 'ContextMenuContext'
11
12
export const MenuContext = React.createContext<MenuContextType | null>(null)
13
+
MenuContext.displayName = 'ContextMenuMenuContext'
14
15
export const ItemContext = React.createContext<ItemContextType | null>(null)
16
+
ItemContext.displayName = 'ContextMenuItemContext'
17
18
export function useContextMenuContext() {
19
const context = React.useContext(Context)
+1
src/components/Dialog/context.ts
+1
src/components/Dialog/context.ts
+2
-1
src/components/Grid.tsx
+2
-1
src/components/Grid.tsx
+1
src/components/Layout/Header/index.tsx
+1
src/components/Layout/Header/index.tsx
+1
src/components/Layout/context.ts
+1
src/components/Layout/context.ts
+2
src/components/Menu/context.tsx
+2
src/components/Menu/context.tsx
···
3
import {type ContextType, type ItemContextType} from '#/components/Menu/types'
4
5
export const Context = React.createContext<ContextType | null>(null)
6
7
export const ItemContext = React.createContext<ItemContextType | null>(null)
8
9
export function useMenuContext() {
10
const context = React.useContext(Context)
···
3
import {type ContextType, type ItemContextType} from '#/components/Menu/types'
4
5
export const Context = React.createContext<ContextType | null>(null)
6
+
Context.displayName = 'MenuContext'
7
8
export const ItemContext = React.createContext<ItemContextType | null>(null)
9
+
ItemContext.displayName = 'MenuItemContext'
10
11
export function useMenuContext() {
12
const context = React.useContext(Context)
+1
src/components/PolicyUpdateOverlay/context.tsx
+1
src/components/PolicyUpdateOverlay/context.tsx
+1
src/components/Portal.tsx
+1
src/components/Portal.tsx
+1
src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx
+1
src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx
+1
src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx
+1
src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx
+1
src/components/Post/Embed/VideoEmbed/index.web.tsx
+1
src/components/Post/Embed/VideoEmbed/index.web.tsx
+1
src/components/PostControls/PostControlButton.tsx
+1
src/components/PostControls/PostControlButton.tsx
+1
src/components/Prompt.tsx
+1
src/components/Prompt.tsx
+3
src/components/Select/index.tsx
+3
src/components/Select/index.tsx
···
34
} & Pick<RootProps, 'value' | 'onValueChange' | 'disabled'>
35
36
const Context = createContext<ContextType | null>(null)
37
38
const ValueTextContext = createContext<
39
[any, React.Dispatch<React.SetStateAction<any>>]
40
>([undefined, () => {}])
41
42
function useSelectContext() {
43
const ctx = useContext(Context)
···
229
focused: false,
230
pressed: false,
231
})
232
233
export function useItemContext() {
234
return useContext(ItemContext)
···
34
} & Pick<RootProps, 'value' | 'onValueChange' | 'disabled'>
35
36
const Context = createContext<ContextType | null>(null)
37
+
Context.displayName = 'SelectContext'
38
39
const ValueTextContext = createContext<
40
[any, React.Dispatch<React.SetStateAction<any>>]
41
>([undefined, () => {}])
42
+
ValueTextContext.displayName = 'ValueTextContext'
43
44
function useSelectContext() {
45
const ctx = useContext(Context)
···
231
focused: false,
232
pressed: false,
233
})
234
+
ItemContext.displayName = 'SelectItemContext'
235
236
export function useItemContext() {
237
return useContext(ItemContext)
+2
src/components/Select/index.web.tsx
+2
src/components/Select/index.web.tsx
···
23
} from './types'
24
25
const SelectedValueContext = createContext<string | undefined | null>(null)
26
+
SelectedValueContext.displayName = 'SelectSelectedValueContext'
27
28
export function Root(props: RootProps) {
29
return (
···
220
pressed: false,
221
selected: false,
222
})
223
+
ItemContext.displayName = 'SelectItemContext'
224
225
export function useItemContext() {
226
return useContext(ItemContext)
+1
src/components/Toast/Toast.tsx
+1
src/components/Toast/Toast.tsx
+2
src/components/Tooltip/index.tsx
+2
src/components/Tooltip/index.tsx
···
53
visible: false,
54
onVisibleChange: () => {},
55
})
56
+
TooltipContext.displayName = 'TooltipContext'
57
58
const TargetContext = createContext<TargetContextType>({
59
targetMeasurements: undefined,
60
setTargetMeasurements: () => {},
61
shouldMeasure: false,
62
})
63
+
TargetContext.displayName = 'TargetContext'
64
65
export function Outer({
66
children,
+1
src/components/Tooltip/index.web.tsx
+1
src/components/Tooltip/index.web.tsx
+1
src/components/dialogs/Context.tsx
+1
src/components/dialogs/Context.tsx
+1
src/components/dialogs/nuxs/index.tsx
+1
src/components/dialogs/nuxs/index.tsx
+1
src/components/dms/MessageContext.tsx
+1
src/components/dms/MessageContext.tsx
+1
src/components/forms/TextField.tsx
+1
src/components/forms/TextField.tsx
+5
-3
src/components/forms/Toggle.tsx
+5
-3
src/components/forms/Toggle.tsx
···
1
import React from 'react'
2
-
import {Pressable, View, ViewStyle} from 'react-native'
3
import Animated, {LinearTransition} from 'react-native-reanimated'
4
5
import {HITSLOP_10} from '#/lib/constants'
···
8
atoms as a,
9
flatten,
10
native,
11
-
TextStyleProp,
12
useTheme,
13
-
ViewStyleProp,
14
} from '#/alf'
15
import {useInteractionState} from '#/components/hooks/useInteractionState'
16
import {CheckThick_Stroke2_Corner0_Rounded as Checkmark} from '#/components/icons/Check'
···
35
pressed: false,
36
focused: false,
37
})
38
39
const GroupContext = React.createContext<{
40
values: string[]
···
49
maxSelectionsReached: false,
50
setFieldValue: () => {},
51
})
52
53
export type GroupProps = React.PropsWithChildren<{
54
type?: 'radio' | 'checkbox'
···
1
import React from 'react'
2
+
import {Pressable, View, type ViewStyle} from 'react-native'
3
import Animated, {LinearTransition} from 'react-native-reanimated'
4
5
import {HITSLOP_10} from '#/lib/constants'
···
8
atoms as a,
9
flatten,
10
native,
11
+
type TextStyleProp,
12
useTheme,
13
+
type ViewStyleProp,
14
} from '#/alf'
15
import {useInteractionState} from '#/components/hooks/useInteractionState'
16
import {CheckThick_Stroke2_Corner0_Rounded as Checkmark} from '#/components/icons/Check'
···
35
pressed: false,
36
focused: false,
37
})
38
+
ItemContext.displayName = 'ToggleItemContext'
39
40
const GroupContext = React.createContext<{
41
values: string[]
···
50
maxSelectionsReached: false,
51
setFieldValue: () => {},
52
})
53
+
GroupContext.displayName = 'ToggleGroupContext'
54
55
export type GroupProps = React.PropsWithChildren<{
56
type?: 'radio' | 'checkbox'
+2
-1
src/components/intents/IntentDialogs.tsx
+2
-1
src/components/intents/IntentDialogs.tsx
···
1
import React from 'react'
2
3
import * as Dialog from '#/components/Dialog'
4
-
import {DialogControlProps} from '#/components/Dialog'
5
import {VerifyEmailIntentDialog} from '#/components/intents/VerifyEmailIntentDialog'
6
7
interface Context {
···
11
}
12
13
const Context = React.createContext({} as Context)
14
export const useIntentDialogs = () => React.useContext(Context)
15
16
export function Provider({children}: {children: React.ReactNode}) {
···
1
import React from 'react'
2
3
import * as Dialog from '#/components/Dialog'
4
+
import {type DialogControlProps} from '#/components/Dialog'
5
import {VerifyEmailIntentDialog} from '#/components/intents/VerifyEmailIntentDialog'
6
7
interface Context {
···
11
}
12
13
const Context = React.createContext({} as Context)
14
+
Context.displayName = 'IntentDialogsContext'
15
export const useIntentDialogs = () => React.useContext(Context)
16
17
export function Provider({children}: {children: React.ReactNode}) {
+3
-2
src/components/moderation/Hider.tsx
+3
-2
src/components/moderation/Hider.tsx
···
1
import React from 'react'
2
-
import {ModerationUI} from '@atproto/api'
3
4
import {
5
-
ModerationCauseDescription,
6
useModerationCauseDescription,
7
} from '#/lib/moderation/useModerationCauseDescription'
8
import {
···
22
}
23
24
const Context = React.createContext<Context>({} as Context)
25
26
export const useHider = () => React.useContext(Context)
27
···
1
import React from 'react'
2
+
import {type ModerationUI} from '@atproto/api'
3
4
import {
5
+
type ModerationCauseDescription,
6
useModerationCauseDescription,
7
} from '#/lib/moderation/useModerationCauseDescription'
8
import {
···
22
}
23
24
const Context = React.createContext<Context>({} as Context)
25
+
Context.displayName = 'HiderContext'
26
27
export const useHider = () => React.useContext(Context)
28
+3
-2
src/lib/ScrollContext.tsx
+3
-2
src/lib/ScrollContext.tsx
···
1
-
import React, {createContext, useContext, useMemo} from 'react'
2
-
import {ScrollHandlers} from 'react-native-reanimated'
3
4
const ScrollContext = createContext<ScrollHandlers<any>>({
5
onBeginDrag: undefined,
···
7
onScroll: undefined,
8
onMomentumEnd: undefined,
9
})
10
11
export function useScrollHandlers(): ScrollHandlers<any> {
12
return useContext(ScrollContext)
···
1
+
import {createContext, useContext, useMemo} from 'react'
2
+
import {type ScrollHandlers} from 'react-native-reanimated'
3
4
const ScrollContext = createContext<ScrollHandlers<any>>({
5
onBeginDrag: undefined,
···
7
onScroll: undefined,
8
onMomentumEnd: undefined,
9
})
10
+
ScrollContext.displayName = 'ScrollContext'
11
12
export function useScrollHandlers(): ScrollHandlers<any> {
13
return useContext(ScrollContext)
+1
src/lib/ThemeContext.tsx
+1
src/lib/ThemeContext.tsx
+2
src/lib/hooks/useEnableKeyboardController.tsx
+2
src/lib/hooks/useEnableKeyboardController.tsx
+3
src/lib/hooks/useHideBottomBarBorder.tsx
+3
src/lib/hooks/useHideBottomBarBorder.tsx
···
4
type HideBottomBarBorderSetter = () => () => void
5
6
const HideBottomBarBorderContext = createContext<boolean>(false)
7
const HideBottomBarBorderSetterContext =
8
createContext<HideBottomBarBorderSetter | null>(null)
9
10
export function useHideBottomBarBorderSetter() {
11
const hideBottomBarBorder = useContext(HideBottomBarBorderSetterContext)
···
4
type HideBottomBarBorderSetter = () => () => void
5
6
const HideBottomBarBorderContext = createContext<boolean>(false)
7
+
HideBottomBarBorderContext.displayName = 'HideBottomBarBorderContext'
8
const HideBottomBarBorderSetterContext =
9
createContext<HideBottomBarBorderSetter | null>(null)
10
+
HideBottomBarBorderSetterContext.displayName =
11
+
'HideBottomBarBorderSetterContext'
12
13
export function useHideBottomBarBorderSetter() {
14
const hideBottomBarBorder = useContext(HideBottomBarBorderSetterContext)
+1
src/lib/statsig/statsig.tsx
+1
src/lib/statsig/statsig.tsx
···
147
// and it's been difficult to get it to behave in a predictable way.
148
// Our own cache ensures consistent evaluation within a single session.
149
const GateCache = React.createContext<Map<string, boolean> | null>(null)
150
151
type GateOptions = {
152
dangerouslyDisableExposureLogging?: boolean
···
147
// and it's been difficult to get it to behave in a predictable way.
148
// Our own cache ensures consistent evaluation within a single session.
149
const GateCache = React.createContext<Map<string, boolean> | null>(null)
150
+
GateCache.displayName = 'StatsigGateCacheContext'
151
152
type GateOptions = {
153
dangerouslyDisableExposureLogging?: boolean
+1
src/screens/Onboarding/StepProfile/index.tsx
+1
src/screens/Onboarding/StepProfile/index.tsx
+5
-1
src/screens/Onboarding/state.ts
+5
-1
src/screens/Onboarding/state.ts
···
3
import {useLingui} from '@lingui/react'
4
5
import {logger} from '#/logger'
6
-
import {AvatarColor, Emoji} from '#/screens/Onboarding/StepProfile/types'
7
8
export type OnboardingState = {
9
hasPrev: boolean
···
147
state: {...initialState},
148
dispatch: () => {},
149
})
150
151
export function reducer(
152
s: OnboardingState,
···
3
import {useLingui} from '@lingui/react'
4
5
import {logger} from '#/logger'
6
+
import {
7
+
type AvatarColor,
8
+
type Emoji,
9
+
} from '#/screens/Onboarding/StepProfile/types'
10
11
export type OnboardingState = {
12
hasPrev: boolean
···
150
state: {...initialState},
151
dispatch: () => {},
152
})
153
+
Context.displayName = 'OnboardingContext'
154
155
export function reducer(
156
s: OnboardingState,
+1
src/screens/Settings/components/SettingsList.tsx
+1
src/screens/Settings/components/SettingsList.tsx
+1
src/screens/Signup/state.ts
+1
src/screens/Signup/state.ts
+1
src/screens/StarterPack/Wizard/State.tsx
+1
src/screens/StarterPack/Wizard/State.tsx
+1
src/state/a11y.tsx
+1
src/state/a11y.tsx
+2
src/state/ageAssurance/index.tsx
+2
src/state/ageAssurance/index.tsx
···
28
lastInitiatedAt: undefined,
29
isAgeRestricted: false,
30
})
31
32
const AgeAssuranceAPIContext = createContext<AgeAssuranceAPIContextType>({
33
// @ts-ignore can't be bothered to type this
34
refetch: () => Promise.resolve(),
35
})
36
37
/**
38
* Low-level provider for fetching age assurance state on app load. Do not add
···
28
lastInitiatedAt: undefined,
29
isAgeRestricted: false,
30
})
31
+
AgeAssuranceContext.displayName = 'AgeAssuranceContext'
32
33
const AgeAssuranceAPIContext = createContext<AgeAssuranceAPIContextType>({
34
// @ts-ignore can't be bothered to type this
35
refetch: () => Promise.resolve(),
36
})
37
+
AgeAssuranceAPIContext.displayName = 'AgeAssuranceAPIContext'
38
39
/**
40
* Low-level provider for fetching age assurance state on app load. Do not add
+2
src/state/cache/thread-mutes.tsx
+2
src/state/cache/thread-mutes.tsx
···
7
type SetStateContext = (uri: string, value: boolean) => void
8
9
const stateContext = React.createContext<StateContext>(new Map())
10
const setStateContext = React.createContext<SetStateContext>(
11
(_: string) => false,
12
)
13
14
export function Provider({children}: React.PropsWithChildren<{}>) {
15
const [state, setState] = React.useState<StateContext>(() => new Map())
···
7
type SetStateContext = (uri: string, value: boolean) => void
8
9
const stateContext = React.createContext<StateContext>(new Map())
10
+
stateContext.displayName = 'ThreadMutesStateContext'
11
const setStateContext = React.createContext<SetStateContext>(
12
(_: string) => false,
13
)
14
+
setStateContext.displayName = 'ThreadMutesSetStateContext'
15
16
export function Provider({children}: React.PropsWithChildren<{}>) {
17
const [state, setState] = React.useState<StateContext>(() => new Map())
+3
src/state/dialogs/index.tsx
+3
src/state/dialogs/index.tsx
···
26
}
27
28
const DialogContext = React.createContext<IDialogContext>({} as IDialogContext)
29
30
const DialogControlContext = React.createContext<IDialogControlContext>(
31
{} as IDialogControlContext,
32
)
33
34
/**
35
* The number of dialogs that are fully expanded. This is used to determine the background color of the status bar
···
107
</DialogContext.Provider>
108
)
109
}
···
26
}
27
28
const DialogContext = React.createContext<IDialogContext>({} as IDialogContext)
29
+
DialogContext.displayName = 'DialogContext'
30
31
const DialogControlContext = React.createContext<IDialogControlContext>(
32
{} as IDialogControlContext,
33
)
34
+
DialogControlContext.displayName = 'DialogControlContext'
35
36
/**
37
* The number of dialogs that are fully expanded. This is used to determine the background color of the status bar
···
109
</DialogContext.Provider>
110
)
111
}
112
+
Provider.displayName = 'DialogsProvider'
+1
src/state/feed-feedback.tsx
+1
src/state/feed-feedback.tsx
+1
src/state/geolocation.tsx
+1
src/state/geolocation.tsx
+1
src/state/global-gesture-events/index.tsx
+1
src/state/global-gesture-events/index.tsx
+2
src/state/home-badge.tsx
+2
src/state/home-badge.tsx
···
4
type ApiContext = (hasNew: boolean) => void
5
6
const stateContext = React.createContext<StateContext>(false)
7
const apiContext = React.createContext<ApiContext>((_: boolean) => {})
8
9
export function Provider({children}: React.PropsWithChildren<{}>) {
10
const [state, setState] = React.useState(false)
···
4
type ApiContext = (hasNew: boolean) => void
5
6
const stateContext = React.createContext<StateContext>(false)
7
+
stateContext.displayName = 'HomeBadgeStateContext'
8
const apiContext = React.createContext<ApiContext>((_: boolean) => {})
9
+
apiContext.displayName = 'HomeBadgeApiContext'
10
11
export function Provider({children}: React.PropsWithChildren<{}>) {
12
const [state, setState] = React.useState(false)
+2
src/state/invites.tsx
+2
src/state/invites.tsx
···
10
const stateContext = React.createContext<StateContext>(
11
persisted.defaults.invites,
12
)
13
const apiContext = React.createContext<ApiContext>({
14
setInviteCopied(_: string) {},
15
})
16
17
export function Provider({children}: React.PropsWithChildren<{}>) {
18
const [state, setState] = React.useState(persisted.get('invites'))
···
10
const stateContext = React.createContext<StateContext>(
11
persisted.defaults.invites,
12
)
13
+
stateContext.displayName = 'InvitesStateContext'
14
const apiContext = React.createContext<ApiContext>({
15
setInviteCopied(_: string) {},
16
})
17
+
apiContext.displayName = 'InvitesApiContext'
18
19
export function Provider({children}: React.PropsWithChildren<{}>) {
20
const [state, setState] = React.useState(persisted.get('invites'))
+3
-1
src/state/lightbox.tsx
+3
-1
src/state/lightbox.tsx
···
2
import {nanoid} from 'nanoid/non-secure'
3
4
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
5
-
import {ImageSource} from '#/view/com/lightbox/ImageViewing/@types'
6
7
export type Lightbox = {
8
id: string
···
15
}>({
16
activeLightbox: null,
17
})
18
19
const LightboxControlContext = React.createContext<{
20
openLightbox: (lightbox: Omit<Lightbox, 'id'>) => void
···
23
openLightbox: () => {},
24
closeLightbox: () => false,
25
})
26
27
export function Provider({children}: React.PropsWithChildren<{}>) {
28
const [activeLightbox, setActiveLightbox] = React.useState<Lightbox | null>(
···
2
import {nanoid} from 'nanoid/non-secure'
3
4
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
5
+
import {type ImageSource} from '#/view/com/lightbox/ImageViewing/@types'
6
7
export type Lightbox = {
8
id: string
···
15
}>({
16
activeLightbox: null,
17
})
18
+
LightboxContext.displayName = 'LightboxContext'
19
20
const LightboxControlContext = React.createContext<{
21
openLightbox: (lightbox: Omit<Lightbox, 'id'>) => void
···
24
openLightbox: () => {},
25
closeLightbox: () => false,
26
})
27
+
LightboxControlContext.displayName = 'LightboxControlContext'
28
29
export function Provider({children}: React.PropsWithChildren<{}>) {
30
const [activeLightbox, setActiveLightbox] = React.useState<Lightbox | null>(
+1
src/state/messages/convo/index.tsx
+1
src/state/messages/convo/index.tsx
+1
src/state/messages/current-convo-id.tsx
+1
src/state/messages/current-convo-id.tsx
+1
src/state/messages/events/index.tsx
+1
src/state/messages/events/index.tsx
+1
src/state/messages/message-drafts.tsx
+1
src/state/messages/message-drafts.tsx
+2
src/state/modals/index.tsx
+2
src/state/modals/index.tsx
···
70
isModalActive: false,
71
activeModals: [],
72
})
73
74
const ModalControlContext = React.createContext<{
75
openModal: (modal: Modal) => void
···
80
closeModal: () => false,
81
closeAllModals: () => false,
82
})
83
84
export function Provider({children}: React.PropsWithChildren<{}>) {
85
const [activeModals, setActiveModals] = React.useState<Modal[]>([])
···
70
isModalActive: false,
71
activeModals: [],
72
})
73
+
ModalContext.displayName = 'ModalContext'
74
75
const ModalControlContext = React.createContext<{
76
openModal: (modal: Modal) => void
···
81
closeModal: () => false,
82
closeAllModals: () => false,
83
})
84
+
ModalControlContext.displayName = 'ModalControlContext'
85
86
export function Provider({children}: React.PropsWithChildren<{}>) {
87
const [activeModals, setActiveModals] = React.useState<Modal[]>([])
+2
src/state/preferences/alt-text-required.tsx
+2
src/state/preferences/alt-text-required.tsx
···
8
const stateContext = React.createContext<StateContext>(
9
persisted.defaults.requireAltTextEnabled,
10
)
11
const setContext = React.createContext<SetContext>(
12
(_: persisted.Schema['requireAltTextEnabled']) => {},
13
)
14
15
export function Provider({children}: React.PropsWithChildren<{}>) {
16
const [state, setState] = React.useState(
···
8
const stateContext = React.createContext<StateContext>(
9
persisted.defaults.requireAltTextEnabled,
10
)
11
+
stateContext.displayName = 'AltTextRequiredStateContext'
12
const setContext = React.createContext<SetContext>(
13
(_: persisted.Schema['requireAltTextEnabled']) => {},
14
)
15
+
setContext.displayName = 'AltTextRequiredSetContext'
16
17
export function Provider({children}: React.PropsWithChildren<{}>) {
18
const [state, setState] = React.useState(
+2
src/state/preferences/autoplay.tsx
+2
src/state/preferences/autoplay.tsx
···
8
const stateContext = React.createContext<StateContext>(
9
Boolean(persisted.defaults.disableAutoplay),
10
)
11
const setContext = React.createContext<SetContext>((_: boolean) => {})
12
13
export function Provider({children}: {children: React.ReactNode}) {
14
const [state, setState] = React.useState(
···
8
const stateContext = React.createContext<StateContext>(
9
Boolean(persisted.defaults.disableAutoplay),
10
)
11
+
stateContext.displayName = 'AutoplayStateContext'
12
const setContext = React.createContext<SetContext>((_: boolean) => {})
13
+
setContext.displayName = 'AutoplaySetContext'
14
15
export function Provider({children}: {children: React.ReactNode}) {
16
const [state, setState] = React.useState(
+2
src/state/preferences/disable-haptics.tsx
+2
src/state/preferences/disable-haptics.tsx
···
8
const stateContext = React.createContext<StateContext>(
9
Boolean(persisted.defaults.disableHaptics),
10
)
11
const setContext = React.createContext<SetContext>((_: boolean) => {})
12
13
export function Provider({children}: {children: React.ReactNode}) {
14
const [state, setState] = React.useState(
···
8
const stateContext = React.createContext<StateContext>(
9
Boolean(persisted.defaults.disableHaptics),
10
)
11
+
stateContext.displayName = 'DisableHapticsStateContext'
12
const setContext = React.createContext<SetContext>((_: boolean) => {})
13
+
setContext.displayName = 'DisableHapticsSetContext'
14
15
export function Provider({children}: {children: React.ReactNode}) {
16
const [state, setState] = React.useState(
+3
-1
src/state/preferences/external-embeds-prefs.tsx
+3
-1
src/state/preferences/external-embeds-prefs.tsx
···
1
import React from 'react'
2
3
-
import {EmbedPlayerSource} from '#/lib/strings/embed-player'
4
import * as persisted from '#/state/persisted'
5
6
type StateContext = persisted.Schema['externalEmbeds']
···
12
const stateContext = React.createContext<StateContext>(
13
persisted.defaults.externalEmbeds,
14
)
15
const setContext = React.createContext<SetContext>({} as SetContext)
16
17
export function Provider({children}: React.PropsWithChildren<{}>) {
18
const [state, setState] = React.useState(persisted.get('externalEmbeds'))
···
1
import React from 'react'
2
3
+
import {type EmbedPlayerSource} from '#/lib/strings/embed-player'
4
import * as persisted from '#/state/persisted'
5
6
type StateContext = persisted.Schema['externalEmbeds']
···
12
const stateContext = React.createContext<StateContext>(
13
persisted.defaults.externalEmbeds,
14
)
15
+
stateContext.displayName = 'ExternalEmbedsPrefsStateContext'
16
const setContext = React.createContext<SetContext>({} as SetContext)
17
+
setContext.displayName = 'ExternalEmbedsPrefsSetContext'
18
19
export function Provider({children}: React.PropsWithChildren<{}>) {
20
const [state, setState] = React.useState(persisted.get('externalEmbeds'))
+2
src/state/preferences/in-app-browser.tsx
+2
src/state/preferences/in-app-browser.tsx
···
8
const stateContext = React.createContext<StateContext>(
9
persisted.defaults.useInAppBrowser,
10
)
11
const setContext = React.createContext<SetContext>(
12
(_: persisted.Schema['useInAppBrowser']) => {},
13
)
14
15
export function Provider({children}: React.PropsWithChildren<{}>) {
16
const [state, setState] = React.useState(persisted.get('useInAppBrowser'))
···
8
const stateContext = React.createContext<StateContext>(
9
persisted.defaults.useInAppBrowser,
10
)
11
+
stateContext.displayName = 'InAppBrowserStateContext'
12
const setContext = React.createContext<SetContext>(
13
(_: persisted.Schema['useInAppBrowser']) => {},
14
)
15
+
setContext.displayName = 'InAppBrowserSetContext'
16
17
export function Provider({children}: React.PropsWithChildren<{}>) {
18
const [state, setState] = React.useState(persisted.get('useInAppBrowser'))
+1
src/state/preferences/kawaii.tsx
+1
src/state/preferences/kawaii.tsx
+5
-1
src/state/preferences/label-defs.tsx
+5
-1
src/state/preferences/label-defs.tsx
···
1
import React from 'react'
2
-
import {AppBskyLabelerDefs, InterpretedLabelValueDefinition} from '@atproto/api'
3
4
import {useLabelDefinitionsQuery} from '../queries/preferences'
5
···
12
labelDefs: {},
13
labelers: [],
14
})
15
16
export function Provider({children}: React.PropsWithChildren<{}>) {
17
const state = useLabelDefinitionsQuery()
···
1
import React from 'react'
2
+
import {
3
+
type AppBskyLabelerDefs,
4
+
type InterpretedLabelValueDefinition,
5
+
} from '@atproto/api'
6
7
import {useLabelDefinitionsQuery} from '../queries/preferences'
8
···
15
labelDefs: {},
16
labelers: [],
17
})
18
+
stateContext.displayName = 'LabelDefsStateContext'
19
20
export function Provider({children}: React.PropsWithChildren<{}>) {
21
const state = useLabelDefinitionsQuery()
+3
-1
src/state/preferences/languages.tsx
+3
-1
src/state/preferences/languages.tsx
···
1
import React from 'react'
2
3
-
import {AppLanguage} from '#/locale/languages'
4
import * as persisted from '#/state/persisted'
5
6
type SetStateCb = (
···
20
const stateContext = React.createContext<StateContext>(
21
persisted.defaults.languagePrefs,
22
)
23
const apiContext = React.createContext<ApiContext>({
24
setPrimaryLanguage: (_: string) => {},
25
setPostLanguage: (_: string) => {},
···
29
savePostLanguageToHistory: () => {},
30
setAppLanguage: (_: AppLanguage) => {},
31
})
32
33
export function Provider({children}: React.PropsWithChildren<{}>) {
34
const [state, setState] = React.useState(persisted.get('languagePrefs'))
···
1
import React from 'react'
2
3
+
import {type AppLanguage} from '#/locale/languages'
4
import * as persisted from '#/state/persisted'
5
6
type SetStateCb = (
···
20
const stateContext = React.createContext<StateContext>(
21
persisted.defaults.languagePrefs,
22
)
23
+
stateContext.displayName = 'LanguagePrefsStateContext'
24
const apiContext = React.createContext<ApiContext>({
25
setPrimaryLanguage: (_: string) => {},
26
setPostLanguage: (_: string) => {},
···
30
savePostLanguageToHistory: () => {},
31
setAppLanguage: (_: AppLanguage) => {},
32
})
33
+
apiContext.displayName = 'LanguagePrefsApiContext'
34
35
export function Provider({children}: React.PropsWithChildren<{}>) {
36
const [state, setState] = React.useState(persisted.get('languagePrefs'))
+2
src/state/preferences/large-alt-badge.tsx
+2
src/state/preferences/large-alt-badge.tsx
···
8
const stateContext = React.createContext<StateContext>(
9
persisted.defaults.largeAltBadgeEnabled,
10
)
11
const setContext = React.createContext<SetContext>(
12
(_: persisted.Schema['largeAltBadgeEnabled']) => {},
13
)
14
15
export function Provider({children}: React.PropsWithChildren<{}>) {
16
const [state, setState] = React.useState(
···
8
const stateContext = React.createContext<StateContext>(
9
persisted.defaults.largeAltBadgeEnabled,
10
)
11
+
stateContext.displayName = 'LargeAltBadgeStateContext'
12
const setContext = React.createContext<SetContext>(
13
(_: persisted.Schema['largeAltBadgeEnabled']) => {},
14
)
15
+
setContext.displayName = 'LargeAltBadgeSetContext'
16
17
export function Provider({children}: React.PropsWithChildren<{}>) {
18
const [state, setState] = React.useState(
+4
-2
src/state/preferences/moderation-opts.tsx
+4
-2
src/state/preferences/moderation-opts.tsx
···
1
-
import React, {createContext, useContext, useMemo} from 'react'
2
-
import {BskyAgent, ModerationOpts} from '@atproto/api'
3
4
import {useHiddenPosts, useLabelDefinitions} from '#/state/preferences'
5
import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation'
···
9
export const moderationOptsContext = createContext<ModerationOpts | undefined>(
10
undefined,
11
)
12
13
// used in the moderation state devtool
14
export const moderationOptsOverrideContext = createContext<
15
ModerationOpts | undefined
16
>(undefined)
17
18
export function useModerationOpts() {
19
return useContext(moderationOptsContext)
···
1
+
import {createContext, useContext, useMemo} from 'react'
2
+
import {BskyAgent, type ModerationOpts} from '@atproto/api'
3
4
import {useHiddenPosts, useLabelDefinitions} from '#/state/preferences'
5
import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation'
···
9
export const moderationOptsContext = createContext<ModerationOpts | undefined>(
10
undefined,
11
)
12
+
moderationOptsContext.displayName = 'ModerationOptsContext'
13
14
// used in the moderation state devtool
15
export const moderationOptsOverrideContext = createContext<
16
ModerationOpts | undefined
17
>(undefined)
18
+
moderationOptsOverrideContext.displayName = 'ModerationOptsOverrideContext'
19
20
export function useModerationOpts() {
21
return useContext(moderationOptsContext)
+2
src/state/preferences/subtitles.tsx
+2
src/state/preferences/subtitles.tsx
···
8
const stateContext = React.createContext<StateContext>(
9
Boolean(persisted.defaults.subtitlesEnabled),
10
)
11
const setContext = React.createContext<SetContext>((_: boolean) => {})
12
13
export function Provider({children}: {children: React.ReactNode}) {
14
const [state, setState] = React.useState(
···
8
const stateContext = React.createContext<StateContext>(
9
Boolean(persisted.defaults.subtitlesEnabled),
10
)
11
+
stateContext.displayName = 'SubtitlesStateContext'
12
const setContext = React.createContext<SetContext>((_: boolean) => {})
13
+
setContext.displayName = 'SubtitlesSetContext'
14
15
export function Provider({children}: {children: React.ReactNode}) {
16
const [state, setState] = React.useState(
+2
src/state/preferences/trending.tsx
+2
src/state/preferences/trending.tsx
···
22
trendingDisabled: Boolean(persisted.defaults.trendingDisabled),
23
trendingVideoDisabled: Boolean(persisted.defaults.trendingVideoDisabled),
24
})
25
const ApiContext = React.createContext<ApiContext>({
26
setTrendingDisabled() {},
27
setTrendingVideoDisabled() {},
28
})
29
30
function usePersistedBooleanValue<T extends keyof persisted.Schema>(key: T) {
31
const [value, _set] = React.useState(() => {
···
22
trendingDisabled: Boolean(persisted.defaults.trendingDisabled),
23
trendingVideoDisabled: Boolean(persisted.defaults.trendingVideoDisabled),
24
})
25
+
StateContext.displayName = 'TrendingStateContext'
26
const ApiContext = React.createContext<ApiContext>({
27
setTrendingDisabled() {},
28
setTrendingVideoDisabled() {},
29
})
30
+
ApiContext.displayName = 'TrendingApiContext'
31
32
function usePersistedBooleanValue<T extends keyof persisted.Schema>(key: T) {
33
const [value, _set] = React.useState(() => {
+2
src/state/preferences/used-starter-packs.tsx
+2
src/state/preferences/used-starter-packs.tsx
···
6
type SetContext = (v: boolean) => void
7
8
const stateContext = React.createContext<StateContext>(false)
9
const setContext = React.createContext<SetContext>((_: boolean) => {})
10
11
export function Provider({children}: {children: React.ReactNode}) {
12
const [state, setState] = React.useState<StateContext>(() =>
···
6
type SetContext = (v: boolean) => void
7
8
const stateContext = React.createContext<StateContext>(false)
9
+
stateContext.displayName = 'UsedStarterPacksStateContext'
10
const setContext = React.createContext<SetContext>((_: boolean) => {})
11
+
setContext.displayName = 'UsedStarterPacksSetContext'
12
13
export function Provider({children}: {children: React.ReactNode}) {
14
const [state, setState] = React.useState<StateContext>(() =>
+1
src/state/queries/messages/list-conversations.tsx
+1
src/state/queries/messages/list-conversations.tsx
+2
src/state/queries/notifications/unread.tsx
+2
src/state/queries/notifications/unread.tsx
···
35
}
36
37
const stateContext = React.createContext<StateContext>('')
38
39
const apiContext = React.createContext<ApiContext>({
40
async markAllRead() {},
41
async checkUnread() {},
42
getCachedUnreadPage: () => undefined,
43
})
44
45
export function Provider({children}: React.PropsWithChildren<{}>) {
46
const {hasSession} = useSession()
···
35
}
36
37
const stateContext = React.createContext<StateContext>('')
38
+
stateContext.displayName = 'NotificationsUnreadStateContext'
39
40
const apiContext = React.createContext<ApiContext>({
41
async markAllRead() {},
42
async checkUnread() {},
43
getCachedUnreadPage: () => undefined,
44
})
45
+
apiContext.displayName = 'NotificationsUnreadApiContext'
46
47
export function Provider({children}: React.PropsWithChildren<{}>) {
48
const {hasSession} = useSession()
+2
src/state/service-config.tsx
+2
src/state/service-config.tsx
···
16
const TrendingContext = createContext<TrendingContext>({
17
enabled: false,
18
})
19
+
TrendingContext.displayName = 'TrendingContext'
20
21
const LiveNowContext = createContext<LiveNowContext | null>(null)
22
+
LiveNowContext.displayName = 'LiveNowContext'
23
24
export function Provider({children}: {children: React.ReactNode}) {
25
const langPrefs = useLanguagePrefs()
+3
src/state/session/index.tsx
+3
src/state/session/index.tsx
···
30
currentAccount: undefined,
31
hasSession: false,
32
})
33
34
const AgentContext = React.createContext<BskyAgent | null>(null)
35
36
const ApiContext = React.createContext<SessionApiContext>({
37
createAccount: async () => {},
···
42
removeAccount: () => {},
43
partialRefreshSession: async () => {},
44
})
45
46
export function Provider({children}: React.PropsWithChildren<{}>) {
47
const cancelPendingTask = useOneTaskAtATime()
···
30
currentAccount: undefined,
31
hasSession: false,
32
})
33
+
StateContext.displayName = 'SessionStateContext'
34
35
const AgentContext = React.createContext<BskyAgent | null>(null)
36
+
AgentContext.displayName = 'SessionAgentContext'
37
38
const ApiContext = React.createContext<SessionApiContext>({
39
createAccount: async () => {},
···
44
removeAccount: () => {},
45
partialRefreshSession: async () => {},
46
})
47
+
ApiContext.displayName = 'SessionApiContext'
48
49
export function Provider({children}: React.PropsWithChildren<{}>) {
50
const cancelPendingTask = useOneTaskAtATime()
+2
src/state/shell/color-mode.tsx
+2
src/state/shell/color-mode.tsx
···
15
colorMode: 'system',
16
darkTheme: 'dark',
17
})
18
+
stateContext.displayName = 'ColorModeStateContext'
19
const setContext = React.createContext<SetContext>({} as SetContext)
20
+
setContext.displayName = 'ColorModeSetContext'
21
22
export function Provider({children}: React.PropsWithChildren<{}>) {
23
const [colorMode, setColorMode] = React.useState(persisted.get('colorMode'))
+2
src/state/shell/composer/index.tsx
+2
src/state/shell/composer/index.tsx
···
51
}
52
53
const stateContext = React.createContext<StateContext>(undefined)
54
const controlsContext = React.createContext<ControlsContext>({
55
openComposer(_opts: ComposerOpts) {},
56
closeComposer() {
57
return false
58
},
59
})
60
61
export function Provider({children}: React.PropsWithChildren<{}>) {
62
const {_} = useLingui()
···
51
}
52
53
const stateContext = React.createContext<StateContext>(undefined)
54
+
stateContext.displayName = 'ComposerStateContext'
55
const controlsContext = React.createContext<ControlsContext>({
56
openComposer(_opts: ComposerOpts) {},
57
closeComposer() {
58
return false
59
},
60
})
61
+
controlsContext.displayName = 'ComposerControlsContext'
62
63
export function Provider({children}: React.PropsWithChildren<{}>) {
64
const {_} = useLingui()
+2
src/state/shell/drawer-open.tsx
+2
src/state/shell/drawer-open.tsx
···
4
type SetContext = (v: boolean) => void
5
6
const stateContext = React.createContext<StateContext>(false)
7
const setContext = React.createContext<SetContext>((_: boolean) => {})
8
9
export function Provider({children}: React.PropsWithChildren<{}>) {
10
const [state, setState] = React.useState(false)
···
4
type SetContext = (v: boolean) => void
5
6
const stateContext = React.createContext<StateContext>(false)
7
+
stateContext.displayName = 'DrawerOpenStateContext'
8
const setContext = React.createContext<SetContext>((_: boolean) => {})
9
+
setContext.displayName = 'DrawerOpenSetContext'
10
11
export function Provider({children}: React.PropsWithChildren<{}>) {
12
const [state, setState] = React.useState(false)
+2
src/state/shell/drawer-swipe-disabled.tsx
+2
src/state/shell/drawer-swipe-disabled.tsx
···
4
type SetContext = (v: boolean) => void
5
6
const stateContext = React.createContext<StateContext>(false)
7
const setContext = React.createContext<SetContext>((_: boolean) => {})
8
9
export function Provider({children}: React.PropsWithChildren<{}>) {
10
const [state, setState] = React.useState(false)
···
4
type SetContext = (v: boolean) => void
5
6
const stateContext = React.createContext<StateContext>(false)
7
+
stateContext.displayName = 'DrawerSwipeDisabledStateContext'
8
const setContext = React.createContext<SetContext>((_: boolean) => {})
9
+
setContext.displayName = 'DrawerSwipeDisabledSetContext'
10
11
export function Provider({children}: React.PropsWithChildren<{}>) {
12
const [state, setState] = React.useState(false)
+2
src/state/shell/logged-out.tsx
+2
src/state/shell/logged-out.tsx
···
39
showLoggedOut: false,
40
requestedAccountSwitchTo: undefined,
41
})
42
43
const ControlsContext = React.createContext<Controls>({
44
setShowLoggedOut: () => {},
45
requestSwitchToAccount: () => {},
46
clearRequestedAccount: () => {},
47
})
48
49
export function Provider({children}: React.PropsWithChildren<{}>) {
50
const activeStarterPack = useActiveStarterPack()
···
39
showLoggedOut: false,
40
requestedAccountSwitchTo: undefined,
41
})
42
+
StateContext.displayName = 'LoggedOutStateContext'
43
44
const ControlsContext = React.createContext<Controls>({
45
setShowLoggedOut: () => {},
46
requestSwitchToAccount: () => {},
47
clearRequestedAccount: () => {},
48
})
49
+
ControlsContext.displayName = 'LoggedOutControlsContext'
50
51
export function Provider({children}: React.PropsWithChildren<{}>) {
52
const activeStarterPack = useActiveStarterPack()
+7
-1
src/state/shell/minimal-mode.tsx
+7
-1
src/state/shell/minimal-mode.tsx
···
1
import React from 'react'
2
-
import {SharedValue, useSharedValue, withSpring} from 'react-native-reanimated'
3
4
type StateContext = {
5
headerMode: SharedValue<number>
···
29
set() {},
30
},
31
})
32
const setContext = React.createContext<SetContext>((_: boolean) => {})
33
34
export function Provider({children}: React.PropsWithChildren<{}>) {
35
const headerMode = useSharedValue(0)
···
1
import React from 'react'
2
+
import {
3
+
type SharedValue,
4
+
useSharedValue,
5
+
withSpring,
6
+
} from 'react-native-reanimated'
7
8
type StateContext = {
9
headerMode: SharedValue<number>
···
33
set() {},
34
},
35
})
36
+
stateContext.displayName = 'MinimalModeStateContext'
37
const setContext = React.createContext<SetContext>((_: boolean) => {})
38
+
setContext.displayName = 'MinimalModeSetContext'
39
40
export function Provider({children}: React.PropsWithChildren<{}>) {
41
const headerMode = useSharedValue(0)
+2
src/state/shell/onboarding.tsx
+2
src/state/shell/onboarding.tsx
···
29
const stateContext = React.createContext<StateContext>(
30
compute(persisted.defaults.onboarding),
31
)
32
+
stateContext.displayName = 'OnboardingStateContext'
33
const dispatchContext = React.createContext<DispatchContext>((_: Action) => {})
34
+
dispatchContext.displayName = 'OnboardingDispatchContext'
35
36
function reducer(state: StateContext, action: Action): StateContext {
37
switch (action.type) {
+1
src/state/shell/post-progress.tsx
+1
src/state/shell/post-progress.tsx
+3
-1
src/state/shell/progress-guide.tsx
+3
-1
src/state/shell/progress-guide.tsx
···
5
import {logEvent} from '#/lib/statsig/statsig'
6
import {
7
ProgressGuideToast,
8
-
ProgressGuideToastRef,
9
} from '#/components/ProgressGuide/Toast'
10
import {
11
usePreferencesQuery,
···
45
| undefined
46
47
const ProgressGuideContext = React.createContext<ProgressGuide>(undefined)
48
49
const ProgressGuideControlContext = React.createContext<{
50
startProgressGuide(guide: ProgressGuideName): void
···
55
endProgressGuide: () => {},
56
captureAction: (_action: ProgressGuideAction, _count = 1) => {},
57
})
58
59
export function useProgressGuide(guide: ProgressGuideName) {
60
const ctx = React.useContext(ProgressGuideContext)
···
5
import {logEvent} from '#/lib/statsig/statsig'
6
import {
7
ProgressGuideToast,
8
+
type ProgressGuideToastRef,
9
} from '#/components/ProgressGuide/Toast'
10
import {
11
usePreferencesQuery,
···
45
| undefined
46
47
const ProgressGuideContext = React.createContext<ProgressGuide>(undefined)
48
+
ProgressGuideContext.displayName = 'ProgressGuideContext'
49
50
const ProgressGuideControlContext = React.createContext<{
51
startProgressGuide(guide: ProgressGuideName): void
···
56
endProgressGuide: () => {},
57
captureAction: (_action: ProgressGuideAction, _count = 1) => {},
58
})
59
+
ProgressGuideControlContext.displayName = 'ProgressGuideControlContext'
60
61
export function useProgressGuide(guide: ProgressGuideName) {
62
const ctx = React.useContext(ProgressGuideContext)
+3
-1
src/state/shell/selected-feed.tsx
+3
-1
src/state/shell/selected-feed.tsx
···
2
3
import {isWeb} from '#/platform/detection'
4
import * as persisted from '#/state/persisted'
5
-
import {FeedDescriptor} from '#/state/queries/post-feed'
6
7
type StateContext = FeedDescriptor | null
8
type SetContext = (v: FeedDescriptor) => void
9
10
const stateContext = React.createContext<StateContext>(null)
11
const setContext = React.createContext<SetContext>((_: string) => {})
12
13
function getInitialFeed(): FeedDescriptor | null {
14
if (isWeb) {
···
2
3
import {isWeb} from '#/platform/detection'
4
import * as persisted from '#/state/persisted'
5
+
import {type FeedDescriptor} from '#/state/queries/post-feed'
6
7
type StateContext = FeedDescriptor | null
8
type SetContext = (v: FeedDescriptor) => void
9
10
const stateContext = React.createContext<StateContext>(null)
11
+
stateContext.displayName = 'SelectedFeedStateContext'
12
const setContext = React.createContext<SetContext>((_: string) => {})
13
+
setContext.displayName = 'SelectedFeedSetContext'
14
15
function getInitialFeed(): FeedDescriptor | null {
16
if (isWeb) {
+2
-1
src/state/shell/shell-layout.tsx
+2
-1
src/state/shell/shell-layout.tsx
···
1
import React from 'react'
2
-
import {SharedValue, useSharedValue} from 'react-native-reanimated'
3
4
type StateContext = {
5
headerHeight: SharedValue<number>
···
28
set() {},
29
},
30
})
31
32
export function Provider({children}: React.PropsWithChildren<{}>) {
33
const headerHeight = useSharedValue(0)
···
1
import React from 'react'
2
+
import {type SharedValue, useSharedValue} from 'react-native-reanimated'
3
4
type StateContext = {
5
headerHeight: SharedValue<number>
···
28
set() {},
29
},
30
})
31
+
stateContext.displayName = 'ShellLayoutContext'
32
33
export function Provider({children}: React.PropsWithChildren<{}>) {
34
const headerHeight = useSharedValue(0)
+2
src/state/shell/starter-pack.tsx
+2
src/state/shell/starter-pack.tsx
···
9
type SetContext = (v: StateContext) => void
10
11
const stateContext = React.createContext<StateContext>(undefined)
12
const setContext = React.createContext<SetContext>((_: StateContext) => {})
13
14
export function Provider({children}: {children: React.ReactNode}) {
15
const [state, setState] = React.useState<StateContext>()
···
9
type SetContext = (v: StateContext) => void
10
11
const stateContext = React.createContext<StateContext>(undefined)
12
+
stateContext.displayName = 'ActiveStarterPackStateContext'
13
const setContext = React.createContext<SetContext>((_: StateContext) => {})
14
+
setContext.displayName = 'ActiveStarterPackSetContext'
15
16
export function Provider({children}: {children: React.ReactNode}) {
17
const [state, setState] = React.useState<StateContext>()
+1
src/state/shell/tick-every-minute.tsx
+1
src/state/shell/tick-every-minute.tsx
+2
-1
src/view/com/pager/PagerHeaderContext.tsx
+2
-1
src/view/com/pager/PagerHeaderContext.tsx
···
1
import React, {useContext} from 'react'
2
-
import {SharedValue} from 'react-native-reanimated'
3
4
import {isNative} from '#/platform/detection'
5
···
7
scrollY: SharedValue<number>
8
headerHeight: number
9
} | null>(null)
10
11
/**
12
* Passes information about the scroll position and header height down via
···
1
import React, {useContext} from 'react'
2
+
import {type SharedValue} from 'react-native-reanimated'
3
4
import {isNative} from '#/platform/detection'
5
···
7
scrollY: SharedValue<number>
8
headerHeight: number
9
} | null>(null)
10
+
PagerHeaderContext.displayName = 'PagerHeaderContext'
11
12
/**
13
* Passes information about the scroll position and header height down via