Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork

Add displayName to contexts (#8814)

authored by samuel.fm and committed by GitHub b2c56cbd 275fece3

Changed files
+173 -28
__mocks__
modules
bottom-sheet
src
alf
components
lib
screens
Onboarding
StepProfile
Settings
components
Signup
StarterPack
Wizard
state
view
+6 -5
__mocks__/@gorhom/bottom-sheet.tsx
··· 1 - import React, {ReactNode} from 'react' 2 - import {View, ScrollView, Modal, FlatList, TextInput} from 'react-native' 1 + import React, {type ReactNode} from 'react' 2 + import {FlatList, Modal, ScrollView, TextInput, View} from 'react-native' 3 3 4 4 const BottomSheetModalContext = React.createContext(null) 5 + BottomSheetModalContext.displayName = 'BottomSheetModalContext' 5 6 6 7 const BottomSheetModalProvider = (props: any) => { 7 8 return <BottomSheetModalContext.Provider {...props} value={{}} /> ··· 47 48 export {useBottomSheetDynamicSnapPoints} 48 49 49 50 export { 50 - BottomSheetModalProvider, 51 51 BottomSheetBackdrop, 52 + BottomSheetFlatList, 53 + BottomSheetFooter, 52 54 BottomSheetHandle, 53 55 BottomSheetModal, 54 - BottomSheetFooter, 56 + BottomSheetModalProvider, 55 57 BottomSheetScrollView, 56 - BottomSheetFlatList, 57 58 BottomSheetTextInput, 58 59 } 59 60
+1
modules/bottom-sheet/src/BottomSheetPortal.tsx
··· 5 5 type PortalContext = React.ElementType<{children: React.ReactNode}> 6 6 7 7 export const Context = React.createContext({} as PortalContext) 8 + Context.displayName = 'BottomSheetPortalContext' 8 9 9 10 export const useBottomSheetPortal_INTERNAL = () => React.useContext(Context) 10 11
+1
modules/bottom-sheet/src/lib/Portal.tsx
··· 18 18 append: () => {}, 19 19 remove: () => {}, 20 20 }) 21 + Context.displayName = 'BottomSheetPortalContext' 21 22 22 23 function Provider(props: React.PropsWithChildren<{}>) { 23 24 const map = React.useRef<ComponentMap>({})
+3 -2
src/alf/index.tsx
··· 8 8 setFontScale as persistFontScale, 9 9 } from '#/alf/fonts' 10 10 import {createThemes, defaultTheme} from '#/alf/themes' 11 - import {Theme, ThemeName} from '#/alf/types' 11 + import {type Theme, type ThemeName} from '#/alf/types' 12 12 import {BLUE_HUE, GREEN_HUE, RED_HUE} from '#/alf/util/colorGeneration' 13 - import {Device} from '#/storage' 13 + import {type Device} from '#/storage' 14 14 15 15 export {atoms} from '#/alf/atoms' 16 16 export * from '#/alf/breakpoints' ··· 61 61 }, 62 62 flags: {}, 63 63 }) 64 + Context.displayName = 'AlfContext' 64 65 65 66 export function ThemeProvider({ 66 67 children,
+1
src/components/Admonition.tsx
··· 23 23 const Context = createContext<Context>({ 24 24 type: 'info', 25 25 }) 26 + Context.displayName = 'AdmonitionContext' 26 27 27 28 export function Icon() { 28 29 const t = useTheme()
+1
src/components/Button.tsx
··· 109 109 pressed: false, 110 110 disabled: false, 111 111 }) 112 + Context.displayName = 'ButtonContext' 112 113 113 114 export function useButtonContext() { 114 115 return React.useContext(Context)
+3
src/components/ContextMenu/context.tsx
··· 7 7 } from '#/components/ContextMenu/types' 8 8 9 9 export const Context = React.createContext<ContextType | null>(null) 10 + Context.displayName = 'ContextMenuContext' 10 11 11 12 export const MenuContext = React.createContext<MenuContextType | null>(null) 13 + MenuContext.displayName = 'ContextMenuMenuContext' 12 14 13 15 export const ItemContext = React.createContext<ItemContextType | null>(null) 16 + ItemContext.displayName = 'ContextMenuItemContext' 14 17 15 18 export function useContextMenuContext() { 16 19 const context = React.useContext(Context)
+1
src/components/Dialog/context.ts
··· 23 23 setDisableDrag: () => {}, 24 24 isWithinDialog: false, 25 25 }) 26 + Context.displayName = 'DialogContext' 26 27 27 28 export function useDialogContext() { 28 29 return useContext(Context)
+2 -1
src/components/Grid.tsx
··· 1 1 import {createContext, useContext, useMemo} from 'react' 2 2 import {View} from 'react-native' 3 3 4 - import {atoms as a, ViewStyleProp} from '#/alf' 4 + import {atoms as a, type ViewStyleProp} from '#/alf' 5 5 6 6 const Context = createContext({ 7 7 gap: 0, 8 8 }) 9 + Context.displayName = 'GridContext' 9 10 10 11 export function Row({ 11 12 children,
+1
src/components/Layout/Header/index.tsx
··· 77 77 } 78 78 79 79 const AlignmentContext = createContext<'platform' | 'left'>('platform') 80 + AlignmentContext.displayName = 'AlignmentContext' 80 81 81 82 export function Content({ 82 83 children,
+1
src/components/Layout/context.ts
··· 3 3 export const ScrollbarOffsetContext = React.createContext({ 4 4 isWithinOffsetView: false, 5 5 }) 6 + ScrollbarOffsetContext.displayName = 'ScrollbarOffsetContext'
+2
src/components/Menu/context.tsx
··· 3 3 import {type ContextType, type ItemContextType} from '#/components/Menu/types' 4 4 5 5 export const Context = React.createContext<ContextType | null>(null) 6 + Context.displayName = 'MenuContext' 6 7 7 8 export const ItemContext = React.createContext<ItemContextType | null>(null) 9 + ItemContext.displayName = 'MenuItemContext' 8 10 9 11 export function useMenuContext() { 10 12 const context = React.useContext(Context)
+1
src/components/PolicyUpdateOverlay/context.tsx
··· 28 28 */ 29 29 setIsReadyToShowOverlay: () => {}, 30 30 }) 31 + Context.displayName = 'PolicyUpdateOverlayContext' 31 32 32 33 export function usePolicyUpdateContext() { 33 34 const context = useContext(Context)
+1
src/components/Portal.tsx
··· 28 28 append: () => {}, 29 29 remove: () => {}, 30 30 }) 31 + Context.displayName = 'PortalContext' 31 32 32 33 function Provider(props: React.PropsWithChildren<{}>) { 33 34 const map = useRef<ComponentMap>({})
+1
src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx
··· 15 15 setActiveView: (viewId: string) => void 16 16 sendViewPosition: (viewId: string, y: number) => void 17 17 } | null>(null) 18 + Context.displayName = 'ActiveVideoWebContext' 18 19 19 20 export function Provider({children}: {children: React.ReactNode}) { 20 21 if (!isWeb) {
+1
src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx
··· 8 8 volume: number 9 9 setVolume: React.Dispatch<React.SetStateAction<number>> 10 10 } | null>(null) 11 + Context.displayName = 'VideoVolumeContext' 11 12 12 13 export function Provider({children}: {children: React.ReactNode}) { 13 14 const [muted, setMuted] = React.useState(true)
+1
src/components/Post/Embed/VideoEmbed/index.web.tsx
··· 125 125 } 126 126 127 127 const NearScreenContext = createContext(false) 128 + NearScreenContext.displayName = 'VideoNearScreenContext' 128 129 129 130 /** 130 131 * Renders a 100vh tall div and watches it with an IntersectionObserver to
+1
src/components/PostControls/PostControlButton.tsx
··· 13 13 active?: boolean 14 14 color?: {color: string} 15 15 }>({}) 16 + PostControlContext.displayName = 'PostControlContext' 16 17 17 18 // Base button style, which the the other ones extend 18 19 export function PostControlButton({
+1
src/components/Prompt.tsx
··· 27 27 titleId: '', 28 28 descriptionId: '', 29 29 }) 30 + Context.displayName = 'PromptContext' 30 31 31 32 export function Outer({ 32 33 children,
+3
src/components/Select/index.tsx
··· 34 34 } & Pick<RootProps, 'value' | 'onValueChange' | 'disabled'> 35 35 36 36 const Context = createContext<ContextType | null>(null) 37 + Context.displayName = 'SelectContext' 37 38 38 39 const ValueTextContext = createContext< 39 40 [any, React.Dispatch<React.SetStateAction<any>>] 40 41 >([undefined, () => {}]) 42 + ValueTextContext.displayName = 'ValueTextContext' 41 43 42 44 function useSelectContext() { 43 45 const ctx = useContext(Context) ··· 229 231 focused: false, 230 232 pressed: false, 231 233 }) 234 + ItemContext.displayName = 'SelectItemContext' 232 235 233 236 export function useItemContext() { 234 237 return useContext(ItemContext)
+2
src/components/Select/index.web.tsx
··· 23 23 } from './types' 24 24 25 25 const SelectedValueContext = createContext<string | undefined | null>(null) 26 + SelectedValueContext.displayName = 'SelectSelectedValueContext' 26 27 27 28 export function Root(props: RootProps) { 28 29 return ( ··· 219 220 pressed: false, 220 221 selected: false, 221 222 }) 223 + ItemContext.displayName = 'SelectItemContext' 222 224 223 225 export function useItemContext() { 224 226 return useContext(ItemContext)
+1
src/components/Toast/Toast.tsx
··· 24 24 const Context = createContext<ContextType>({ 25 25 type: 'default', 26 26 }) 27 + Context.displayName = 'ToastContext' 27 28 28 29 export function Toast({ 29 30 type,
+2
src/components/Tooltip/index.tsx
··· 53 53 visible: false, 54 54 onVisibleChange: () => {}, 55 55 }) 56 + TooltipContext.displayName = 'TooltipContext' 56 57 57 58 const TargetContext = createContext<TargetContextType>({ 58 59 targetMeasurements: undefined, 59 60 setTargetMeasurements: () => {}, 60 61 shouldMeasure: false, 61 62 }) 63 + TargetContext.displayName = 'TargetContext' 62 64 63 65 export function Outer({ 64 66 children,
+1
src/components/Tooltip/index.web.tsx
··· 20 20 position: 'bottom', 21 21 onVisibleChange: () => {}, 22 22 }) 23 + TooltipContext.displayName = 'TooltipContext' 23 24 24 25 export function Outer({ 25 26 children,
+1
src/components/dialogs/Context.tsx
··· 27 27 } 28 28 29 29 const ControlsContext = createContext<ControlsContext | null>(null) 30 + ControlsContext.displayName = 'GlobalDialogControlsContext' 30 31 31 32 export function useGlobalDialogsControlContext() { 32 33 const ctx = useContext(ControlsContext)
+1
src/components/dialogs/nuxs/index.tsx
··· 47 47 activeNux: undefined, 48 48 dismissActiveNux: () => {}, 49 49 }) 50 + Context.displayName = 'NuxDialogContext' 50 51 51 52 export function useNuxDialogContext() { 52 53 return React.useContext(Context)
+1
src/components/dms/MessageContext.tsx
··· 1 1 import React from 'react' 2 2 3 3 const MessageContext = React.createContext(false) 4 + MessageContext.displayName = 'MessageContext' 4 5 5 6 export function MessageContextProvider({ 6 7 children,
+1
src/components/forms/TextField.tsx
··· 46 46 onFocus: () => {}, 47 47 onBlur: () => {}, 48 48 }) 49 + Context.displayName = 'TextFieldContext' 49 50 50 51 export type RootProps = React.PropsWithChildren<{isInvalid?: boolean}> 51 52
+5 -3
src/components/forms/Toggle.tsx
··· 1 1 import React from 'react' 2 - import {Pressable, View, ViewStyle} from 'react-native' 2 + import {Pressable, View, type ViewStyle} from 'react-native' 3 3 import Animated, {LinearTransition} from 'react-native-reanimated' 4 4 5 5 import {HITSLOP_10} from '#/lib/constants' ··· 8 8 atoms as a, 9 9 flatten, 10 10 native, 11 - TextStyleProp, 11 + type TextStyleProp, 12 12 useTheme, 13 - ViewStyleProp, 13 + type ViewStyleProp, 14 14 } from '#/alf' 15 15 import {useInteractionState} from '#/components/hooks/useInteractionState' 16 16 import {CheckThick_Stroke2_Corner0_Rounded as Checkmark} from '#/components/icons/Check' ··· 35 35 pressed: false, 36 36 focused: false, 37 37 }) 38 + ItemContext.displayName = 'ToggleItemContext' 38 39 39 40 const GroupContext = React.createContext<{ 40 41 values: string[] ··· 49 50 maxSelectionsReached: false, 50 51 setFieldValue: () => {}, 51 52 }) 53 + GroupContext.displayName = 'ToggleGroupContext' 52 54 53 55 export type GroupProps = React.PropsWithChildren<{ 54 56 type?: 'radio' | 'checkbox'
+2 -1
src/components/intents/IntentDialogs.tsx
··· 1 1 import React from 'react' 2 2 3 3 import * as Dialog from '#/components/Dialog' 4 - import {DialogControlProps} from '#/components/Dialog' 4 + import {type DialogControlProps} from '#/components/Dialog' 5 5 import {VerifyEmailIntentDialog} from '#/components/intents/VerifyEmailIntentDialog' 6 6 7 7 interface Context { ··· 11 11 } 12 12 13 13 const Context = React.createContext({} as Context) 14 + Context.displayName = 'IntentDialogsContext' 14 15 export const useIntentDialogs = () => React.useContext(Context) 15 16 16 17 export function Provider({children}: {children: React.ReactNode}) {
+3 -2
src/components/moderation/Hider.tsx
··· 1 1 import React from 'react' 2 - import {ModerationUI} from '@atproto/api' 2 + import {type ModerationUI} from '@atproto/api' 3 3 4 4 import { 5 - ModerationCauseDescription, 5 + type ModerationCauseDescription, 6 6 useModerationCauseDescription, 7 7 } from '#/lib/moderation/useModerationCauseDescription' 8 8 import { ··· 22 22 } 23 23 24 24 const Context = React.createContext<Context>({} as Context) 25 + Context.displayName = 'HiderContext' 25 26 26 27 export const useHider = () => React.useContext(Context) 27 28
+3 -2
src/lib/ScrollContext.tsx
··· 1 - import React, {createContext, useContext, useMemo} from 'react' 2 - import {ScrollHandlers} from 'react-native-reanimated' 1 + import {createContext, useContext, useMemo} from 'react' 2 + import {type ScrollHandlers} from 'react-native-reanimated' 3 3 4 4 const ScrollContext = createContext<ScrollHandlers<any>>({ 5 5 onBeginDrag: undefined, ··· 7 7 onScroll: undefined, 8 8 onMomentumEnd: undefined, 9 9 }) 10 + ScrollContext.displayName = 'ScrollContext' 10 11 11 12 export function useScrollHandlers(): ScrollHandlers<any> { 12 13 return useContext(ScrollContext)
+1
src/lib/ThemeContext.tsx
··· 89 89 } 90 90 91 91 export const ThemeContext = createContext<Theme>(defaultTheme) 92 + ThemeContext.displayName = 'ThemeContext' 92 93 93 94 export const useTheme = () => useContext(ThemeContext) 94 95
+2
src/lib/hooks/useEnableKeyboardController.tsx
··· 19 19 incrementRefCount: () => {}, 20 20 decrementRefCount: () => {}, 21 21 }) 22 + KeyboardControllerRefCountContext.displayName = 23 + 'KeyboardControllerRefCountContext' 22 24 23 25 export function KeyboardControllerProvider({ 24 26 children,
+3
src/lib/hooks/useHideBottomBarBorder.tsx
··· 4 4 type HideBottomBarBorderSetter = () => () => void 5 5 6 6 const HideBottomBarBorderContext = createContext<boolean>(false) 7 + HideBottomBarBorderContext.displayName = 'HideBottomBarBorderContext' 7 8 const HideBottomBarBorderSetterContext = 8 9 createContext<HideBottomBarBorderSetter | null>(null) 10 + HideBottomBarBorderSetterContext.displayName = 11 + 'HideBottomBarBorderSetterContext' 9 12 10 13 export function useHideBottomBarBorderSetter() { 11 14 const hideBottomBarBorder = useContext(HideBottomBarBorderSetterContext)
+1
src/lib/statsig/statsig.tsx
··· 147 147 // and it's been difficult to get it to behave in a predictable way. 148 148 // Our own cache ensures consistent evaluation within a single session. 149 149 const GateCache = React.createContext<Map<string, boolean> | null>(null) 150 + GateCache.displayName = 'StatsigGateCacheContext' 150 151 151 152 type GateOptions = { 152 153 dangerouslyDisableExposureLogging?: boolean
+1
src/screens/Onboarding/StepProfile/index.tsx
··· 59 59 } 60 60 61 61 const AvatarContext = React.createContext<IAvatarContext>({} as IAvatarContext) 62 + AvatarContext.displayName = 'AvatarContext' 62 63 export const useAvatar = () => React.useContext(AvatarContext) 63 64 64 65 const randomColor =
+5 -1
src/screens/Onboarding/state.ts
··· 3 3 import {useLingui} from '@lingui/react' 4 4 5 5 import {logger} from '#/logger' 6 - import {AvatarColor, Emoji} from '#/screens/Onboarding/StepProfile/types' 6 + import { 7 + type AvatarColor, 8 + type Emoji, 9 + } from '#/screens/Onboarding/StepProfile/types' 7 10 8 11 export type OnboardingState = { 9 12 hasPrev: boolean ··· 147 150 state: {...initialState}, 148 151 dispatch: () => {}, 149 152 }) 153 + Context.displayName = 'OnboardingContext' 150 154 151 155 export function reducer( 152 156 s: OnboardingState,
+1
src/screens/Settings/components/SettingsList.tsx
··· 18 18 destructive: false, 19 19 withinGroup: false, 20 20 }) 21 + ItemContext.displayName = 'SettingsListItemContext' 21 22 22 23 const Portal = createPortalGroup() 23 24
+1
src/screens/Signup/state.ts
··· 246 246 dispatch: React.Dispatch<SignupAction> 247 247 } 248 248 export const SignupContext = React.createContext<IContext>({} as IContext) 249 + SignupContext.displayName = 'SignupContext' 249 250 export const useSignupContext = () => React.useContext(SignupContext) 250 251 251 252 export function useSubmitSignup() {
+1
src/screens/StarterPack/Wizard/State.tsx
··· 45 45 {} as State, 46 46 (_: Action) => {}, 47 47 ]) 48 + StateContext.displayName = 'StarterPackWizardStateContext' 48 49 export const useWizardState = () => React.useContext(StateContext) 49 50 50 51 function reducer(state: State, action: Action): State {
+1
src/state/a11y.tsx
··· 8 8 reduceMotionEnabled: false, 9 9 screenReaderEnabled: false, 10 10 }) 11 + Context.displayName = 'A11yContext' 11 12 12 13 export function useA11y() { 13 14 return React.useContext(Context)
+2
src/state/ageAssurance/index.tsx
··· 28 28 lastInitiatedAt: undefined, 29 29 isAgeRestricted: false, 30 30 }) 31 + AgeAssuranceContext.displayName = 'AgeAssuranceContext' 31 32 32 33 const AgeAssuranceAPIContext = createContext<AgeAssuranceAPIContextType>({ 33 34 // @ts-ignore can't be bothered to type this 34 35 refetch: () => Promise.resolve(), 35 36 }) 37 + AgeAssuranceAPIContext.displayName = 'AgeAssuranceAPIContext' 36 38 37 39 /** 38 40 * Low-level provider for fetching age assurance state on app load. Do not add
+2
src/state/cache/thread-mutes.tsx
··· 7 7 type SetStateContext = (uri: string, value: boolean) => void 8 8 9 9 const stateContext = React.createContext<StateContext>(new Map()) 10 + stateContext.displayName = 'ThreadMutesStateContext' 10 11 const setStateContext = React.createContext<SetStateContext>( 11 12 (_: string) => false, 12 13 ) 14 + setStateContext.displayName = 'ThreadMutesSetStateContext' 13 15 14 16 export function Provider({children}: React.PropsWithChildren<{}>) { 15 17 const [state, setState] = React.useState<StateContext>(() => new Map())
+3
src/state/dialogs/index.tsx
··· 26 26 } 27 27 28 28 const DialogContext = React.createContext<IDialogContext>({} as IDialogContext) 29 + DialogContext.displayName = 'DialogContext' 29 30 30 31 const DialogControlContext = React.createContext<IDialogControlContext>( 31 32 {} as IDialogControlContext, 32 33 ) 34 + DialogControlContext.displayName = 'DialogControlContext' 33 35 34 36 /** 35 37 * The number of dialogs that are fully expanded. This is used to determine the background color of the status bar ··· 107 109 </DialogContext.Provider> 108 110 ) 109 111 } 112 + Provider.displayName = 'DialogsProvider'
+1
src/state/feed-feedback.tsx
··· 35 35 sendInteraction: (_interaction: AppBskyFeedDefs.Interaction) => {}, 36 36 feedDescriptor: undefined, 37 37 }) 38 + stateContext.displayName = 'FeedFeedbackContext' 38 39 39 40 export function useFeedFeedback( 40 41 feed: FeedDescriptor | undefined,
+1
src/state/geolocation.tsx
··· 154 154 const context = React.createContext<Context>({ 155 155 geolocation: DEFAULT_GEOLOCATION, 156 156 }) 157 + context.displayName = 'GeolocationContext' 157 158 158 159 export function Provider({children}: {children: React.ReactNode}) { 159 160 const [geolocation, setGeolocation] = React.useState(() => {
+1
src/state/global-gesture-events/index.tsx
··· 25 25 register: () => {}, 26 26 unregister: () => {}, 27 27 }) 28 + Context.displayName = 'GlobalGestureEventsContext' 28 29 29 30 export function GlobalGestureEventsProvider({ 30 31 children,
+2
src/state/home-badge.tsx
··· 4 4 type ApiContext = (hasNew: boolean) => void 5 5 6 6 const stateContext = React.createContext<StateContext>(false) 7 + stateContext.displayName = 'HomeBadgeStateContext' 7 8 const apiContext = React.createContext<ApiContext>((_: boolean) => {}) 9 + apiContext.displayName = 'HomeBadgeApiContext' 8 10 9 11 export function Provider({children}: React.PropsWithChildren<{}>) { 10 12 const [state, setState] = React.useState(false)
+2
src/state/invites.tsx
··· 10 10 const stateContext = React.createContext<StateContext>( 11 11 persisted.defaults.invites, 12 12 ) 13 + stateContext.displayName = 'InvitesStateContext' 13 14 const apiContext = React.createContext<ApiContext>({ 14 15 setInviteCopied(_: string) {}, 15 16 }) 17 + apiContext.displayName = 'InvitesApiContext' 16 18 17 19 export function Provider({children}: React.PropsWithChildren<{}>) { 18 20 const [state, setState] = React.useState(persisted.get('invites'))
+3 -1
src/state/lightbox.tsx
··· 2 2 import {nanoid} from 'nanoid/non-secure' 3 3 4 4 import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' 5 - import {ImageSource} from '#/view/com/lightbox/ImageViewing/@types' 5 + import {type ImageSource} from '#/view/com/lightbox/ImageViewing/@types' 6 6 7 7 export type Lightbox = { 8 8 id: string ··· 15 15 }>({ 16 16 activeLightbox: null, 17 17 }) 18 + LightboxContext.displayName = 'LightboxContext' 18 19 19 20 const LightboxControlContext = React.createContext<{ 20 21 openLightbox: (lightbox: Omit<Lightbox, 'id'>) => void ··· 23 24 openLightbox: () => {}, 24 25 closeLightbox: () => false, 25 26 }) 27 + LightboxControlContext.displayName = 'LightboxControlContext' 26 28 27 29 export function Provider({children}: React.PropsWithChildren<{}>) { 28 30 const [activeLightbox, setActiveLightbox] = React.useState<Lightbox | null>(
+1
src/state/messages/convo/index.tsx
··· 26 26 export * from '#/state/messages/convo/util' 27 27 28 28 const ChatContext = React.createContext<ConvoState | null>(null) 29 + ChatContext.displayName = 'ChatContext' 29 30 30 31 export function useConvo() { 31 32 const ctx = useContext(ChatContext)
+1
src/state/messages/current-convo-id.tsx
··· 7 7 currentConvoId: undefined, 8 8 setCurrentConvoId: () => {}, 9 9 }) 10 + CurrentConvoIdContext.displayName = 'CurrentConvoIdContext' 10 11 11 12 export function useCurrentConvoId() { 12 13 const ctx = React.useContext(CurrentConvoIdContext)
+1
src/state/messages/events/index.tsx
··· 7 7 const MessagesEventBusContext = React.createContext<MessagesEventBus | null>( 8 8 null, 9 9 ) 10 + MessagesEventBusContext.displayName = 'MessagesEventBusContext' 10 11 11 12 export function useMessagesEventBus() { 12 13 const ctx = React.useContext(MessagesEventBusContext)
+1
src/state/messages/message-drafts.tsx
··· 6 6 state: State 7 7 dispatch: React.Dispatch<Actions> 8 8 } | null>(null) 9 + MessageDraftsContext.displayName = 'MessageDraftsContext' 9 10 10 11 function useMessageDraftsContext() { 11 12 const ctx = React.useContext(MessageDraftsContext)
+2
src/state/modals/index.tsx
··· 70 70 isModalActive: false, 71 71 activeModals: [], 72 72 }) 73 + ModalContext.displayName = 'ModalContext' 73 74 74 75 const ModalControlContext = React.createContext<{ 75 76 openModal: (modal: Modal) => void ··· 80 81 closeModal: () => false, 81 82 closeAllModals: () => false, 82 83 }) 84 + ModalControlContext.displayName = 'ModalControlContext' 83 85 84 86 export function Provider({children}: React.PropsWithChildren<{}>) { 85 87 const [activeModals, setActiveModals] = React.useState<Modal[]>([])
+2
src/state/preferences/alt-text-required.tsx
··· 8 8 const stateContext = React.createContext<StateContext>( 9 9 persisted.defaults.requireAltTextEnabled, 10 10 ) 11 + stateContext.displayName = 'AltTextRequiredStateContext' 11 12 const setContext = React.createContext<SetContext>( 12 13 (_: persisted.Schema['requireAltTextEnabled']) => {}, 13 14 ) 15 + setContext.displayName = 'AltTextRequiredSetContext' 14 16 15 17 export function Provider({children}: React.PropsWithChildren<{}>) { 16 18 const [state, setState] = React.useState(
+2
src/state/preferences/autoplay.tsx
··· 8 8 const stateContext = React.createContext<StateContext>( 9 9 Boolean(persisted.defaults.disableAutoplay), 10 10 ) 11 + stateContext.displayName = 'AutoplayStateContext' 11 12 const setContext = React.createContext<SetContext>((_: boolean) => {}) 13 + setContext.displayName = 'AutoplaySetContext' 12 14 13 15 export function Provider({children}: {children: React.ReactNode}) { 14 16 const [state, setState] = React.useState(
+2
src/state/preferences/disable-haptics.tsx
··· 8 8 const stateContext = React.createContext<StateContext>( 9 9 Boolean(persisted.defaults.disableHaptics), 10 10 ) 11 + stateContext.displayName = 'DisableHapticsStateContext' 11 12 const setContext = React.createContext<SetContext>((_: boolean) => {}) 13 + setContext.displayName = 'DisableHapticsSetContext' 12 14 13 15 export function Provider({children}: {children: React.ReactNode}) { 14 16 const [state, setState] = React.useState(
+3 -1
src/state/preferences/external-embeds-prefs.tsx
··· 1 1 import React from 'react' 2 2 3 - import {EmbedPlayerSource} from '#/lib/strings/embed-player' 3 + import {type EmbedPlayerSource} from '#/lib/strings/embed-player' 4 4 import * as persisted from '#/state/persisted' 5 5 6 6 type StateContext = persisted.Schema['externalEmbeds'] ··· 12 12 const stateContext = React.createContext<StateContext>( 13 13 persisted.defaults.externalEmbeds, 14 14 ) 15 + stateContext.displayName = 'ExternalEmbedsPrefsStateContext' 15 16 const setContext = React.createContext<SetContext>({} as SetContext) 17 + setContext.displayName = 'ExternalEmbedsPrefsSetContext' 16 18 17 19 export function Provider({children}: React.PropsWithChildren<{}>) { 18 20 const [state, setState] = React.useState(persisted.get('externalEmbeds'))
+2
src/state/preferences/hidden-posts.tsx
··· 14 14 const stateContext = React.createContext<StateContext>( 15 15 persisted.defaults.hiddenPosts, 16 16 ) 17 + stateContext.displayName = 'HiddenPostsStateContext' 17 18 const apiContext = React.createContext<ApiContext>({ 18 19 hidePost: () => {}, 19 20 unhidePost: () => {}, 20 21 }) 22 + apiContext.displayName = 'HiddenPostsApiContext' 21 23 22 24 export function Provider({children}: React.PropsWithChildren<{}>) { 23 25 const [state, setState] = React.useState(persisted.get('hiddenPosts'))
+2
src/state/preferences/in-app-browser.tsx
··· 8 8 const stateContext = React.createContext<StateContext>( 9 9 persisted.defaults.useInAppBrowser, 10 10 ) 11 + stateContext.displayName = 'InAppBrowserStateContext' 11 12 const setContext = React.createContext<SetContext>( 12 13 (_: persisted.Schema['useInAppBrowser']) => {}, 13 14 ) 15 + setContext.displayName = 'InAppBrowserSetContext' 14 16 15 17 export function Provider({children}: React.PropsWithChildren<{}>) { 16 18 const [state, setState] = React.useState(persisted.get('useInAppBrowser'))
+1
src/state/preferences/kawaii.tsx
··· 8 8 const stateContext = React.createContext<StateContext>( 9 9 persisted.defaults.kawaii, 10 10 ) 11 + stateContext.displayName = 'KawaiiStateContext' 11 12 12 13 export function Provider({children}: React.PropsWithChildren<{}>) { 13 14 const [state, setState] = React.useState(persisted.get('kawaii'))
+5 -1
src/state/preferences/label-defs.tsx
··· 1 1 import React from 'react' 2 - import {AppBskyLabelerDefs, InterpretedLabelValueDefinition} from '@atproto/api' 2 + import { 3 + type AppBskyLabelerDefs, 4 + type InterpretedLabelValueDefinition, 5 + } from '@atproto/api' 3 6 4 7 import {useLabelDefinitionsQuery} from '../queries/preferences' 5 8 ··· 12 15 labelDefs: {}, 13 16 labelers: [], 14 17 }) 18 + stateContext.displayName = 'LabelDefsStateContext' 15 19 16 20 export function Provider({children}: React.PropsWithChildren<{}>) { 17 21 const state = useLabelDefinitionsQuery()
+3 -1
src/state/preferences/languages.tsx
··· 1 1 import React from 'react' 2 2 3 - import {AppLanguage} from '#/locale/languages' 3 + import {type AppLanguage} from '#/locale/languages' 4 4 import * as persisted from '#/state/persisted' 5 5 6 6 type SetStateCb = ( ··· 20 20 const stateContext = React.createContext<StateContext>( 21 21 persisted.defaults.languagePrefs, 22 22 ) 23 + stateContext.displayName = 'LanguagePrefsStateContext' 23 24 const apiContext = React.createContext<ApiContext>({ 24 25 setPrimaryLanguage: (_: string) => {}, 25 26 setPostLanguage: (_: string) => {}, ··· 29 30 savePostLanguageToHistory: () => {}, 30 31 setAppLanguage: (_: AppLanguage) => {}, 31 32 }) 33 + apiContext.displayName = 'LanguagePrefsApiContext' 32 34 33 35 export function Provider({children}: React.PropsWithChildren<{}>) { 34 36 const [state, setState] = React.useState(persisted.get('languagePrefs'))
+2
src/state/preferences/large-alt-badge.tsx
··· 8 8 const stateContext = React.createContext<StateContext>( 9 9 persisted.defaults.largeAltBadgeEnabled, 10 10 ) 11 + stateContext.displayName = 'LargeAltBadgeStateContext' 11 12 const setContext = React.createContext<SetContext>( 12 13 (_: persisted.Schema['largeAltBadgeEnabled']) => {}, 13 14 ) 15 + setContext.displayName = 'LargeAltBadgeSetContext' 14 16 15 17 export function Provider({children}: React.PropsWithChildren<{}>) { 16 18 const [state, setState] = React.useState(
+4 -2
src/state/preferences/moderation-opts.tsx
··· 1 - import React, {createContext, useContext, useMemo} from 'react' 2 - import {BskyAgent, ModerationOpts} from '@atproto/api' 1 + import {createContext, useContext, useMemo} from 'react' 2 + import {BskyAgent, type ModerationOpts} from '@atproto/api' 3 3 4 4 import {useHiddenPosts, useLabelDefinitions} from '#/state/preferences' 5 5 import {DEFAULT_LOGGED_OUT_LABEL_PREFERENCES} from '#/state/queries/preferences/moderation' ··· 9 9 export const moderationOptsContext = createContext<ModerationOpts | undefined>( 10 10 undefined, 11 11 ) 12 + moderationOptsContext.displayName = 'ModerationOptsContext' 12 13 13 14 // used in the moderation state devtool 14 15 export const moderationOptsOverrideContext = createContext< 15 16 ModerationOpts | undefined 16 17 >(undefined) 18 + moderationOptsOverrideContext.displayName = 'ModerationOptsOverrideContext' 17 19 18 20 export function useModerationOpts() { 19 21 return useContext(moderationOptsContext)
+2
src/state/preferences/subtitles.tsx
··· 8 8 const stateContext = React.createContext<StateContext>( 9 9 Boolean(persisted.defaults.subtitlesEnabled), 10 10 ) 11 + stateContext.displayName = 'SubtitlesStateContext' 11 12 const setContext = React.createContext<SetContext>((_: boolean) => {}) 13 + setContext.displayName = 'SubtitlesSetContext' 12 14 13 15 export function Provider({children}: {children: React.ReactNode}) { 14 16 const [state, setState] = React.useState(
+2
src/state/preferences/trending.tsx
··· 22 22 trendingDisabled: Boolean(persisted.defaults.trendingDisabled), 23 23 trendingVideoDisabled: Boolean(persisted.defaults.trendingVideoDisabled), 24 24 }) 25 + StateContext.displayName = 'TrendingStateContext' 25 26 const ApiContext = React.createContext<ApiContext>({ 26 27 setTrendingDisabled() {}, 27 28 setTrendingVideoDisabled() {}, 28 29 }) 30 + ApiContext.displayName = 'TrendingApiContext' 29 31 30 32 function usePersistedBooleanValue<T extends keyof persisted.Schema>(key: T) { 31 33 const [value, _set] = React.useState(() => {
+2
src/state/preferences/used-starter-packs.tsx
··· 6 6 type SetContext = (v: boolean) => void 7 7 8 8 const stateContext = React.createContext<StateContext>(false) 9 + stateContext.displayName = 'UsedStarterPacksStateContext' 9 10 const setContext = React.createContext<SetContext>((_: boolean) => {}) 11 + setContext.displayName = 'UsedStarterPacksSetContext' 10 12 11 13 export function Provider({children}: {children: React.ReactNode}) { 12 14 const [state, setState] = React.useState<StateContext>(() =>
+1
src/state/queries/messages/list-conversations.tsx
··· 62 62 accepted: ChatBskyConvoDefs.ConvoView[] 63 63 request: ChatBskyConvoDefs.ConvoView[] 64 64 } | null>(null) 65 + ListConvosContext.displayName = 'ListConvosContext' 65 66 66 67 export function useListConvos() { 67 68 const ctx = useContext(ListConvosContext)
+2
src/state/queries/notifications/unread.tsx
··· 35 35 } 36 36 37 37 const stateContext = React.createContext<StateContext>('') 38 + stateContext.displayName = 'NotificationsUnreadStateContext' 38 39 39 40 const apiContext = React.createContext<ApiContext>({ 40 41 async markAllRead() {}, 41 42 async checkUnread() {}, 42 43 getCachedUnreadPage: () => undefined, 43 44 }) 45 + apiContext.displayName = 'NotificationsUnreadApiContext' 44 46 45 47 export function Provider({children}: React.PropsWithChildren<{}>) { 46 48 const {hasSession} = useSession()
+2
src/state/service-config.tsx
··· 16 16 const TrendingContext = createContext<TrendingContext>({ 17 17 enabled: false, 18 18 }) 19 + TrendingContext.displayName = 'TrendingContext' 19 20 20 21 const LiveNowContext = createContext<LiveNowContext | null>(null) 22 + LiveNowContext.displayName = 'LiveNowContext' 21 23 22 24 export function Provider({children}: {children: React.ReactNode}) { 23 25 const langPrefs = useLanguagePrefs()
+3
src/state/session/index.tsx
··· 30 30 currentAccount: undefined, 31 31 hasSession: false, 32 32 }) 33 + StateContext.displayName = 'SessionStateContext' 33 34 34 35 const AgentContext = React.createContext<BskyAgent | null>(null) 36 + AgentContext.displayName = 'SessionAgentContext' 35 37 36 38 const ApiContext = React.createContext<SessionApiContext>({ 37 39 createAccount: async () => {}, ··· 42 44 removeAccount: () => {}, 43 45 partialRefreshSession: async () => {}, 44 46 }) 47 + ApiContext.displayName = 'SessionApiContext' 45 48 46 49 export function Provider({children}: React.PropsWithChildren<{}>) { 47 50 const cancelPendingTask = useOneTaskAtATime()
+2
src/state/shell/color-mode.tsx
··· 15 15 colorMode: 'system', 16 16 darkTheme: 'dark', 17 17 }) 18 + stateContext.displayName = 'ColorModeStateContext' 18 19 const setContext = React.createContext<SetContext>({} as SetContext) 20 + setContext.displayName = 'ColorModeSetContext' 19 21 20 22 export function Provider({children}: React.PropsWithChildren<{}>) { 21 23 const [colorMode, setColorMode] = React.useState(persisted.get('colorMode'))
+2
src/state/shell/composer/index.tsx
··· 51 51 } 52 52 53 53 const stateContext = React.createContext<StateContext>(undefined) 54 + stateContext.displayName = 'ComposerStateContext' 54 55 const controlsContext = React.createContext<ControlsContext>({ 55 56 openComposer(_opts: ComposerOpts) {}, 56 57 closeComposer() { 57 58 return false 58 59 }, 59 60 }) 61 + controlsContext.displayName = 'ComposerControlsContext' 60 62 61 63 export function Provider({children}: React.PropsWithChildren<{}>) { 62 64 const {_} = useLingui()
+2
src/state/shell/drawer-open.tsx
··· 4 4 type SetContext = (v: boolean) => void 5 5 6 6 const stateContext = React.createContext<StateContext>(false) 7 + stateContext.displayName = 'DrawerOpenStateContext' 7 8 const setContext = React.createContext<SetContext>((_: boolean) => {}) 9 + setContext.displayName = 'DrawerOpenSetContext' 8 10 9 11 export function Provider({children}: React.PropsWithChildren<{}>) { 10 12 const [state, setState] = React.useState(false)
+2
src/state/shell/drawer-swipe-disabled.tsx
··· 4 4 type SetContext = (v: boolean) => void 5 5 6 6 const stateContext = React.createContext<StateContext>(false) 7 + stateContext.displayName = 'DrawerSwipeDisabledStateContext' 7 8 const setContext = React.createContext<SetContext>((_: boolean) => {}) 9 + setContext.displayName = 'DrawerSwipeDisabledSetContext' 8 10 9 11 export function Provider({children}: React.PropsWithChildren<{}>) { 10 12 const [state, setState] = React.useState(false)
+2
src/state/shell/logged-out.tsx
··· 39 39 showLoggedOut: false, 40 40 requestedAccountSwitchTo: undefined, 41 41 }) 42 + StateContext.displayName = 'LoggedOutStateContext' 42 43 43 44 const ControlsContext = React.createContext<Controls>({ 44 45 setShowLoggedOut: () => {}, 45 46 requestSwitchToAccount: () => {}, 46 47 clearRequestedAccount: () => {}, 47 48 }) 49 + ControlsContext.displayName = 'LoggedOutControlsContext' 48 50 49 51 export function Provider({children}: React.PropsWithChildren<{}>) { 50 52 const activeStarterPack = useActiveStarterPack()
+7 -1
src/state/shell/minimal-mode.tsx
··· 1 1 import React from 'react' 2 - import {SharedValue, useSharedValue, withSpring} from 'react-native-reanimated' 2 + import { 3 + type SharedValue, 4 + useSharedValue, 5 + withSpring, 6 + } from 'react-native-reanimated' 3 7 4 8 type StateContext = { 5 9 headerMode: SharedValue<number> ··· 29 33 set() {}, 30 34 }, 31 35 }) 36 + stateContext.displayName = 'MinimalModeStateContext' 32 37 const setContext = React.createContext<SetContext>((_: boolean) => {}) 38 + setContext.displayName = 'MinimalModeSetContext' 33 39 34 40 export function Provider({children}: React.PropsWithChildren<{}>) { 35 41 const headerMode = useSharedValue(0)
+2
src/state/shell/onboarding.tsx
··· 29 29 const stateContext = React.createContext<StateContext>( 30 30 compute(persisted.defaults.onboarding), 31 31 ) 32 + stateContext.displayName = 'OnboardingStateContext' 32 33 const dispatchContext = React.createContext<DispatchContext>((_: Action) => {}) 34 + dispatchContext.displayName = 'OnboardingDispatchContext' 33 35 34 36 function reducer(state: StateContext, action: Action): StateContext { 35 37 switch (action.type) {
+1
src/state/shell/post-progress.tsx
··· 10 10 progress: 0, 11 11 status: 'idle', 12 12 }) 13 + PostProgressContext.displayName = 'PostProgressContext' 13 14 14 15 export function Provider() {} 15 16
+3 -1
src/state/shell/progress-guide.tsx
··· 5 5 import {logEvent} from '#/lib/statsig/statsig' 6 6 import { 7 7 ProgressGuideToast, 8 - ProgressGuideToastRef, 8 + type ProgressGuideToastRef, 9 9 } from '#/components/ProgressGuide/Toast' 10 10 import { 11 11 usePreferencesQuery, ··· 45 45 | undefined 46 46 47 47 const ProgressGuideContext = React.createContext<ProgressGuide>(undefined) 48 + ProgressGuideContext.displayName = 'ProgressGuideContext' 48 49 49 50 const ProgressGuideControlContext = React.createContext<{ 50 51 startProgressGuide(guide: ProgressGuideName): void ··· 55 56 endProgressGuide: () => {}, 56 57 captureAction: (_action: ProgressGuideAction, _count = 1) => {}, 57 58 }) 59 + ProgressGuideControlContext.displayName = 'ProgressGuideControlContext' 58 60 59 61 export function useProgressGuide(guide: ProgressGuideName) { 60 62 const ctx = React.useContext(ProgressGuideContext)
+3 -1
src/state/shell/selected-feed.tsx
··· 2 2 3 3 import {isWeb} from '#/platform/detection' 4 4 import * as persisted from '#/state/persisted' 5 - import {FeedDescriptor} from '#/state/queries/post-feed' 5 + import {type FeedDescriptor} from '#/state/queries/post-feed' 6 6 7 7 type StateContext = FeedDescriptor | null 8 8 type SetContext = (v: FeedDescriptor) => void 9 9 10 10 const stateContext = React.createContext<StateContext>(null) 11 + stateContext.displayName = 'SelectedFeedStateContext' 11 12 const setContext = React.createContext<SetContext>((_: string) => {}) 13 + setContext.displayName = 'SelectedFeedSetContext' 12 14 13 15 function getInitialFeed(): FeedDescriptor | null { 14 16 if (isWeb) {
+2 -1
src/state/shell/shell-layout.tsx
··· 1 1 import React from 'react' 2 - import {SharedValue, useSharedValue} from 'react-native-reanimated' 2 + import {type SharedValue, useSharedValue} from 'react-native-reanimated' 3 3 4 4 type StateContext = { 5 5 headerHeight: SharedValue<number> ··· 28 28 set() {}, 29 29 }, 30 30 }) 31 + stateContext.displayName = 'ShellLayoutContext' 31 32 32 33 export function Provider({children}: React.PropsWithChildren<{}>) { 33 34 const headerHeight = useSharedValue(0)
+2
src/state/shell/starter-pack.tsx
··· 9 9 type SetContext = (v: StateContext) => void 10 10 11 11 const stateContext = React.createContext<StateContext>(undefined) 12 + stateContext.displayName = 'ActiveStarterPackStateContext' 12 13 const setContext = React.createContext<SetContext>((_: StateContext) => {}) 14 + setContext.displayName = 'ActiveStarterPackSetContext' 13 15 14 16 export function Provider({children}: {children: React.ReactNode}) { 15 17 const [state, setState] = React.useState<StateContext>()
+1
src/state/shell/tick-every-minute.tsx
··· 3 3 type StateContext = number 4 4 5 5 const stateContext = React.createContext<StateContext>(0) 6 + stateContext.displayName = 'TickEveryMinuteContext' 6 7 7 8 export function Provider({children}: React.PropsWithChildren<{}>) { 8 9 const [tick, setTick] = React.useState(Date.now())
+2
src/state/threadgate-hidden-replies.tsx
··· 14 14 uris: new Set(), 15 15 recentlyUnhiddenUris: new Set(), 16 16 }) 17 + StateContext.displayName = 'ThreadgateHiddenRepliesStateContext' 17 18 18 19 const ApiContext = React.createContext<ApiContext>({ 19 20 addHiddenReplyUri: () => {}, 20 21 removeHiddenReplyUri: () => {}, 21 22 }) 23 + ApiContext.displayName = 'ThreadgateHiddenRepliesApiContext' 22 24 23 25 export function Provider({children}: {children: React.ReactNode}) { 24 26 const [uris, setHiddenReplyUris] = React.useState<Set<string>>(new Set())
+2 -1
src/view/com/pager/PagerHeaderContext.tsx
··· 1 1 import React, {useContext} from 'react' 2 - import {SharedValue} from 'react-native-reanimated' 2 + import {type SharedValue} from 'react-native-reanimated' 3 3 4 4 import {isNative} from '#/platform/detection' 5 5 ··· 7 7 scrollY: SharedValue<number> 8 8 headerHeight: number 9 9 } | null>(null) 10 + PagerHeaderContext.displayName = 'PagerHeaderContext' 10 11 11 12 /** 12 13 * Passes information about the scroll position and header height down via