tangled mirror of catsky-🐱 Soothing soft social-app fork with all the niche toggles! (Unofficial); for issues and PRs please put them on github:NekoDrone/catsky-social

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' 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
··· 5 type PortalContext = React.ElementType<{children: React.ReactNode}> 6 7 export const Context = React.createContext({} as PortalContext) 8 9 export const useBottomSheetPortal_INTERNAL = () => React.useContext(Context) 10
··· 5 type PortalContext = React.ElementType<{children: React.ReactNode}> 6 7 export const Context = React.createContext({} as PortalContext) 8 + Context.displayName = 'BottomSheetPortalContext' 9 10 export const useBottomSheetPortal_INTERNAL = () => React.useContext(Context) 11
+1
modules/bottom-sheet/src/lib/Portal.tsx
··· 18 append: () => {}, 19 remove: () => {}, 20 }) 21 22 function Provider(props: React.PropsWithChildren<{}>) { 23 const map = React.useRef<ComponentMap>({})
··· 18 append: () => {}, 19 remove: () => {}, 20 }) 21 + Context.displayName = 'BottomSheetPortalContext' 22 23 function Provider(props: React.PropsWithChildren<{}>) { 24 const map = React.useRef<ComponentMap>({})
+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
··· 23 const Context = createContext<Context>({ 24 type: 'info', 25 }) 26 27 export function Icon() { 28 const t = useTheme()
··· 23 const Context = createContext<Context>({ 24 type: 'info', 25 }) 26 + Context.displayName = 'AdmonitionContext' 27 28 export function Icon() { 29 const t = useTheme()
+1
src/components/Button.tsx
··· 109 pressed: false, 110 disabled: false, 111 }) 112 113 export function useButtonContext() { 114 return React.useContext(Context)
··· 109 pressed: false, 110 disabled: false, 111 }) 112 + Context.displayName = 'ButtonContext' 113 114 export function useButtonContext() { 115 return React.useContext(Context)
+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
··· 23 setDisableDrag: () => {}, 24 isWithinDialog: false, 25 }) 26 27 export function useDialogContext() { 28 return useContext(Context)
··· 23 setDisableDrag: () => {}, 24 isWithinDialog: false, 25 }) 26 + Context.displayName = 'DialogContext' 27 28 export function useDialogContext() { 29 return useContext(Context)
+2 -1
src/components/Grid.tsx
··· 1 import {createContext, useContext, useMemo} from 'react' 2 import {View} from 'react-native' 3 4 - import {atoms as a, ViewStyleProp} from '#/alf' 5 6 const Context = createContext({ 7 gap: 0, 8 }) 9 10 export function Row({ 11 children,
··· 1 import {createContext, useContext, useMemo} from 'react' 2 import {View} from 'react-native' 3 4 + import {atoms as a, type ViewStyleProp} from '#/alf' 5 6 const Context = createContext({ 7 gap: 0, 8 }) 9 + Context.displayName = 'GridContext' 10 11 export function Row({ 12 children,
+1
src/components/Layout/Header/index.tsx
··· 77 } 78 79 const AlignmentContext = createContext<'platform' | 'left'>('platform') 80 81 export function Content({ 82 children,
··· 77 } 78 79 const AlignmentContext = createContext<'platform' | 'left'>('platform') 80 + AlignmentContext.displayName = 'AlignmentContext' 81 82 export function Content({ 83 children,
+1
src/components/Layout/context.ts
··· 3 export const ScrollbarOffsetContext = React.createContext({ 4 isWithinOffsetView: false, 5 })
··· 3 export const ScrollbarOffsetContext = React.createContext({ 4 isWithinOffsetView: false, 5 }) 6 + ScrollbarOffsetContext.displayName = 'ScrollbarOffsetContext'
+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
··· 28 */ 29 setIsReadyToShowOverlay: () => {}, 30 }) 31 32 export function usePolicyUpdateContext() { 33 const context = useContext(Context)
··· 28 */ 29 setIsReadyToShowOverlay: () => {}, 30 }) 31 + Context.displayName = 'PolicyUpdateOverlayContext' 32 33 export function usePolicyUpdateContext() { 34 const context = useContext(Context)
+1
src/components/Portal.tsx
··· 28 append: () => {}, 29 remove: () => {}, 30 }) 31 32 function Provider(props: React.PropsWithChildren<{}>) { 33 const map = useRef<ComponentMap>({})
··· 28 append: () => {}, 29 remove: () => {}, 30 }) 31 + Context.displayName = 'PortalContext' 32 33 function Provider(props: React.PropsWithChildren<{}>) { 34 const map = useRef<ComponentMap>({})
+1
src/components/Post/Embed/VideoEmbed/ActiveVideoWebContext.tsx
··· 15 setActiveView: (viewId: string) => void 16 sendViewPosition: (viewId: string, y: number) => void 17 } | null>(null) 18 19 export function Provider({children}: {children: React.ReactNode}) { 20 if (!isWeb) {
··· 15 setActiveView: (viewId: string) => void 16 sendViewPosition: (viewId: string, y: number) => void 17 } | null>(null) 18 + Context.displayName = 'ActiveVideoWebContext' 19 20 export function Provider({children}: {children: React.ReactNode}) { 21 if (!isWeb) {
+1
src/components/Post/Embed/VideoEmbed/VideoVolumeContext.tsx
··· 8 volume: number 9 setVolume: React.Dispatch<React.SetStateAction<number>> 10 } | null>(null) 11 12 export function Provider({children}: {children: React.ReactNode}) { 13 const [muted, setMuted] = React.useState(true)
··· 8 volume: number 9 setVolume: React.Dispatch<React.SetStateAction<number>> 10 } | null>(null) 11 + Context.displayName = 'VideoVolumeContext' 12 13 export function Provider({children}: {children: React.ReactNode}) { 14 const [muted, setMuted] = React.useState(true)
+1
src/components/Post/Embed/VideoEmbed/index.web.tsx
··· 125 } 126 127 const NearScreenContext = createContext(false) 128 129 /** 130 * Renders a 100vh tall div and watches it with an IntersectionObserver to
··· 125 } 126 127 const NearScreenContext = createContext(false) 128 + NearScreenContext.displayName = 'VideoNearScreenContext' 129 130 /** 131 * Renders a 100vh tall div and watches it with an IntersectionObserver to
+1
src/components/PostControls/PostControlButton.tsx
··· 13 active?: boolean 14 color?: {color: string} 15 }>({}) 16 17 // Base button style, which the the other ones extend 18 export function PostControlButton({
··· 13 active?: boolean 14 color?: {color: string} 15 }>({}) 16 + PostControlContext.displayName = 'PostControlContext' 17 18 // Base button style, which the the other ones extend 19 export function PostControlButton({
+1
src/components/Prompt.tsx
··· 27 titleId: '', 28 descriptionId: '', 29 }) 30 31 export function Outer({ 32 children,
··· 27 titleId: '', 28 descriptionId: '', 29 }) 30 + Context.displayName = 'PromptContext' 31 32 export function Outer({ 33 children,
+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
··· 23 } from './types' 24 25 const SelectedValueContext = createContext<string | undefined | null>(null) 26 27 export function Root(props: RootProps) { 28 return ( ··· 219 pressed: false, 220 selected: false, 221 }) 222 223 export function useItemContext() { 224 return useContext(ItemContext)
··· 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
··· 24 const Context = createContext<ContextType>({ 25 type: 'default', 26 }) 27 28 export function Toast({ 29 type,
··· 24 const Context = createContext<ContextType>({ 25 type: 'default', 26 }) 27 + Context.displayName = 'ToastContext' 28 29 export function Toast({ 30 type,
+2
src/components/Tooltip/index.tsx
··· 53 visible: false, 54 onVisibleChange: () => {}, 55 }) 56 57 const TargetContext = createContext<TargetContextType>({ 58 targetMeasurements: undefined, 59 setTargetMeasurements: () => {}, 60 shouldMeasure: false, 61 }) 62 63 export function Outer({ 64 children,
··· 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
··· 20 position: 'bottom', 21 onVisibleChange: () => {}, 22 }) 23 24 export function Outer({ 25 children,
··· 20 position: 'bottom', 21 onVisibleChange: () => {}, 22 }) 23 + TooltipContext.displayName = 'TooltipContext' 24 25 export function Outer({ 26 children,
+1
src/components/dialogs/Context.tsx
··· 27 } 28 29 const ControlsContext = createContext<ControlsContext | null>(null) 30 31 export function useGlobalDialogsControlContext() { 32 const ctx = useContext(ControlsContext)
··· 27 } 28 29 const ControlsContext = createContext<ControlsContext | null>(null) 30 + ControlsContext.displayName = 'GlobalDialogControlsContext' 31 32 export function useGlobalDialogsControlContext() { 33 const ctx = useContext(ControlsContext)
+1
src/components/dialogs/nuxs/index.tsx
··· 47 activeNux: undefined, 48 dismissActiveNux: () => {}, 49 }) 50 51 export function useNuxDialogContext() { 52 return React.useContext(Context)
··· 47 activeNux: undefined, 48 dismissActiveNux: () => {}, 49 }) 50 + Context.displayName = 'NuxDialogContext' 51 52 export function useNuxDialogContext() { 53 return React.useContext(Context)
+1
src/components/dms/MessageContext.tsx
··· 1 import React from 'react' 2 3 const MessageContext = React.createContext(false) 4 5 export function MessageContextProvider({ 6 children,
··· 1 import React from 'react' 2 3 const MessageContext = React.createContext(false) 4 + MessageContext.displayName = 'MessageContext' 5 6 export function MessageContextProvider({ 7 children,
+1
src/components/forms/TextField.tsx
··· 46 onFocus: () => {}, 47 onBlur: () => {}, 48 }) 49 50 export type RootProps = React.PropsWithChildren<{isInvalid?: boolean}> 51
··· 46 onFocus: () => {}, 47 onBlur: () => {}, 48 }) 49 + Context.displayName = 'TextFieldContext' 50 51 export type RootProps = React.PropsWithChildren<{isInvalid?: boolean}> 52
+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
··· 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
··· 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
··· 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
··· 89 } 90 91 export const ThemeContext = createContext<Theme>(defaultTheme) 92 93 export const useTheme = () => useContext(ThemeContext) 94
··· 89 } 90 91 export const ThemeContext = createContext<Theme>(defaultTheme) 92 + ThemeContext.displayName = 'ThemeContext' 93 94 export const useTheme = () => useContext(ThemeContext) 95
+2
src/lib/hooks/useEnableKeyboardController.tsx
··· 19 incrementRefCount: () => {}, 20 decrementRefCount: () => {}, 21 }) 22 23 export function KeyboardControllerProvider({ 24 children,
··· 19 incrementRefCount: () => {}, 20 decrementRefCount: () => {}, 21 }) 22 + KeyboardControllerRefCountContext.displayName = 23 + 'KeyboardControllerRefCountContext' 24 25 export function KeyboardControllerProvider({ 26 children,
+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
··· 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
··· 59 } 60 61 const AvatarContext = React.createContext<IAvatarContext>({} as IAvatarContext) 62 export const useAvatar = () => React.useContext(AvatarContext) 63 64 const randomColor =
··· 59 } 60 61 const AvatarContext = React.createContext<IAvatarContext>({} as IAvatarContext) 62 + AvatarContext.displayName = 'AvatarContext' 63 export const useAvatar = () => React.useContext(AvatarContext) 64 65 const randomColor =
+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
··· 18 destructive: false, 19 withinGroup: false, 20 }) 21 22 const Portal = createPortalGroup() 23
··· 18 destructive: false, 19 withinGroup: false, 20 }) 21 + ItemContext.displayName = 'SettingsListItemContext' 22 23 const Portal = createPortalGroup() 24
+1
src/screens/Signup/state.ts
··· 246 dispatch: React.Dispatch<SignupAction> 247 } 248 export const SignupContext = React.createContext<IContext>({} as IContext) 249 export const useSignupContext = () => React.useContext(SignupContext) 250 251 export function useSubmitSignup() {
··· 246 dispatch: React.Dispatch<SignupAction> 247 } 248 export const SignupContext = React.createContext<IContext>({} as IContext) 249 + SignupContext.displayName = 'SignupContext' 250 export const useSignupContext = () => React.useContext(SignupContext) 251 252 export function useSubmitSignup() {
+1
src/screens/StarterPack/Wizard/State.tsx
··· 45 {} as State, 46 (_: Action) => {}, 47 ]) 48 export const useWizardState = () => React.useContext(StateContext) 49 50 function reducer(state: State, action: Action): State {
··· 45 {} as State, 46 (_: Action) => {}, 47 ]) 48 + StateContext.displayName = 'StarterPackWizardStateContext' 49 export const useWizardState = () => React.useContext(StateContext) 50 51 function reducer(state: State, action: Action): State {
+1
src/state/a11y.tsx
··· 8 reduceMotionEnabled: false, 9 screenReaderEnabled: false, 10 }) 11 12 export function useA11y() { 13 return React.useContext(Context)
··· 8 reduceMotionEnabled: false, 9 screenReaderEnabled: false, 10 }) 11 + Context.displayName = 'A11yContext' 12 13 export function useA11y() { 14 return React.useContext(Context)
+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
··· 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
··· 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
··· 35 sendInteraction: (_interaction: AppBskyFeedDefs.Interaction) => {}, 36 feedDescriptor: undefined, 37 }) 38 39 export function useFeedFeedback( 40 feed: FeedDescriptor | undefined,
··· 35 sendInteraction: (_interaction: AppBskyFeedDefs.Interaction) => {}, 36 feedDescriptor: undefined, 37 }) 38 + stateContext.displayName = 'FeedFeedbackContext' 39 40 export function useFeedFeedback( 41 feed: FeedDescriptor | undefined,
+1
src/state/geolocation.tsx
··· 154 const context = React.createContext<Context>({ 155 geolocation: DEFAULT_GEOLOCATION, 156 }) 157 158 export function Provider({children}: {children: React.ReactNode}) { 159 const [geolocation, setGeolocation] = React.useState(() => {
··· 154 const context = React.createContext<Context>({ 155 geolocation: DEFAULT_GEOLOCATION, 156 }) 157 + context.displayName = 'GeolocationContext' 158 159 export function Provider({children}: {children: React.ReactNode}) { 160 const [geolocation, setGeolocation] = React.useState(() => {
+1
src/state/global-gesture-events/index.tsx
··· 25 register: () => {}, 26 unregister: () => {}, 27 }) 28 29 export function GlobalGestureEventsProvider({ 30 children,
··· 25 register: () => {}, 26 unregister: () => {}, 27 }) 28 + Context.displayName = 'GlobalGestureEventsContext' 29 30 export function GlobalGestureEventsProvider({ 31 children,
+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
··· 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
··· 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
··· 26 export * from '#/state/messages/convo/util' 27 28 const ChatContext = React.createContext<ConvoState | null>(null) 29 30 export function useConvo() { 31 const ctx = useContext(ChatContext)
··· 26 export * from '#/state/messages/convo/util' 27 28 const ChatContext = React.createContext<ConvoState | null>(null) 29 + ChatContext.displayName = 'ChatContext' 30 31 export function useConvo() { 32 const ctx = useContext(ChatContext)
+1
src/state/messages/current-convo-id.tsx
··· 7 currentConvoId: undefined, 8 setCurrentConvoId: () => {}, 9 }) 10 11 export function useCurrentConvoId() { 12 const ctx = React.useContext(CurrentConvoIdContext)
··· 7 currentConvoId: undefined, 8 setCurrentConvoId: () => {}, 9 }) 10 + CurrentConvoIdContext.displayName = 'CurrentConvoIdContext' 11 12 export function useCurrentConvoId() { 13 const ctx = React.useContext(CurrentConvoIdContext)
+1
src/state/messages/events/index.tsx
··· 7 const MessagesEventBusContext = React.createContext<MessagesEventBus | null>( 8 null, 9 ) 10 11 export function useMessagesEventBus() { 12 const ctx = React.useContext(MessagesEventBusContext)
··· 7 const MessagesEventBusContext = React.createContext<MessagesEventBus | null>( 8 null, 9 ) 10 + MessagesEventBusContext.displayName = 'MessagesEventBusContext' 11 12 export function useMessagesEventBus() { 13 const ctx = React.useContext(MessagesEventBusContext)
+1
src/state/messages/message-drafts.tsx
··· 6 state: State 7 dispatch: React.Dispatch<Actions> 8 } | null>(null) 9 10 function useMessageDraftsContext() { 11 const ctx = React.useContext(MessageDraftsContext)
··· 6 state: State 7 dispatch: React.Dispatch<Actions> 8 } | null>(null) 9 + MessageDraftsContext.displayName = 'MessageDraftsContext' 10 11 function useMessageDraftsContext() { 12 const ctx = React.useContext(MessageDraftsContext)
+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
··· 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
··· 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
··· 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
··· 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/hidden-posts.tsx
··· 14 const stateContext = React.createContext<StateContext>( 15 persisted.defaults.hiddenPosts, 16 ) 17 const apiContext = React.createContext<ApiContext>({ 18 hidePost: () => {}, 19 unhidePost: () => {}, 20 }) 21 22 export function Provider({children}: React.PropsWithChildren<{}>) { 23 const [state, setState] = React.useState(persisted.get('hiddenPosts'))
··· 14 const stateContext = React.createContext<StateContext>( 15 persisted.defaults.hiddenPosts, 16 ) 17 + stateContext.displayName = 'HiddenPostsStateContext' 18 const apiContext = React.createContext<ApiContext>({ 19 hidePost: () => {}, 20 unhidePost: () => {}, 21 }) 22 + apiContext.displayName = 'HiddenPostsApiContext' 23 24 export function Provider({children}: React.PropsWithChildren<{}>) { 25 const [state, setState] = React.useState(persisted.get('hiddenPosts'))
+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
··· 8 const stateContext = React.createContext<StateContext>( 9 persisted.defaults.kawaii, 10 ) 11 12 export function Provider({children}: React.PropsWithChildren<{}>) { 13 const [state, setState] = React.useState(persisted.get('kawaii'))
··· 8 const stateContext = React.createContext<StateContext>( 9 persisted.defaults.kawaii, 10 ) 11 + stateContext.displayName = 'KawaiiStateContext' 12 13 export function Provider({children}: React.PropsWithChildren<{}>) { 14 const [state, setState] = React.useState(persisted.get('kawaii'))
+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
··· 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
··· 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
··· 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
··· 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
··· 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
··· 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
··· 62 accepted: ChatBskyConvoDefs.ConvoView[] 63 request: ChatBskyConvoDefs.ConvoView[] 64 } | null>(null) 65 66 export function useListConvos() { 67 const ctx = useContext(ListConvosContext)
··· 62 accepted: ChatBskyConvoDefs.ConvoView[] 63 request: ChatBskyConvoDefs.ConvoView[] 64 } | null>(null) 65 + ListConvosContext.displayName = 'ListConvosContext' 66 67 export function useListConvos() { 68 const ctx = useContext(ListConvosContext)
+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
··· 16 const TrendingContext = createContext<TrendingContext>({ 17 enabled: false, 18 }) 19 20 const LiveNowContext = createContext<LiveNowContext | null>(null) 21 22 export function Provider({children}: {children: React.ReactNode}) { 23 const langPrefs = useLanguagePrefs()
··· 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
··· 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
··· 15 colorMode: 'system', 16 darkTheme: 'dark', 17 }) 18 const setContext = React.createContext<SetContext>({} as SetContext) 19 20 export function Provider({children}: React.PropsWithChildren<{}>) { 21 const [colorMode, setColorMode] = React.useState(persisted.get('colorMode'))
··· 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
··· 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
··· 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
··· 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
··· 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
··· 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
··· 29 const stateContext = React.createContext<StateContext>( 30 compute(persisted.defaults.onboarding), 31 ) 32 const dispatchContext = React.createContext<DispatchContext>((_: Action) => {}) 33 34 function reducer(state: StateContext, action: Action): StateContext { 35 switch (action.type) {
··· 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
··· 10 progress: 0, 11 status: 'idle', 12 }) 13 14 export function Provider() {} 15
··· 10 progress: 0, 11 status: 'idle', 12 }) 13 + PostProgressContext.displayName = 'PostProgressContext' 14 15 export function Provider() {} 16
+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
··· 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
··· 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
··· 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
··· 3 type StateContext = number 4 5 const stateContext = React.createContext<StateContext>(0) 6 7 export function Provider({children}: React.PropsWithChildren<{}>) { 8 const [tick, setTick] = React.useState(Date.now())
··· 3 type StateContext = number 4 5 const stateContext = React.createContext<StateContext>(0) 6 + stateContext.displayName = 'TickEveryMinuteContext' 7 8 export function Provider({children}: React.PropsWithChildren<{}>) { 9 const [tick, setTick] = React.useState(Date.now())
+2
src/state/threadgate-hidden-replies.tsx
··· 14 uris: new Set(), 15 recentlyUnhiddenUris: new Set(), 16 }) 17 18 const ApiContext = React.createContext<ApiContext>({ 19 addHiddenReplyUri: () => {}, 20 removeHiddenReplyUri: () => {}, 21 }) 22 23 export function Provider({children}: {children: React.ReactNode}) { 24 const [uris, setHiddenReplyUris] = React.useState<Set<string>>(new Set())
··· 14 uris: new Set(), 15 recentlyUnhiddenUris: new Set(), 16 }) 17 + StateContext.displayName = 'ThreadgateHiddenRepliesStateContext' 18 19 const ApiContext = React.createContext<ApiContext>({ 20 addHiddenReplyUri: () => {}, 21 removeHiddenReplyUri: () => {}, 22 }) 23 + ApiContext.displayName = 'ThreadgateHiddenRepliesApiContext' 24 25 export function Provider({children}: {children: React.ReactNode}) { 26 const [uris, setHiddenReplyUris] = React.useState<Set<string>>(new Set())
+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