Revert "run linter"

This reverts commit 1512b5cf68.
zio/stable
Samuel Newman 2024-03-13 01:55:14 +00:00
parent 1512b5cf68
commit 125ef1c756
465 changed files with 3711 additions and 4133 deletions

View File

@ -1,54 +1,54 @@
import 'react-native-url-polyfill/auto' import 'react-native-url-polyfill/auto'
import 'lib/sentry' // must be near top import 'lib/sentry' // must be near top
import React, {useState, useEffect} from 'react'
import {RootSiblingParent} from 'react-native-root-siblings'
import * as SplashScreen from 'expo-splash-screen'
import {GestureHandlerRootView} from 'react-native-gesture-handler'
import {QueryClientProvider} from '@tanstack/react-query'
import {
SafeAreaProvider,
initialWindowMetrics,
} from 'react-native-safe-area-context'
import 'view/icons' import 'view/icons'
import {msg} from '@lingui/macro' import {ThemeProvider as Alf} from '#/alf'
import {useLingui} from '@lingui/react' import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
import {QueryClientProvider} from '@tanstack/react-query' import {init as initPersistedState} from '#/state/persisted'
import * as SplashScreen from 'expo-splash-screen' import {listenSessionDropped} from './state/events'
import {StatusBar} from 'expo-status-bar'
import {useIntentHandler} from 'lib/hooks/useIntentHandler'
import * as notifications from 'lib/notifications/notifications'
import {queryClient} from 'lib/react-query'
import {s} from 'lib/styles'
import {ThemeProvider} from 'lib/ThemeContext' import {ThemeProvider} from 'lib/ThemeContext'
import {isAndroid} from 'platform/detection' import {s} from 'lib/styles'
import React, {useEffect, useState} from 'react' import {Shell} from 'view/shell'
import {GestureHandlerRootView} from 'react-native-gesture-handler' import * as notifications from 'lib/notifications/notifications'
import {RootSiblingParent} from 'react-native-root-siblings' import * as Toast from 'view/com/util/Toast'
import { import {queryClient} from 'lib/react-query'
initialWindowMetrics, import {TestCtrls} from 'view/com/testing/TestCtrls'
SafeAreaProvider, import {Provider as ShellStateProvider} from 'state/shell'
} from 'react-native-safe-area-context'
import {Provider as DialogStateProvider} from 'state/dialogs'
import {Provider as InvitesStateProvider} from 'state/invites'
import {Provider as LightboxStateProvider} from 'state/lightbox'
import {Provider as ModalStateProvider} from 'state/modals' import {Provider as ModalStateProvider} from 'state/modals'
import {Provider as DialogStateProvider} from 'state/dialogs'
import {Provider as LightboxStateProvider} from 'state/lightbox'
import {Provider as MutedThreadsProvider} from 'state/muted-threads' import {Provider as MutedThreadsProvider} from 'state/muted-threads'
import {Provider as InvitesStateProvider} from 'state/invites'
import {Provider as PrefsStateProvider} from 'state/preferences' import {Provider as PrefsStateProvider} from 'state/preferences'
import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread' import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out'
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed'
import I18nProvider from './locale/i18nProvider'
import { import {
Provider as SessionProvider, Provider as SessionProvider,
useSession, useSession,
useSessionApi, useSessionApi,
} from 'state/session' } from 'state/session'
import {Provider as ShellStateProvider} from 'state/shell' import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread'
import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out' import * as persisted from '#/state/persisted'
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed' import {Splash} from '#/Splash'
import {TestCtrls} from 'view/com/testing/TestCtrls'
import * as Toast from 'view/com/util/Toast'
import {Shell} from 'view/shell'
import {ThemeProvider as Alf} from '#/alf'
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
import {Provider as PortalProvider} from '#/components/Portal' import {Provider as PortalProvider} from '#/components/Portal'
import {Provider as StatsigProvider} from '#/lib/statsig/statsig' import {Provider as StatsigProvider} from '#/lib/statsig/statsig'
import {Splash} from '#/Splash' import {msg} from '@lingui/macro'
import {init as initPersistedState} from '#/state/persisted' import {useLingui} from '@lingui/react'
import * as persisted from '#/state/persisted' import {useIntentHandler} from 'lib/hooks/useIntentHandler'
import {StatusBar} from 'expo-status-bar'
import I18nProvider from './locale/i18nProvider' import {isAndroid} from 'platform/detection'
import {listenSessionDropped} from './state/events'
SplashScreen.preventAutoHideAsync() SplashScreen.preventAutoHideAsync()

View File

@ -1,39 +1,39 @@
import 'lib/sentry' // must be near top import 'lib/sentry' // must be near top
import React, {useState, useEffect} from 'react'
import {QueryClientProvider} from '@tanstack/react-query'
import {SafeAreaProvider} from 'react-native-safe-area-context'
import {RootSiblingParent} from 'react-native-root-siblings'
import 'view/icons' import 'view/icons'
import {QueryClientProvider} from '@tanstack/react-query' import {ThemeProvider as Alf} from '#/alf'
import {useIntentHandler} from 'lib/hooks/useIntentHandler' import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
import {queryClient} from 'lib/react-query' import {init as initPersistedState} from '#/state/persisted'
import {Shell} from 'view/shell/index'
import {ToastContainer} from 'view/com/util/Toast.web'
import {ThemeProvider} from 'lib/ThemeContext' import {ThemeProvider} from 'lib/ThemeContext'
import React, {useEffect, useState} from 'react' import {queryClient} from 'lib/react-query'
import {RootSiblingParent} from 'react-native-root-siblings' import {Provider as ShellStateProvider} from 'state/shell'
import {SafeAreaProvider} from 'react-native-safe-area-context'
import {Provider as DialogStateProvider} from 'state/dialogs'
import {Provider as InvitesStateProvider} from 'state/invites'
import {Provider as LightboxStateProvider} from 'state/lightbox'
import {Provider as ModalStateProvider} from 'state/modals' import {Provider as ModalStateProvider} from 'state/modals'
import {Provider as DialogStateProvider} from 'state/dialogs'
import {Provider as LightboxStateProvider} from 'state/lightbox'
import {Provider as MutedThreadsProvider} from 'state/muted-threads' import {Provider as MutedThreadsProvider} from 'state/muted-threads'
import {Provider as InvitesStateProvider} from 'state/invites'
import {Provider as PrefsStateProvider} from 'state/preferences' import {Provider as PrefsStateProvider} from 'state/preferences'
import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread' import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out'
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed'
import I18nProvider from './locale/i18nProvider'
import { import {
Provider as SessionProvider, Provider as SessionProvider,
useSession, useSession,
useSessionApi, useSessionApi,
} from 'state/session' } from 'state/session'
import {Provider as ShellStateProvider} from 'state/shell' import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread'
import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out' import * as persisted from '#/state/persisted'
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed'
import {ToastContainer} from 'view/com/util/Toast.web'
import {Shell} from 'view/shell/index'
import {ThemeProvider as Alf} from '#/alf'
import {useColorModeTheme} from '#/alf/util/useColorModeTheme'
import {Provider as PortalProvider} from '#/components/Portal' import {Provider as PortalProvider} from '#/components/Portal'
import {Provider as StatsigProvider} from '#/lib/statsig/statsig' import {Provider as StatsigProvider} from '#/lib/statsig/statsig'
import {init as initPersistedState} from '#/state/persisted' import {useIntentHandler} from 'lib/hooks/useIntentHandler'
import * as persisted from '#/state/persisted'
import I18nProvider from './locale/i18nProvider'
function InnerApp() { function InnerApp() {
const {isInitialLoad, currentAccount} = useSession() const {isInitialLoad, currentAccount} = useSession()

View File

@ -1,85 +1,84 @@
import {i18n, MessageDescriptor} from '@lingui/core' import * as React from 'react'
import {msg} from '@lingui/macro' import {
NavigationContainer,
createNavigationContainerRef,
CommonActions,
StackActions,
DefaultTheme,
DarkTheme,
} from '@react-navigation/native'
import { import {
BottomTabBarProps, BottomTabBarProps,
createBottomTabNavigator, createBottomTabNavigator,
} from '@react-navigation/bottom-tabs' } from '@react-navigation/bottom-tabs'
import { import {
CommonActions,
createNavigationContainerRef,
DarkTheme,
DefaultTheme,
NavigationContainer,
StackActions,
} from '@react-navigation/native'
import {timeout} from 'lib/async/timeout'
import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle'
import {usePalette} from 'lib/hooks/usePalette'
import {buildStateObject} from 'lib/routes/helpers'
import {
AllNavigatorParams,
BottomTabNavigatorParams,
FeedsTabNavigatorParams,
FlatNavigatorParams,
HomeTabNavigatorParams, HomeTabNavigatorParams,
MyProfileTabNavigatorParams,
NotificationsTabNavigatorParams,
SearchTabNavigatorParams, SearchTabNavigatorParams,
FeedsTabNavigatorParams,
NotificationsTabNavigatorParams,
FlatNavigatorParams,
AllNavigatorParams,
MyProfileTabNavigatorParams,
BottomTabNavigatorParams,
} from 'lib/routes/types' } from 'lib/routes/types'
import {RouteParams, State} from 'lib/routes/types' import {BottomBar} from './view/shell/bottom-bar/BottomBar'
import {bskyTitle} from 'lib/strings/headings' import {buildStateObject} from 'lib/routes/helpers'
import {State, RouteParams} from 'lib/routes/types'
import {isAndroid, isNative} from 'platform/detection' import {isAndroid, isNative} from 'platform/detection'
import * as React from 'react' import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle'
import {JSX} from 'react/jsx-runtime'
import {AppPasswords} from 'view/screens/AppPasswords'
import {ModerationBlockedAccounts} from 'view/screens/ModerationBlockedAccounts'
import {ModerationMutedAccounts} from 'view/screens/ModerationMutedAccounts'
import {PreferencesFollowingFeed} from 'view/screens/PreferencesFollowingFeed'
import {PreferencesThreads} from 'view/screens/PreferencesThreads'
import {SavedFeeds} from 'view/screens/SavedFeeds'
import HashtagScreen from '#/screens/Hashtag'
import {PreferencesExternalEmbeds} from '#/view/screens/PreferencesExternalEmbeds'
import {init as initAnalytics} from './lib/analytics/analytics'
import {useWebScrollRestoration} from './lib/hooks/useWebScrollRestoration'
import {logEvent} from './lib/statsig/statsig'
import {router} from './routes' import {router} from './routes'
import {useModalControls} from './state/modals' import {usePalette} from 'lib/hooks/usePalette'
import {bskyTitle} from 'lib/strings/headings'
import {JSX} from 'react/jsx-runtime'
import {timeout} from 'lib/async/timeout'
import {useUnreadNotifications} from './state/queries/notifications/unread' import {useUnreadNotifications} from './state/queries/notifications/unread'
import {useSession} from './state/session' import {useSession} from './state/session'
import {useModalControls} from './state/modals'
import { import {
setEmailConfirmationRequested,
shouldRequestEmailConfirmation, shouldRequestEmailConfirmation,
setEmailConfirmationRequested,
} from './state/shell/reminders' } from './state/shell/reminders'
import {CommunityGuidelinesScreen} from './view/screens/CommunityGuidelines' import {init as initAnalytics} from './lib/analytics/analytics'
import {CopyrightPolicyScreen} from './view/screens/CopyrightPolicy' import {useWebScrollRestoration} from './lib/hooks/useWebScrollRestoration'
import {FeedsScreen} from './view/screens/Feeds'
import {HomeScreen} from './view/screens/Home' import {HomeScreen} from './view/screens/Home'
import {LanguageSettingsScreen} from './view/screens/LanguageSettings' import {SearchScreen} from './view/screens/Search'
import {FeedsScreen} from './view/screens/Feeds'
import {NotificationsScreen} from './view/screens/Notifications'
import {ListsScreen} from './view/screens/Lists' import {ListsScreen} from './view/screens/Lists'
import {LogScreen} from './view/screens/Log'
import {ModerationScreen} from './view/screens/Moderation' import {ModerationScreen} from './view/screens/Moderation'
import {ModerationModlistsScreen} from './view/screens/ModerationModlists' import {ModerationModlistsScreen} from './view/screens/ModerationModlists'
import {NotFoundScreen} from './view/screens/NotFound' import {NotFoundScreen} from './view/screens/NotFound'
import {NotificationsScreen} from './view/screens/Notifications' import {SettingsScreen} from './view/screens/Settings'
import {PostLikedByScreen} from './view/screens/PostLikedBy' import {LanguageSettingsScreen} from './view/screens/LanguageSettings'
import {PostRepostedByScreen} from './view/screens/PostRepostedBy'
import {PostThreadScreen} from './view/screens/PostThread'
import {PrivacyPolicyScreen} from './view/screens/PrivacyPolicy'
import {ProfileScreen} from './view/screens/Profile' import {ProfileScreen} from './view/screens/Profile'
import {ProfileFeedScreen} from './view/screens/ProfileFeed'
import {ProfileFeedLikedByScreen} from './view/screens/ProfileFeedLikedBy'
import {ProfileFollowersScreen} from './view/screens/ProfileFollowers' import {ProfileFollowersScreen} from './view/screens/ProfileFollowers'
import {ProfileFollowsScreen} from './view/screens/ProfileFollows' import {ProfileFollowsScreen} from './view/screens/ProfileFollows'
import {ProfileFeedScreen} from './view/screens/ProfileFeed'
import {ProfileFeedLikedByScreen} from './view/screens/ProfileFeedLikedBy'
import {ProfileListScreen} from './view/screens/ProfileList' import {ProfileListScreen} from './view/screens/ProfileList'
import {SearchScreen} from './view/screens/Search' import {PostThreadScreen} from './view/screens/PostThread'
import {SettingsScreen} from './view/screens/Settings' import {PostLikedByScreen} from './view/screens/PostLikedBy'
import {PostRepostedByScreen} from './view/screens/PostRepostedBy'
import {Storybook} from './view/screens/Storybook' import {Storybook} from './view/screens/Storybook'
import {LogScreen} from './view/screens/Log'
import {SupportScreen} from './view/screens/Support' import {SupportScreen} from './view/screens/Support'
import {PrivacyPolicyScreen} from './view/screens/PrivacyPolicy'
import {TermsOfServiceScreen} from './view/screens/TermsOfService' import {TermsOfServiceScreen} from './view/screens/TermsOfService'
import {BottomBar} from './view/shell/bottom-bar/BottomBar' import {CommunityGuidelinesScreen} from './view/screens/CommunityGuidelines'
import {CopyrightPolicyScreen} from './view/screens/CopyrightPolicy'
import {AppPasswords} from 'view/screens/AppPasswords'
import {ModerationMutedAccounts} from 'view/screens/ModerationMutedAccounts'
import {ModerationBlockedAccounts} from 'view/screens/ModerationBlockedAccounts'
import {SavedFeeds} from 'view/screens/SavedFeeds'
import {PreferencesFollowingFeed} from 'view/screens/PreferencesFollowingFeed'
import {PreferencesThreads} from 'view/screens/PreferencesThreads'
import {PreferencesExternalEmbeds} from '#/view/screens/PreferencesExternalEmbeds'
import {createNativeStackNavigatorWithAuth} from './view/shell/createNativeStackNavigatorWithAuth' import {createNativeStackNavigatorWithAuth} from './view/shell/createNativeStackNavigatorWithAuth'
import {msg} from '@lingui/macro'
import {i18n, MessageDescriptor} from '@lingui/core'
import HashtagScreen from '#/screens/Hashtag'
import {logEvent} from './lib/statsig/statsig'
const navigationRef = createNavigationContainerRef<AllNavigatorParams>() const navigationRef = createNavigationContainerRef<AllNavigatorParams>()
@ -671,11 +670,11 @@ function logModuleInitTime() {
} }
export { export {
FlatNavigator,
handleLink,
navigate, navigate,
reset,
resetToTab, resetToTab,
RoutesContainer, reset,
handleLink,
TabsNavigator, TabsNavigator,
FlatNavigator,
RoutesContainer,
} }

View File

@ -1,22 +1,22 @@
import MaskedView from '@react-native-masked-view/masked-view'
import {Image} from 'expo-image'
import * as SplashScreen from 'expo-splash-screen'
import React, {useCallback, useEffect} from 'react' import React, {useCallback, useEffect} from 'react'
import { import {
AccessibilityInfo,
Image as RNImage,
StyleSheet,
useColorScheme,
View, View,
StyleSheet,
Image as RNImage,
AccessibilityInfo,
useColorScheme,
} from 'react-native' } from 'react-native'
import * as SplashScreen from 'expo-splash-screen'
import {Image} from 'expo-image'
import Animated, { import Animated, {
Easing,
interpolate, interpolate,
runOnJS, runOnJS,
useAnimatedStyle, useAnimatedStyle,
useSharedValue, useSharedValue,
withTiming, withTiming,
Easing,
} from 'react-native-reanimated' } from 'react-native-reanimated'
import MaskedView from '@react-native-masked-view/masked-view'
import {useSafeAreaInsets} from 'react-native-safe-area-context' import {useSafeAreaInsets} from 'react-native-safe-area-context'
import Svg, {Path, SvgProps} from 'react-native-svg' import Svg, {Path, SvgProps} from 'react-native-svg'

View File

@ -1,5 +1,5 @@
import {web, native} from '#/alf/util/platform'
import * as tokens from '#/alf/tokens' import * as tokens from '#/alf/tokens'
import {native, web} from '#/alf/util/platform'
export const atoms = { export const atoms = {
/* /*

View File

@ -1,13 +1,12 @@
import React from 'react' import React from 'react'
import {Dimensions} from 'react-native' import {Dimensions} from 'react-native'
import * as themes from '#/alf/themes' import * as themes from '#/alf/themes'
export {atoms} from '#/alf/atoms'
export * as tokens from '#/alf/tokens'
export * from '#/alf/types' export * from '#/alf/types'
export * from '#/alf/util/flatten' export * as tokens from '#/alf/tokens'
export {atoms} from '#/alf/atoms'
export * from '#/alf/util/platform' export * from '#/alf/util/platform'
export * from '#/alf/util/flatten'
type BreakpointName = keyof typeof breakpoints type BreakpointName = keyof typeof breakpoints

View File

@ -1,6 +1,6 @@
import {atoms} from '#/alf/atoms'
import * as tokens from '#/alf/tokens' import * as tokens from '#/alf/tokens'
import type {Mutable} from '#/alf/types' import type {Mutable} from '#/alf/types'
import {atoms} from '#/alf/atoms'
import {BLUE_HUE, GREEN_HUE, RED_HUE} from '#/alf/util/colorGeneration' import {BLUE_HUE, GREEN_HUE, RED_HUE} from '#/alf/util/colorGeneration'
export type ThemeName = 'light' | 'dim' | 'dark' export type ThemeName = 'light' | 'dim' | 'dark'

View File

@ -1,8 +1,8 @@
import { import {
BLUE_HUE, BLUE_HUE,
generateScale,
GREEN_HUE,
RED_HUE, RED_HUE,
GREEN_HUE,
generateScale,
} from '#/alf/util/colorGeneration' } from '#/alf/util/colorGeneration'
export const scale = generateScale(6, 100) export const scale = generateScale(6, 100)

View File

@ -1,4 +1,4 @@
import {StyleProp, TextStyle, ViewStyle} from 'react-native' import {StyleProp, ViewStyle, TextStyle} from 'react-native'
type LiteralToCommon<T extends PropertyKey> = T extends number type LiteralToCommon<T extends PropertyKey> = T extends number
? number ? number

View File

@ -1,10 +1,10 @@
import * as SystemUI from 'expo-system-ui'
import {isWeb} from 'platform/detection'
import React from 'react' import React from 'react'
import {ColorSchemeName, useColorScheme} from 'react-native' import {ColorSchemeName, useColorScheme} from 'react-native'
import {useThemePrefs} from 'state/shell'
import {dark, dim, light, ThemeName} from '#/alf/themes' import {useThemePrefs} from 'state/shell'
import {isWeb} from 'platform/detection'
import {ThemeName, light, dark, dim} from '#/alf/themes'
import * as SystemUI from 'expo-system-ui'
export function useColorModeTheme(): ThemeName { export function useColorModeTheme(): ThemeName {
const colorScheme = useColorScheme() const colorScheme = useColorScheme()

View File

@ -1,19 +1,19 @@
import React from 'react' import React from 'react'
import { import {
AccessibilityProps,
Pressable, Pressable,
PressableProps,
StyleProp,
StyleSheet,
Text, Text,
PressableProps,
TextProps, TextProps,
TextStyle,
View,
ViewStyle, ViewStyle,
AccessibilityProps,
View,
TextStyle,
StyleSheet,
StyleProp,
} from 'react-native' } from 'react-native'
import LinearGradient from 'react-native-linear-gradient' import LinearGradient from 'react-native-linear-gradient'
import {android, atoms as a, flatten, tokens, useTheme} from '#/alf' import {useTheme, atoms as a, tokens, android, flatten} from '#/alf'
import {Props as SVGIconProps} from '#/components/icons/common' import {Props as SVGIconProps} from '#/components/icons/common'
export type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'gradient' export type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'gradient'

View File

@ -1,11 +1,11 @@
import React from 'react' import React from 'react'
import {useDialogStateContext} from '#/state/dialogs'
import { import {
DialogContextProps, DialogContextProps,
DialogControlRefProps, DialogControlRefProps,
DialogOuterProps, DialogOuterProps,
} from '#/components/Dialog/types' } from '#/components/Dialog/types'
import {useDialogStateContext} from '#/state/dialogs'
export const Context = React.createContext<DialogContextProps>({ export const Context = React.createContext<DialogContextProps>({
close: () => {}, close: () => {},

View File

@ -1,3 +1,5 @@
import React, {useImperativeHandle} from 'react'
import {View, Dimensions, Keyboard, Pressable} from 'react-native'
import BottomSheet, { import BottomSheet, {
BottomSheetBackdropProps, BottomSheetBackdropProps,
BottomSheetScrollView, BottomSheetScrollView,
@ -6,24 +8,23 @@ import BottomSheet, {
useBottomSheet, useBottomSheet,
WINDOW_HEIGHT, WINDOW_HEIGHT,
} from '@gorhom/bottom-sheet' } from '@gorhom/bottom-sheet'
import React, {useImperativeHandle} from 'react'
import {Dimensions, Keyboard, Pressable, View} from 'react-native'
import Animated, {useAnimatedStyle} from 'react-native-reanimated'
import {useSafeAreaInsets} from 'react-native-safe-area-context' import {useSafeAreaInsets} from 'react-native-safe-area-context'
import Animated, {useAnimatedStyle} from 'react-native-reanimated'
import {atoms as a, flatten, useTheme} from '#/alf' import {useTheme, atoms as a, flatten} from '#/alf'
import {Context} from '#/components/Dialog/context'
import {
DialogControlProps,
DialogInnerProps,
DialogOuterProps,
} from '#/components/Dialog/types'
import {createInput} from '#/components/forms/TextField'
import {Portal} from '#/components/Portal' import {Portal} from '#/components/Portal'
import {createInput} from '#/components/forms/TextField'
import {logger} from '#/logger' import {logger} from '#/logger'
import {useDialogStateControlContext} from '#/state/dialogs' import {useDialogStateControlContext} from '#/state/dialogs'
export {useDialogContext, useDialogControl} from '#/components/Dialog/context' import {
DialogOuterProps,
DialogControlProps,
DialogInnerProps,
} from '#/components/Dialog/types'
import {Context} from '#/components/Dialog/context'
export {useDialogControl, useDialogContext} from '#/components/Dialog/context'
export * from '#/components/Dialog/types' export * from '#/components/Dialog/types'
// @ts-ignore // @ts-ignore
export const Input = createInput(BottomSheetTextInput) export const Input = createInput(BottomSheetTextInput)

View File

@ -1,19 +1,20 @@
import React, {useImperativeHandle} from 'react'
import {View, TouchableWithoutFeedback} from 'react-native'
import {FocusScope} from '@tamagui/focus-scope'
import Animated, {FadeInDown, FadeIn} from 'react-native-reanimated'
import {msg} from '@lingui/macro' import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {FocusScope} from '@tamagui/focus-scope'
import React, {useImperativeHandle} from 'react'
import {TouchableWithoutFeedback, View} from 'react-native'
import Animated, {FadeIn, FadeInDown} from 'react-native-reanimated'
import {atoms as a, flatten, useBreakpoints, useTheme, web} from '#/alf' import {useTheme, atoms as a, useBreakpoints, web, flatten} from '#/alf'
import {Button, ButtonIcon} from '#/components/Button'
import {Context} from '#/components/Dialog/context'
import {DialogInnerProps, DialogOuterProps} from '#/components/Dialog/types'
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
import {Portal} from '#/components/Portal' import {Portal} from '#/components/Portal'
import {DialogOuterProps, DialogInnerProps} from '#/components/Dialog/types'
import {Context} from '#/components/Dialog/context'
import {Button, ButtonIcon} from '#/components/Button'
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
import {useDialogStateControlContext} from '#/state/dialogs' import {useDialogStateControlContext} from '#/state/dialogs'
export {useDialogContext, useDialogControl} from '#/components/Dialog/context' export {useDialogControl, useDialogContext} from '#/components/Dialog/context'
export * from '#/components/Dialog/types' export * from '#/components/Dialog/types'
export {Input} from '#/components/forms/TextField' export {Input} from '#/components/forms/TextField'

View File

@ -1,6 +1,6 @@
import {BottomSheetProps} from '@gorhom/bottom-sheet'
import React from 'react' import React from 'react'
import type {AccessibilityProps} from 'react-native' import type {AccessibilityProps} from 'react-native'
import {BottomSheetProps} from '@gorhom/bottom-sheet'
import {ViewStyleProp} from '#/alf' import {ViewStyleProp} from '#/alf'

View File

@ -1,7 +1,6 @@
import React from 'react' import React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {atoms as a, useTheme, ViewStyleProp, flatten} from '#/alf'
import {atoms as a, flatten, useTheme, ViewStyleProp} from '#/alf'
export function Divider({style}: ViewStyleProp) { export function Divider({style}: ViewStyleProp) {
const t = useTheme() const t = useTheme()

View File

@ -2,14 +2,14 @@ import React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import { import {
atoms as a,
flatten,
TextStyleProp,
useTheme, useTheme,
atoms as a,
ViewStyleProp, ViewStyleProp,
TextStyleProp,
flatten,
} from '#/alf' } from '#/alf'
import {Props} from '#/components/icons/common'
import {Growth_Stroke2_Corner0_Rounded as Growth} from '#/components/icons/Growth' import {Growth_Stroke2_Corner0_Rounded as Growth} from '#/components/icons/Growth'
import {Props} from '#/components/icons/common'
export function IconCircle({ export function IconCircle({
icon: Icon, icon: Icon,

View File

@ -1,23 +1,23 @@
import {sanitizeUrl} from '@braintree/sanitize-url'
import {StackActions, useLinkProps} from '@react-navigation/native'
import {useNavigationDeduped} from 'lib/hooks/useNavigationDeduped'
import React from 'react' import React from 'react'
import {GestureResponderEvent} from 'react-native' import {GestureResponderEvent} from 'react-native'
import {useOpenLink} from 'state/preferences/in-app-browser' import {useLinkProps, StackActions} from '@react-navigation/native'
import {sanitizeUrl} from '@braintree/sanitize-url'
import {atoms as a, flatten, TextStyleProp, useTheme, web} from '#/alf'
import {Button, ButtonProps} from '#/components/Button'
import {useInteractionState} from '#/components/hooks/useInteractionState' import {useInteractionState} from '#/components/hooks/useInteractionState'
import {Text, TextProps} from '#/components/Typography' import {isWeb} from '#/platform/detection'
import {useTheme, web, flatten, TextStyleProp, atoms as a} from '#/alf'
import {Button, ButtonProps} from '#/components/Button'
import {AllNavigatorParams} from '#/lib/routes/types' import {AllNavigatorParams} from '#/lib/routes/types'
import { import {
convertBskyAppUrlIfNeeded, convertBskyAppUrlIfNeeded,
isExternalUrl, isExternalUrl,
linkRequiresWarning, linkRequiresWarning,
} from '#/lib/strings/url-helpers' } from '#/lib/strings/url-helpers'
import {isWeb} from '#/platform/detection'
import {router} from '#/routes'
import {useModalControls} from '#/state/modals' import {useModalControls} from '#/state/modals'
import {router} from '#/routes'
import {Text, TextProps} from '#/components/Typography'
import {useOpenLink} from 'state/preferences/in-app-browser'
import {useNavigationDeduped} from 'lib/hooks/useNavigationDeduped'
/** /**
* Only available within a `Link`, since that inherits from `Button`. * Only available within a `Link`, since that inherits from `Button`.

View File

@ -1,16 +1,15 @@
import {Trans} from '@lingui/macro'
import {StackActions} from '@react-navigation/native'
import {useNavigationDeduped} from 'lib/hooks/useNavigationDeduped'
import {cleanError} from 'lib/strings/errors'
import React from 'react' import React from 'react'
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
import {View} from 'react-native' import {View} from 'react-native'
import {CenteredView} from 'view/com/util/Views' import {CenteredView} from 'view/com/util/Views'
import {atoms as a, useBreakpoints, useTheme} from '#/alf'
import {Button} from '#/components/Button'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {Trans} from '@lingui/macro'
import {cleanError} from 'lib/strings/errors'
import {Button} from '#/components/Button'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import {StackActions} from '@react-navigation/native'
import {router} from '#/routes' import {router} from '#/routes'
import {useNavigationDeduped} from 'lib/hooks/useNavigationDeduped'
export function ListFooter({ export function ListFooter({
isFetching, isFetching,

View File

@ -1,13 +1,13 @@
import React from 'react' import React from 'react'
import Animated, { import Animated, {
Easing, Easing,
useAnimatedStyle,
useSharedValue, useSharedValue,
useAnimatedStyle,
withRepeat, withRepeat,
withTiming, withTiming,
} from 'react-native-reanimated' } from 'react-native-reanimated'
import {atoms as a, flatten, useTheme} from '#/alf' import {atoms as a, useTheme, flatten} from '#/alf'
import {Props, useCommonSVGProps} from '#/components/icons/common' import {Props, useCommonSVGProps} from '#/components/icons/common'
import {Loader_Stroke2_Corner0_Rounded as Icon} from '#/components/icons/Loader' import {Loader_Stroke2_Corner0_Rounded as Icon} from '#/components/icons/Loader'

View File

@ -1,24 +1,25 @@
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {isNative} from 'platform/detection'
import React from 'react' import React from 'react'
import {View, Pressable, ViewStyle, StyleProp} from 'react-native'
import flattenReactChildren from 'react-keyed-flatten-children' import flattenReactChildren from 'react-keyed-flatten-children'
import {Pressable, StyleProp, View, ViewStyle} from 'react-native'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Button, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog' import * as Dialog from '#/components/Dialog'
import {useInteractionState} from '#/components/hooks/useInteractionState' import {useInteractionState} from '#/components/hooks/useInteractionState'
import {Text} from '#/components/Typography'
import {Context} from '#/components/Menu/context' import {Context} from '#/components/Menu/context'
import { import {
ContextType, ContextType,
GroupProps,
ItemIconProps,
ItemProps,
ItemTextProps,
TriggerProps, TriggerProps,
ItemProps,
GroupProps,
ItemTextProps,
ItemIconProps,
} from '#/components/Menu/types' } from '#/components/Menu/types'
import {Text} from '#/components/Typography' import {Button, ButtonText} from '#/components/Button'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {isNative} from 'platform/detection'
export {useDialogControl as useMenuControl} from '#/components/Dialog' export {useDialogControl as useMenuControl} from '#/components/Dialog'

View File

@ -1,23 +1,24 @@
/* eslint-disable react/prop-types */ /* eslint-disable react/prop-types */
import * as DropdownMenu from '@radix-ui/react-dropdown-menu'
import React from 'react' import React from 'react'
import {Pressable, StyleProp, View, ViewStyle} from 'react-native' import {View, Pressable, ViewStyle, StyleProp} from 'react-native'
import * as DropdownMenu from '@radix-ui/react-dropdown-menu'
import {atoms as a, flatten, useTheme, web} from '#/alf'
import * as Dialog from '#/components/Dialog' import * as Dialog from '#/components/Dialog'
import {useInteractionState} from '#/components/hooks/useInteractionState' import {useInteractionState} from '#/components/hooks/useInteractionState'
import {Context} from '#/components/Menu/context' import {atoms as a, useTheme, flatten, web} from '#/alf'
import {Text} from '#/components/Typography'
import { import {
ContextType, ContextType,
GroupProps,
ItemIconProps,
ItemProps,
ItemTextProps,
RadixPassThroughTriggerProps,
TriggerProps, TriggerProps,
ItemProps,
GroupProps,
ItemTextProps,
ItemIconProps,
RadixPassThroughTriggerProps,
} from '#/components/Menu/types' } from '#/components/Menu/types'
import {Text} from '#/components/Typography' import {Context} from '#/components/Menu/context'
export function useMenuControl(): Dialog.DialogControlProps { export function useMenuControl(): Dialog.DialogControlProps {
const id = React.useId() const id = React.useId()

View File

@ -1,13 +1,13 @@
import React from 'react' import React from 'react'
import { import {
AccessibilityProps,
GestureResponderEvent, GestureResponderEvent,
PressableProps, PressableProps,
AccessibilityProps,
} from 'react-native' } from 'react-native'
import {TextStyleProp, ViewStyleProp} from '#/alf'
import * as Dialog from '#/components/Dialog'
import {Props as SVGIconProps} from '#/components/icons/common' import {Props as SVGIconProps} from '#/components/icons/common'
import * as Dialog from '#/components/Dialog'
import {TextStyleProp, ViewStyleProp} from '#/alf'
export type ContextType = { export type ContextType = {
control: Dialog.DialogOuterProps['control'] control: Dialog.DialogOuterProps['control']

View File

@ -1,12 +1,13 @@
import React from 'react'
import {View, PressableProps} from 'react-native'
import {msg} from '@lingui/macro' import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import React from 'react'
import {PressableProps, View} from 'react-native'
import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {useTheme, atoms as a, useBreakpoints} from '#/alf'
import {Button} from '#/components/Button'
import * as Dialog from '#/components/Dialog'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import {Button} from '#/components/Button'
import * as Dialog from '#/components/Dialog'
export {useDialogControl as usePromptControl} from '#/components/Dialog' export {useDialogControl as usePromptControl} from '#/components/Dialog'

View File

@ -1,15 +1,15 @@
import {AppBskyRichtextFacet, RichText as RichTextAPI} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {toShortUrl} from 'lib/strings/url-helpers'
import React from 'react' import React from 'react'
import {RichText as RichTextAPI, AppBskyRichtextFacet} from '@atproto/api'
import {useLingui} from '@lingui/react'
import {msg} from '@lingui/macro'
import {atoms as a, flatten, native, TextStyleProp, useTheme, web} from '#/alf' import {atoms as a, TextStyleProp, flatten, useTheme, web, native} from '#/alf'
import {useInteractionState} from '#/components/hooks/useInteractionState'
import {InlineLink} from '#/components/Link' import {InlineLink} from '#/components/Link'
import {TagMenu, useTagMenuControl} from '#/components/TagMenu'
import {Text, TextProps} from '#/components/Typography' import {Text, TextProps} from '#/components/Typography'
import {toShortUrl} from 'lib/strings/url-helpers'
import {TagMenu, useTagMenuControl} from '#/components/TagMenu'
import {isNative} from '#/platform/detection' import {isNative} from '#/platform/detection'
import {useInteractionState} from '#/components/hooks/useInteractionState'
const WORD_WRAP = {wordWrap: 1} const WORD_WRAP = {wordWrap: 1}

View File

@ -1,27 +1,27 @@
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useNavigation} from '@react-navigation/native'
import React from 'react' import React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {useNavigation} from '@react-navigation/native'
import {useLingui} from '@lingui/react'
import {msg, Trans} from '@lingui/macro'
import {atoms as a, native, useTheme} from '#/alf' import {atoms as a, native, useTheme} from '#/alf'
import {Button, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog' import * as Dialog from '#/components/Dialog'
import {Divider} from '#/components/Divider'
import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2'
import {Mute_Stroke2_Corner0_Rounded as Mute} from '#/components/icons/Mute'
import {Person_Stroke2_Corner0_Rounded as Person} from '#/components/icons/Person'
import {Link} from '#/components/Link'
import {Loader} from '#/components/Loader'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import {Button, ButtonText} from '#/components/Button'
import {MagnifyingGlass2_Stroke2_Corner0_Rounded as Search} from '#/components/icons/MagnifyingGlass2'
import {Person_Stroke2_Corner0_Rounded as Person} from '#/components/icons/Person'
import {Mute_Stroke2_Corner0_Rounded as Mute} from '#/components/icons/Mute'
import {Divider} from '#/components/Divider'
import {Link} from '#/components/Link'
import {makeSearchLink} from '#/lib/routes/links' import {makeSearchLink} from '#/lib/routes/links'
import {NavigationProp} from '#/lib/routes/types' import {NavigationProp} from '#/lib/routes/types'
import {isInvalidHandle} from '#/lib/strings/handles'
import { import {
usePreferencesQuery, usePreferencesQuery,
useRemoveMutedWordMutation,
useUpsertMutedWordsMutation, useUpsertMutedWordsMutation,
useRemoveMutedWordMutation,
} from '#/state/queries/preferences' } from '#/state/queries/preferences'
import {Loader} from '#/components/Loader'
import {isInvalidHandle} from '#/lib/strings/handles'
export function useTagMenuControl() { export function useTagMenuControl() {
return Dialog.useDialogControl() return Dialog.useDialogControl()

View File

@ -1,20 +1,20 @@
import React from 'react'
import {msg} from '@lingui/macro' import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {useNavigation} from '@react-navigation/native' import {useNavigation} from '@react-navigation/native'
import React from 'react'
import {web} from '#/alf'
import * as Dialog from '#/components/Dialog'
import {NavigationProp} from '#/lib/routes/types'
import {isInvalidHandle} from '#/lib/strings/handles' import {isInvalidHandle} from '#/lib/strings/handles'
import {enforceLen} from '#/lib/strings/helpers'
import {
usePreferencesQuery,
useRemoveMutedWordMutation,
useUpsertMutedWordsMutation,
} from '#/state/queries/preferences'
import {EventStopper} from '#/view/com/util/EventStopper' import {EventStopper} from '#/view/com/util/EventStopper'
import {NativeDropdown} from '#/view/com/util/forms/NativeDropdown' import {NativeDropdown} from '#/view/com/util/forms/NativeDropdown'
import {NavigationProp} from '#/lib/routes/types'
import {
usePreferencesQuery,
useUpsertMutedWordsMutation,
useRemoveMutedWordMutation,
} from '#/state/queries/preferences'
import {enforceLen} from '#/lib/strings/helpers'
import {web} from '#/alf'
import * as Dialog from '#/components/Dialog'
export function useTagMenuControl(): Dialog.DialogControlProps { export function useTagMenuControl(): Dialog.DialogControlProps {
return { return {

View File

@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import {Text as RNText, TextProps as RNTextProps, TextStyle} from 'react-native' import {Text as RNText, TextStyle, TextProps as RNTextProps} from 'react-native'
import {UITextView} from 'react-native-ui-text-view' import {UITextView} from 'react-native-ui-text-view'
import {atoms, flatten, useTheme, web} from '#/alf' import {useTheme, atoms, web, flatten} from '#/alf'
import {isIOS, isNative} from '#/platform/detection' import {isIOS, isNative} from '#/platform/detection'
export type TextProps = RNTextProps & { export type TextProps = RNTextProps & {

View File

@ -1,36 +1,37 @@
import {AppBskyActorDefs, sanitizeMutedWordValue} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import React from 'react' import React from 'react'
import {Keyboard, View} from 'react-native' import {Keyboard, View} from 'react-native'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {AppBskyActorDefs, sanitizeMutedWordValue} from '@atproto/api'
import { import {
atoms as a, usePreferencesQuery,
native, useUpsertMutedWordsMutation,
useBreakpoints, useRemoveMutedWordMutation,
useTheme, } from '#/state/queries/preferences'
ViewStyleProp,
web,
} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog'
import {useGlobalDialogsControlContext} from '#/components/dialogs/Context'
import {Divider} from '#/components/Divider'
import * as Toggle from '#/components/forms/Toggle'
import {Hashtag_Stroke2_Corner0_Rounded as Hashtag} from '#/components/icons/Hashtag'
import {PageText_Stroke2_Corner0_Rounded as PageText} from '#/components/icons/PageText'
import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus'
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
import {Loader} from '#/components/Loader'
import * as Prompt from '#/components/Prompt'
import {Text} from '#/components/Typography'
import {logger} from '#/logger'
import {isNative} from '#/platform/detection' import {isNative} from '#/platform/detection'
import { import {
usePreferencesQuery, atoms as a,
useRemoveMutedWordMutation, useTheme,
useUpsertMutedWordsMutation, useBreakpoints,
} from '#/state/queries/preferences' ViewStyleProp,
web,
native,
} from '#/alf'
import {Text} from '#/components/Typography'
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import {PlusLarge_Stroke2_Corner0_Rounded as Plus} from '#/components/icons/Plus'
import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times'
import {Hashtag_Stroke2_Corner0_Rounded as Hashtag} from '#/components/icons/Hashtag'
import {PageText_Stroke2_Corner0_Rounded as PageText} from '#/components/icons/PageText'
import {Divider} from '#/components/Divider'
import {Loader} from '#/components/Loader'
import {logger} from '#/logger'
import * as Dialog from '#/components/Dialog'
import * as Toggle from '#/components/forms/Toggle'
import * as Prompt from '#/components/Prompt'
import {useGlobalDialogsControlContext} from '#/components/dialogs/Context'
export function MutedWordsDialog() { export function MutedWordsDialog() {
const {mutedWordsDialogControl: control} = useGlobalDialogsControlContext() const {mutedWordsDialogControl: control} = useGlobalDialogsControlContext()

View File

@ -1,18 +1,19 @@
import {isAndroid} from 'platform/detection'
import React from 'react' import React from 'react'
import {Pressable, View} from 'react-native' import {View, Pressable} from 'react-native'
import DatePicker from 'react-native-date-picker'
import {useTheme, atoms} from '#/alf'
import {Text} from '#/components/Typography'
import {useInteractionState} from '#/components/hooks/useInteractionState'
import * as TextField from '#/components/forms/TextField'
import {CalendarDays_Stroke2_Corner0_Rounded as CalendarDays} from '#/components/icons/CalendarDays'
import {atoms, useTheme} from '#/alf'
import {DateFieldProps} from '#/components/forms/DateField/types' import {DateFieldProps} from '#/components/forms/DateField/types'
import { import {
localizeDate, localizeDate,
toSimpleDateString, toSimpleDateString,
} from '#/components/forms/DateField/utils' } from '#/components/forms/DateField/utils'
import * as TextField from '#/components/forms/TextField' import DatePicker from 'react-native-date-picker'
import {useInteractionState} from '#/components/hooks/useInteractionState' import {isAndroid} from 'platform/detection'
import {CalendarDays_Stroke2_Corner0_Rounded as CalendarDays} from '#/components/icons/CalendarDays'
import {Text} from '#/components/Typography'
export * as utils from '#/components/forms/DateField/utils' export * as utils from '#/components/forms/DateField/utils'
export const Label = TextField.Label export const Label = TextField.Label

View File

@ -1,11 +1,11 @@
import React from 'react' import React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import DatePicker from 'react-native-date-picker'
import {atoms, useTheme} from '#/alf' import {useTheme, atoms} from '#/alf'
import {DateFieldProps} from '#/components/forms/DateField/types'
import {toSimpleDateString} from '#/components/forms/DateField/utils'
import * as TextField from '#/components/forms/TextField' import * as TextField from '#/components/forms/TextField'
import {toSimpleDateString} from '#/components/forms/DateField/utils'
import {DateFieldProps} from '#/components/forms/DateField/types'
import DatePicker from 'react-native-date-picker'
export * as utils from '#/components/forms/DateField/utils' export * as utils from '#/components/forms/DateField/utils'
export const Label = TextField.Label export const Label = TextField.Label

View File

@ -1,11 +1,11 @@
import React from 'react' import React from 'react'
import {StyleSheet, TextInput, TextInputProps} from 'react-native' import {TextInput, TextInputProps, StyleSheet} from 'react-native'
// @ts-ignore // @ts-ignore
import {unstable_createElement} from 'react-native-web' import {unstable_createElement} from 'react-native-web'
import {DateFieldProps} from '#/components/forms/DateField/types'
import {toSimpleDateString} from '#/components/forms/DateField/utils'
import * as TextField from '#/components/forms/TextField' import * as TextField from '#/components/forms/TextField'
import {toSimpleDateString} from '#/components/forms/DateField/utils'
import {DateFieldProps} from '#/components/forms/DateField/types'
export * as utils from '#/components/forms/DateField/utils' export * as utils from '#/components/forms/DateField/utils'
export const Label = TextField.Label export const Label = TextField.Label

View File

@ -1,19 +1,19 @@
import {HITSLOP_20} from 'lib/constants'
import React from 'react' import React from 'react'
import { import {
AccessibilityProps, View,
StyleSheet,
TextInput, TextInput,
TextInputProps, TextInputProps,
TextStyle, TextStyle,
View,
ViewStyle, ViewStyle,
StyleSheet,
AccessibilityProps,
} from 'react-native' } from 'react-native'
import {android, atoms as a, useTheme, web} from '#/alf' import {HITSLOP_20} from 'lib/constants'
import {useTheme, atoms as a, web, android} from '#/alf'
import {Text} from '#/components/Typography'
import {useInteractionState} from '#/components/hooks/useInteractionState' import {useInteractionState} from '#/components/hooks/useInteractionState'
import {Props as SVGIconProps} from '#/components/icons/common' import {Props as SVGIconProps} from '#/components/icons/common'
import {Text} from '#/components/Typography'
const Context = React.createContext<{ const Context = React.createContext<{
inputRef: React.RefObject<TextInput> | null inputRef: React.RefObject<TextInput> | null

View File

@ -1,11 +1,11 @@
import {HITSLOP_10} from 'lib/constants'
import React from 'react' import React from 'react'
import {Pressable, View, ViewStyle} from 'react-native' import {Pressable, View, ViewStyle} from 'react-native'
import {atoms as a, flatten, native, useTheme, ViewStyleProp, web} from '#/alf' import {HITSLOP_10} from 'lib/constants'
import {useTheme, atoms as a, web, native, flatten, ViewStyleProp} from '#/alf'
import {Text} from '#/components/Typography'
import {useInteractionState} from '#/components/hooks/useInteractionState' import {useInteractionState} from '#/components/hooks/useInteractionState'
import {CheckThick_Stroke2_Corner0_Rounded as Checkmark} from '#/components/icons/Check' import {CheckThick_Stroke2_Corner0_Rounded as Checkmark} from '#/components/icons/Check'
import {Text} from '#/components/Typography'
export type ItemState = { export type ItemState = {
name: string name: string

View File

@ -1,10 +1,11 @@
import React from 'react' import React from 'react'
import {AccessibilityProps, TextStyle, View, ViewStyle} from 'react-native' import {View, AccessibilityProps, TextStyle, ViewStyle} from 'react-native'
import {atoms as a, native, useTheme} from '#/alf' import {atoms as a, useTheme, native} from '#/alf'
import * as Toggle from '#/components/forms/Toggle'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import * as Toggle from '#/components/forms/Toggle'
export type ItemProps = Omit<Toggle.ItemProps, 'style' | 'role' | 'children'> & export type ItemProps = Omit<Toggle.ItemProps, 'style' | 'role' | 'children'> &
AccessibilityProps & AccessibilityProps &
React.PropsWithChildren<{testID?: string}> React.PropsWithChildren<{testID?: string}>

View File

@ -1,7 +1,7 @@
import React from 'react' import React from 'react'
import Svg, {Path} from 'react-native-svg' import Svg, {Path} from 'react-native-svg'
import {Props, useCommonSVGProps} from '#/components/icons/common' import {useCommonSVGProps, Props} from '#/components/icons/common'
export const IconTemplate_Stroke2_Corner0_Rounded = React.forwardRef( export const IconTemplate_Stroke2_Corner0_Rounded = React.forwardRef(
function LogoImpl(props: Props, ref) { function LogoImpl(props: Props, ref) {

View File

@ -1,5 +1,5 @@
import {StyleSheet, TextProps} from 'react-native' import {StyleSheet, TextProps} from 'react-native'
import type {PathProps, SvgProps} from 'react-native-svg' import type {SvgProps, PathProps} from 'react-native-svg'
import {tokens} from '#/alf' import {tokens} from '#/alf'

View File

@ -1,9 +1,7 @@
import React, {createContext, ReactNode, useContext} from 'react' import React, {ReactNode, createContext, useContext} from 'react'
import {TextStyle, ViewStyle} from 'react-native' import {TextStyle, ViewStyle} from 'react-native'
import {ThemeName} from '#/alf/themes'
import {darkTheme, defaultTheme, dimTheme} from './themes' import {darkTheme, defaultTheme, dimTheme} from './themes'
import {ThemeName} from '#/alf/themes'
export type ColorScheme = 'light' | 'dark' export type ColorScheme = 'light' | 'dark'

View File

@ -1,5 +1,5 @@
import {describe, it, expect} from '@jest/globals'
import {RichText} from '@atproto/api' import {RichText} from '@atproto/api'
import {describe, expect, it} from '@jest/globals'
import {hasMutedWord} from '../moderatePost_wrapped' import {hasMutedWord} from '../moderatePost_wrapped'

View File

@ -1,14 +1,13 @@
import React from 'react'
import {AppState, AppStateStatus} from 'react-native'
import AsyncStorage from '@react-native-async-storage/async-storage' import AsyncStorage from '@react-native-async-storage/async-storage'
import {createClient, SegmentClient} from '@segment/analytics-react-native' import {createClient, SegmentClient} from '@segment/analytics-react-native'
import {sha256} from 'js-sha256' import {sha256} from 'js-sha256'
import React from 'react'
import {AppState, AppStateStatus} from 'react-native'
import {Native} from 'sentry-expo' import {Native} from 'sentry-expo'
import {logger} from '#/logger' import {useSession, SessionAccount} from '#/state/session'
import {SessionAccount, useSession} from '#/state/session'
import {ScreenPropertiesMap, TrackPropertiesMap} from './types' import {ScreenPropertiesMap, TrackPropertiesMap} from './types'
import {logger} from '#/logger'
type AppInfo = { type AppInfo = {
build?: string | undefined build?: string | undefined

View File

@ -1,12 +1,11 @@
import React from 'react'
import {createClient} from '@segment/analytics-react' import {createClient} from '@segment/analytics-react'
import {sha256} from 'js-sha256' import {sha256} from 'js-sha256'
import React from 'react'
import {Browser} from 'sentry-expo' import {Browser} from 'sentry-expo'
import {logger} from '#/logger'
import {SessionAccount, useSession} from '#/state/session'
import {ScreenPropertiesMap, TrackPropertiesMap} from './types' import {ScreenPropertiesMap, TrackPropertiesMap} from './types'
import {useSession, SessionAccount} from '#/state/session'
import {logger} from '#/logger'
type SegmentClient = ReturnType<typeof createClient> type SegmentClient = ReturnType<typeof createClient>

View File

@ -1,4 +1,4 @@
import {BskyAgent, jsonToLex, stringifyLex} from '@atproto/api' import {BskyAgent, stringifyLex, jsonToLex} from '@atproto/api'
import RNFS from 'react-native-fs' import RNFS from 'react-native-fs'
const GET_TIMEOUT = 15e3 // 15s const GET_TIMEOUT = 15e3 // 15s

View File

@ -1,12 +1,11 @@
import { import {
AppBskyEmbedRecord,
AppBskyEmbedRecordWithMedia,
AppBskyFeedDefs, AppBskyFeedDefs,
AppBskyFeedPost, AppBskyFeedPost,
AppBskyEmbedRecordWithMedia,
AppBskyEmbedRecord,
} from '@atproto/api' } from '@atproto/api'
import {isPostInLanguage} from '../../locale/helpers'
import {ReasonFeedSource} from './feed/types' import {ReasonFeedSource} from './feed/types'
import {isPostInLanguage} from '../../locale/helpers'
type FeedViewPost = AppBskyFeedDefs.FeedViewPost type FeedViewPost = AppBskyFeedDefs.FeedViewPost
export type FeedTunerFn = ( export type FeedTunerFn = (

View File

@ -2,10 +2,8 @@ import {
AppBskyFeedDefs, AppBskyFeedDefs,
AppBskyFeedGetAuthorFeed as GetAuthorFeed, AppBskyFeedGetAuthorFeed as GetAuthorFeed,
} from '@atproto/api' } from '@atproto/api'
import {getAgent} from '#/state/session'
import {FeedAPI, FeedAPIResponse} from './types' import {FeedAPI, FeedAPIResponse} from './types'
import {getAgent} from '#/state/session'
export class AuthorFeedAPI implements FeedAPI { export class AuthorFeedAPI implements FeedAPI {
constructor(public params: GetAuthorFeed.QueryParams) {} constructor(public params: GetAuthorFeed.QueryParams) {}

View File

@ -2,11 +2,9 @@ import {
AppBskyFeedDefs, AppBskyFeedDefs,
AppBskyFeedGetFeed as GetCustomFeed, AppBskyFeedGetFeed as GetCustomFeed,
} from '@atproto/api' } from '@atproto/api'
import {getContentLanguages} from '#/state/preferences/languages'
import {getAgent} from '#/state/session'
import {FeedAPI, FeedAPIResponse} from './types' import {FeedAPI, FeedAPIResponse} from './types'
import {getAgent} from '#/state/session'
import {getContentLanguages} from '#/state/preferences/languages'
export class CustomFeedAPI implements FeedAPI { export class CustomFeedAPI implements FeedAPI {
constructor(public params: GetCustomFeed.QueryParams) {} constructor(public params: GetCustomFeed.QueryParams) {}

View File

@ -1,8 +1,6 @@
import {AppBskyFeedDefs} from '@atproto/api' import {AppBskyFeedDefs} from '@atproto/api'
import {getAgent} from '#/state/session'
import {FeedAPI, FeedAPIResponse} from './types' import {FeedAPI, FeedAPIResponse} from './types'
import {getAgent} from '#/state/session'
export class FollowingFeedAPI implements FeedAPI { export class FollowingFeedAPI implements FeedAPI {
constructor() {} constructor() {}

View File

@ -1,10 +1,8 @@
import {AppBskyFeedDefs} from '@atproto/api' import {AppBskyFeedDefs} from '@atproto/api'
import {PROD_DEFAULT_FEED} from '#/lib/constants'
import {CustomFeedAPI} from './custom'
import {FollowingFeedAPI} from './following'
import {FeedAPI, FeedAPIResponse} from './types' import {FeedAPI, FeedAPIResponse} from './types'
import {FollowingFeedAPI} from './following'
import {CustomFeedAPI} from './custom'
import {PROD_DEFAULT_FEED} from '#/lib/constants'
// HACK // HACK
// the feed API does not include any facilities for passing down // the feed API does not include any facilities for passing down

View File

@ -2,10 +2,8 @@ import {
AppBskyFeedDefs, AppBskyFeedDefs,
AppBskyFeedGetActorLikes as GetActorLikes, AppBskyFeedGetActorLikes as GetActorLikes,
} from '@atproto/api' } from '@atproto/api'
import {getAgent} from '#/state/session'
import {FeedAPI, FeedAPIResponse} from './types' import {FeedAPI, FeedAPIResponse} from './types'
import {getAgent} from '#/state/session'
export class LikesFeedAPI implements FeedAPI { export class LikesFeedAPI implements FeedAPI {
constructor(public params: GetActorLikes.QueryParams) {} constructor(public params: GetActorLikes.QueryParams) {}

View File

@ -2,10 +2,8 @@ import {
AppBskyFeedDefs, AppBskyFeedDefs,
AppBskyFeedGetListFeed as GetListFeed, AppBskyFeedGetListFeed as GetListFeed,
} from '@atproto/api' } from '@atproto/api'
import {getAgent} from '#/state/session'
import {FeedAPI, FeedAPIResponse} from './types' import {FeedAPI, FeedAPIResponse} from './types'
import {getAgent} from '#/state/session'
export class ListFeedAPI implements FeedAPI { export class ListFeedAPI implements FeedAPI {
constructor(public params: GetListFeed.QueryParams) {} constructor(public params: GetListFeed.QueryParams) {}

View File

@ -1,16 +1,14 @@
import {AppBskyFeedDefs, AppBskyFeedGetTimeline} from '@atproto/api' import {AppBskyFeedDefs, AppBskyFeedGetTimeline} from '@atproto/api'
import {bundleAsync} from 'lib/async/bundle'
import {timeout} from 'lib/async/timeout'
import {feedUriToHref} from 'lib/strings/url-helpers'
import shuffle from 'lodash.shuffle' import shuffle from 'lodash.shuffle'
import {timeout} from 'lib/async/timeout'
import {getContentLanguages} from '#/state/preferences/languages' import {bundleAsync} from 'lib/async/bundle'
import {FeedParams} from '#/state/queries/post-feed' import {feedUriToHref} from 'lib/strings/url-helpers'
import {getAgent} from '#/state/session'
import {FeedTuner} from '../feed-manip' import {FeedTuner} from '../feed-manip'
import {FeedTunerFn} from '../feed-manip'
import {FeedAPI, FeedAPIResponse, ReasonFeedSource} from './types' import {FeedAPI, FeedAPIResponse, ReasonFeedSource} from './types'
import {FeedParams} from '#/state/queries/post-feed'
import {FeedTunerFn} from '../feed-manip'
import {getAgent} from '#/state/session'
import {getContentLanguages} from '#/state/preferences/languages'
const REQUEST_WAIT_MS = 500 // 500ms const REQUEST_WAIT_MS = 500 // 500ms
const POST_AGE_CUTOFF = 60e3 * 60 * 24 // 24hours const POST_AGE_CUTOFF = 60e3 * 60 * 24 // 24hours

View File

@ -1,6 +1,6 @@
import { import {
AppBskyEmbedExternal,
AppBskyEmbedImages, AppBskyEmbedImages,
AppBskyEmbedExternal,
AppBskyEmbedRecord, AppBskyEmbedRecord,
AppBskyEmbedRecordWithMedia, AppBskyEmbedRecordWithMedia,
AppBskyFeedThreadgate, AppBskyFeedThreadgate,
@ -12,15 +12,13 @@ import {
} from '@atproto/api' } from '@atproto/api'
import {AtUri} from '@atproto/api' import {AtUri} from '@atproto/api'
import {isNetworkError} from 'lib/strings/errors' import {isNetworkError} from 'lib/strings/errors'
import {shortenLinks} from 'lib/strings/rich-text-manip' import {LinkMeta} from '../link-meta/link-meta'
import {isWeb} from 'platform/detection' import {isWeb} from 'platform/detection'
import {ImageModel} from 'state/models/media/image' import {ImageModel} from 'state/models/media/image'
import {shortenLinks} from 'lib/strings/rich-text-manip'
import {logger} from '#/logger' import {logger} from '#/logger'
import {ThreadgateSetting} from '#/state/queries/threadgate' import {ThreadgateSetting} from '#/state/queries/threadgate'
import {LinkMeta} from '../link-meta/link-meta'
export interface ExternalEmbedDraft { export interface ExternalEmbedDraft {
uri: string uri: string
isLoading: boolean isLoading: boolean

View File

@ -1,5 +1,5 @@
import * as Updates from 'expo-updates'
import VersionNumber from 'react-native-version-number' import VersionNumber from 'react-native-version-number'
import * as Updates from 'expo-updates'
export const updateChannel = Updates.channel export const updateChannel = Updates.channel
export const appVersion = `${VersionNumber.appVersion} (${VersionNumber.buildVersion})` export const appVersion = `${VersionNumber.appVersion} (${VersionNumber.buildVersion})`

View File

@ -1,7 +1,7 @@
import { import {
AppBskyFeedDefs,
AppBskyEmbedRecord, AppBskyEmbedRecord,
AppBskyEmbedRecordWithMedia, AppBskyEmbedRecordWithMedia,
AppBskyFeedDefs,
} from '@atproto/api' } from '@atproto/api'
export function isEmbedByEmbedder( export function isEmbedByEmbedder(

View File

@ -1,11 +1,11 @@
import {useCallback} from 'react' import {useCallback} from 'react'
import {useAnalytics} from '#/lib/analytics/analytics'
import {isWeb} from '#/platform/detection' import {isWeb} from '#/platform/detection'
import {SessionAccount, useSessionApi} from '#/state/session' import {useAnalytics} from '#/lib/analytics/analytics'
import {useLoggedOutViewControls} from '#/state/shell/logged-out' import {useSessionApi, SessionAccount} from '#/state/session'
import {useCloseAllActiveElements} from '#/state/util'
import * as Toast from '#/view/com/util/Toast' import * as Toast from '#/view/com/util/Toast'
import {useCloseAllActiveElements} from '#/state/util'
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
export function useAccountSwitcher() { export function useAccountSwitcher() {
const {track} = useAnalytics() const {track} = useAnalytics()

View File

@ -1,4 +1,4 @@
import {useEffect, useRef} from 'react' import {useRef, useEffect} from 'react'
import {useAnimatedScrollHandler as useAnimatedScrollHandler_BUGGY} from 'react-native-reanimated' import {useAnimatedScrollHandler as useAnimatedScrollHandler_BUGGY} from 'react-native-reanimated'
export const useAnimatedScrollHandler: typeof useAnimatedScrollHandler_BUGGY = ( export const useAnimatedScrollHandler: typeof useAnimatedScrollHandler_BUGGY = (

View File

@ -1,6 +1,6 @@
import {choose} from 'lib/functions'
import {useTheme} from 'lib/ThemeContext'
import React from 'react' import React from 'react'
import {useTheme} from 'lib/ThemeContext'
import {choose} from 'lib/functions'
export function useCustomPalette<T>({light, dark}: {light: T; dark: T}) { export function useCustomPalette<T>({light, dark}: {light: T; dark: T}) {
const theme = useTheme() const theme = useTheme()

View File

@ -1,7 +1,7 @@
import {mergeRefs} from 'lib/merge-refs' import {useEffect, useRef, useMemo, ForwardedRef} from 'react'
import {ForwardedRef, useEffect, useMemo, useRef} from 'react' import {Platform, findNodeHandle} from 'react-native'
import type {ScrollView} from 'react-native' import type {ScrollView} from 'react-native'
import {findNodeHandle, Platform} from 'react-native' import {mergeRefs} from 'lib/merge-refs'
type Props<Scrollable extends ScrollView = ScrollView> = { type Props<Scrollable extends ScrollView = ScrollView> = {
cursor?: string cursor?: string

View File

@ -1,8 +1,8 @@
import React from 'react'
import * as Linking from 'expo-linking' import * as Linking from 'expo-linking'
import {isNative} from 'platform/detection' import {isNative} from 'platform/detection'
import React from 'react'
import {useSession} from 'state/session'
import {useComposerControls} from 'state/shell' import {useComposerControls} from 'state/shell'
import {useSession} from 'state/session'
import {useCloseAllActiveElements} from 'state/util' import {useCloseAllActiveElements} from 'state/util'
type IntentType = 'compose' type IntentType = 'compose'

View File

@ -1,6 +1,6 @@
import {isIOS} from 'platform/detection' import {useState, useEffect} from 'react'
import {useEffect, useState} from 'react'
import {Keyboard} from 'react-native' import {Keyboard} from 'react-native'
import {isIOS} from 'platform/detection'
export function useIsKeyboardVisible({ export function useIsKeyboardVisible({
iosUseWillEvents, iosUseWillEvents,

View File

@ -1,5 +1,4 @@
import {interpolate, useAnimatedStyle} from 'react-native-reanimated' import {interpolate, useAnimatedStyle} from 'react-native-reanimated'
import {useMinimalShellMode as useMinimalShellModeState} from '#/state/shell/minimal-mode' import {useMinimalShellMode as useMinimalShellModeState} from '#/state/shell/minimal-mode'
import {useShellLayout} from '#/state/shell/shell-layout' import {useShellLayout} from '#/state/shell/shell-layout'

View File

@ -1,9 +1,9 @@
import {useNavigation} from '@react-navigation/core'
import {NavigationState} from '@react-navigation/native'
import type {NavigationAction} from '@react-navigation/routers'
import {useDedupe} from 'lib/hooks/useDedupe'
import {AllNavigatorParams, NavigationProp} from 'lib/routes/types'
import React from 'react' import React from 'react'
import {useNavigation} from '@react-navigation/core'
import {AllNavigatorParams, NavigationProp} from 'lib/routes/types'
import type {NavigationAction} from '@react-navigation/routers'
import {NavigationState} from '@react-navigation/native'
import {useDedupe} from 'lib/hooks/useDedupe'
export type DebouncedNavigationProp = Pick< export type DebouncedNavigationProp = Pick<
NavigationProp, NavigationProp,

View File

@ -1,10 +1,9 @@
import {t} from '@lingui/macro'
import * as Updates from 'expo-updates' import * as Updates from 'expo-updates'
import {useCallback, useEffect} from 'react' import {useCallback, useEffect} from 'react'
import {AppState} from 'react-native' import {AppState} from 'react-native'
import {logger} from '#/logger' import {logger} from '#/logger'
import {useModalControls} from '#/state/modals' import {useModalControls} from '#/state/modals'
import {t} from '@lingui/macro'
export function useOTAUpdate() { export function useOTAUpdate() {
const {openModal} = useModalControls() const {openModal} = useModalControls()

View File

@ -1,7 +1,6 @@
import {useMemo} from 'react' import {useMemo} from 'react'
import {TextStyle, ViewStyle} from 'react-native' import {TextStyle, ViewStyle} from 'react-native'
import {useTheme, PaletteColorName, PaletteColor} from '../ThemeContext'
import {PaletteColor, PaletteColorName, useTheme} from '../ThemeContext'
export interface UsePaletteValue { export interface UsePaletteValue {
colors: PaletteColor colors: PaletteColor

View File

@ -1,7 +1,7 @@
import {Camera} from 'expo-camera' import {Camera} from 'expo-camera'
import * as MediaLibrary from 'expo-media-library' import * as MediaLibrary from 'expo-media-library'
import {isWeb} from 'platform/detection'
import {Linking} from 'react-native' import {Linking} from 'react-native'
import {isWeb} from 'platform/detection'
import {Alert} from 'view/com/util/Alert' import {Alert} from 'view/com/util/Alert'
const openPermissionAlert = (perm: string) => { const openPermissionAlert = (perm: string) => {

View File

@ -1,8 +1,8 @@
import {useEffect} from 'react'
import {useNavigation} from '@react-navigation/native' import {useNavigation} from '@react-navigation/native'
import {NavigationProp} from 'lib/routes/types' import {NavigationProp} from 'lib/routes/types'
import {bskyTitle} from 'lib/strings/headings' import {bskyTitle} from 'lib/strings/headings'
import {useEffect} from 'react'
import {useUnreadNotifications} from '#/state/queries/notifications/unread' import {useUnreadNotifications} from '#/state/queries/notifications/unread'
export function useSetTitle(title?: string) { export function useSetTitle(title?: string) {

View File

@ -1,6 +1,6 @@
import {useEffect, useState} from 'react'
import {useNavigation} from '@react-navigation/native' import {useNavigation} from '@react-navigation/native'
import {getTabState, TabState} from 'lib/routes/helpers' import {getTabState, TabState} from 'lib/routes/helpers'
import {useEffect, useState} from 'react'
export function useTabFocusEffect( export function useTabFocusEffect(
tabName: string, tabName: string,

View File

@ -1,4 +1,4 @@
import {useCallback, useEffect, useRef, useState} from 'react' import {useState, useRef, useEffect, useCallback} from 'react'
type Task<TServerState> = { type Task<TServerState> = {
isOn: boolean isOn: boolean

View File

@ -1,5 +1,4 @@
import {useEffect} from 'react' import {useEffect} from 'react'
import {isWeb} from '#/platform/detection' import {isWeb} from '#/platform/detection'
let refCount = 0 let refCount = 0

View File

@ -1,5 +1,5 @@
import {isNative} from 'platform/detection'
import {useMediaQuery} from 'react-responsive' import {useMediaQuery} from 'react-responsive'
import {isNative} from 'platform/detection'
export function useWebMediaQueries() { export function useWebMediaQueries() {
const isDesktop = useMediaQuery({minWidth: 1300}) const isDesktop = useMediaQuery({minWidth: 1300})

View File

@ -1,5 +1,5 @@
import {useMemo, useState, useEffect} from 'react'
import {EventArg, useNavigation} from '@react-navigation/core' import {EventArg, useNavigation} from '@react-navigation/core'
import {useEffect, useMemo, useState} from 'react'
if ('scrollRestoration' in history) { if ('scrollRestoration' in history) {
// Tell the brower not to mess with the scroll. // Tell the brower not to mess with the scroll.

View File

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import {StyleProp, TextStyle, ViewStyle} from 'react-native' import {StyleProp, TextStyle, ViewStyle} from 'react-native'
import Svg, {Ellipse, Line, Path, Rect} from 'react-native-svg' import Svg, {Path, Rect, Line, Ellipse} from 'react-native-svg'
export function GridIcon({ export function GridIcon({
style, style,

View File

@ -1,13 +1,11 @@
import {AppBskyFeedPost, BskyAgent} from '@atproto/api' import {AppBskyFeedPost, BskyAgent} from '@atproto/api'
import * as apilib from 'lib/api/index' import * as apilib from 'lib/api/index'
import {ComposerOptsQuote} from 'state/shell/composer' import {LikelyType, LinkMeta} from './link-meta'
import {useFetchDid} from '#/state/queries/handle'
import {useGetPost} from '#/state/queries/post'
// import {match as matchRoute} from 'view/routes' // import {match as matchRoute} from 'view/routes'
import {convertBskyAppUrlIfNeeded, makeRecordUri} from '../strings/url-helpers' import {convertBskyAppUrlIfNeeded, makeRecordUri} from '../strings/url-helpers'
import {LikelyType, LinkMeta} from './link-meta' import {ComposerOptsQuote} from 'state/shell/composer'
import {useGetPost} from '#/state/queries/post'
import {useFetchDid} from '#/state/queries/handle'
// TODO // TODO
// import {Home} from 'view/screens/Home' // import {Home} from 'view/screens/Home'

View File

@ -1,9 +1,8 @@
import {BskyAgent} from '@atproto/api' import {BskyAgent} from '@atproto/api'
import {LINK_META_PROXY} from 'lib/constants'
import {getGiphyMetaUri} from 'lib/strings/embed-player'
import {isBskyAppUrl} from '../strings/url-helpers' import {isBskyAppUrl} from '../strings/url-helpers'
import {extractBskyMeta} from './bsky' import {extractBskyMeta} from './bsky'
import {LINK_META_PROXY} from 'lib/constants'
import {getGiphyMetaUri} from 'lib/strings/embed-player'
export enum LikelyType { export enum LikelyType {
HTML, HTML,

View File

@ -1,5 +1,5 @@
import type {Dimensions} from 'lib/media/types'
import {Image} from 'react-native' import {Image} from 'react-native'
import type {Dimensions} from 'lib/media/types'
const sizes: Map<string, Dimensions> = new Map() const sizes: Map<string, Dimensions> = new Map()
const activeRequests: Map<string, Promise<Dimensions>> = new Map() const activeRequests: Map<string, Promise<Dimensions>> = new Map()

View File

@ -1,14 +1,13 @@
import ImageResizer from '@bam.tech/react-native-image-resizer'
import * as MediaLibrary from 'expo-media-library'
import * as Sharing from 'expo-sharing'
import {isAndroid, isIOS} from 'platform/detection'
import {Image as RNImage, Share as RNShare} from 'react-native'
import * as RNFS from 'react-native-fs'
import {Image} from 'react-native-image-crop-picker'
import uuid from 'react-native-uuid'
import RNFetchBlob from 'rn-fetch-blob' import RNFetchBlob from 'rn-fetch-blob'
import ImageResizer from '@bam.tech/react-native-image-resizer'
import {Image as RNImage, Share as RNShare} from 'react-native'
import {Image} from 'react-native-image-crop-picker'
import * as RNFS from 'react-native-fs'
import uuid from 'react-native-uuid'
import * as Sharing from 'expo-sharing'
import * as MediaLibrary from 'expo-media-library'
import {Dimensions} from './types' import {Dimensions} from './types'
import {isAndroid, isIOS} from 'platform/detection'
export async function compressIfNeeded( export async function compressIfNeeded(
img: Image, img: Image,

View File

@ -1,7 +1,6 @@
import {Image as RNImage} from 'react-native-image-crop-picker'
import {Dimensions} from './types' import {Dimensions} from './types'
import {blobToDataUri, getDataUriSize} from './util' import {Image as RNImage} from 'react-native-image-crop-picker'
import {getDataUriSize, blobToDataUri} from './util'
export async function compressIfNeeded( export async function compressIfNeeded(
img: RNImage, img: RNImage,

View File

@ -1,8 +1,7 @@
import RNFS from 'react-native-fs'
import {Image as RNImage} from 'react-native-image-crop-picker' import {Image as RNImage} from 'react-native-image-crop-picker'
import RNFS from 'react-native-fs'
import {compressIfNeeded} from './manip'
import {CropperOptions} from './types' import {CropperOptions} from './types'
import {compressIfNeeded} from './manip'
let _imageCounter = 0 let _imageCounter = 0
async function getFile() { async function getFile() {

View File

@ -3,9 +3,8 @@ import {
launchImageLibraryAsync, launchImageLibraryAsync,
MediaTypeOptions, MediaTypeOptions,
} from 'expo-image-picker' } from 'expo-image-picker'
import * as Toast from 'view/com/util/Toast'
import {getDataUriSize} from './util' import {getDataUriSize} from './util'
import * as Toast from 'view/com/util/Toast'
export async function openPicker(opts?: ImagePickerOptions) { export async function openPicker(opts?: ImagePickerOptions) {
const response = await launchImageLibraryAsync({ const response = await launchImageLibraryAsync({

View File

@ -1,9 +1,8 @@
import { import {
Image as RNImage,
openCamera as openCameraFn, openCamera as openCameraFn,
openCropper as openCropperFn, openCropper as openCropperFn,
Image as RNImage,
} from 'react-native-image-crop-picker' } from 'react-native-image-crop-picker'
import {CameraOpts, CropperOptions} from './types' import {CameraOpts, CropperOptions} from './types'
export {openPicker} from './picker.shared' export {openPicker} from './picker.shared'

View File

@ -1,8 +1,7 @@
/// <reference lib="dom" /> /// <reference lib="dom" />
import {Image as RNImage} from 'react-native-image-crop-picker'
import {CameraOpts, CropperOptions} from './types' import {CameraOpts, CropperOptions} from './types'
import {Image as RNImage} from 'react-native-image-crop-picker'
export {openPicker} from './picker.shared' export {openPicker} from './picker.shared'
import {unstable__openModal} from '#/state/modals' import {unstable__openModal} from '#/state/modals'

View File

@ -1,12 +1,12 @@
import { import {
AppBskyActorDefs,
AppBskyEmbedExternal,
AppBskyEmbedImages,
AppBskyEmbedRecord, AppBskyEmbedRecord,
AppBskyEmbedRecordWithMedia, AppBskyEmbedRecordWithMedia,
moderatePost,
AppBskyActorDefs,
AppBskyFeedPost, AppBskyFeedPost,
AppBskyRichtextFacet, AppBskyRichtextFacet,
moderatePost, AppBskyEmbedImages,
AppBskyEmbedExternal,
} from '@atproto/api' } from '@atproto/api'
type ModeratePost = typeof moderatePost type ModeratePost = typeof moderatePost

View File

@ -1,4 +1,4 @@
import {ModerationCause, PostModeration, ProfileModeration} from '@atproto/api' import {ModerationCause, ProfileModeration, PostModeration} from '@atproto/api'
export interface ModerationCauseDescription { export interface ModerationCauseDescription {
name: string name: string

View File

@ -1,14 +1,12 @@
import {QueryClient} from '@tanstack/react-query'
import * as Notifications from 'expo-notifications' import * as Notifications from 'expo-notifications'
import {track} from 'lib/analytics/analytics' import {QueryClient} from '@tanstack/react-query'
import {resetToTab} from '../../Navigation'
import {devicePlatform, isIOS} from 'platform/detection' import {devicePlatform, isIOS} from 'platform/detection'
import {track} from 'lib/analytics/analytics'
import {logger} from '#/logger' import {logger} from '#/logger'
import {RQKEY as RQKEY_NOTIFS} from '#/state/queries/notifications/feed' import {RQKEY as RQKEY_NOTIFS} from '#/state/queries/notifications/feed'
import {truncateAndInvalidate} from '#/state/queries/util' import {truncateAndInvalidate} from '#/state/queries/util'
import {getAgent, SessionAccount} from '#/state/session' import {SessionAccount, getAgent} from '#/state/session'
import {resetToTab} from '../../Navigation'
const SERVICE_DID = (serviceUrl?: string) => const SERVICE_DID = (serviceUrl?: string) =>
serviceUrl?.includes('staging') serviceUrl?.includes('staging')

View File

@ -1,6 +1,5 @@
import {focusManager, QueryClient} from '@tanstack/react-query'
import {AppState, AppStateStatus} from 'react-native' import {AppState, AppStateStatus} from 'react-native'
import {QueryClient, focusManager} from '@tanstack/react-query'
import {isNative} from '#/platform/detection' import {isNative} from '#/platform/detection'
focusManager.setEventListener(onFocus => { focusManager.setEventListener(onFocus => {

View File

@ -1,6 +1,5 @@
import {NavigationProp} from '@react-navigation/native' import {NavigationProp} from '@react-navigation/native'
import {State, RouteParams} from './types'
import {RouteParams, State} from './types'
export function getRootNavigation<T extends {}>( export function getRootNavigation<T extends {}>(
nav: NavigationProp<T>, nav: NavigationProp<T>,

View File

@ -1,4 +1,4 @@
import {Route, RouteParams} from './types' import {RouteParams, Route} from './types'
export class Router { export class Router {
routes: [string, Route][] = [] routes: [string, Route][] = []

View File

@ -3,9 +3,9 @@
* avoid future conflicts and/or circular deps * avoid future conflicts and/or circular deps
*/ */
import * as info from 'expo-updates'
import {Platform} from 'react-native' import {Platform} from 'react-native'
import app from 'react-native-version-number' import app from 'react-native-version-number'
import * as info from 'expo-updates'
import {init} from 'sentry-expo' import {init} from 'sentry-expo'
/** /**

View File

@ -1,9 +1,8 @@
import {isIOS, isAndroid} from 'platform/detection'
// import * as Sharing from 'expo-sharing' // import * as Sharing from 'expo-sharing'
import Clipboard from '@react-native-clipboard/clipboard' import Clipboard from '@react-native-clipboard/clipboard'
import {isAndroid, isIOS} from 'platform/detection'
import {Share} from 'react-native'
import * as Toast from '../view/com/util/Toast' import * as Toast from '../view/com/util/Toast'
import {Share} from 'react-native'
/** /**
* This function shares a URL using the native Share API if available, or copies it to the clipboard * This function shares a URL using the native Share API if available, or copies it to the clipboard

View File

@ -1,12 +1,11 @@
import {sha256} from 'js-sha256'
import React from 'react' import React from 'react'
import { import {
Statsig, Statsig,
StatsigProvider, StatsigProvider,
useGate as useStatsigGate, useGate as useStatsigGate,
} from 'statsig-react-native-expo' } from 'statsig-react-native-expo'
import {useSession} from '../../state/session' import {useSession} from '../../state/session'
import {sha256} from 'js-sha256'
const statsigOptions = { const statsigOptions = {
environment: { environment: {

View File

@ -1,12 +1,11 @@
import {sha256} from 'js-sha256'
import React from 'react' import React from 'react'
import { import {
Statsig, Statsig,
StatsigProvider, StatsigProvider,
useGate as useStatsigGate, useGate as useStatsigGate,
} from 'statsig-react' } from 'statsig-react'
import {useSession} from '../../state/session' import {useSession} from '../../state/session'
import {sha256} from 'js-sha256'
const statsigOptions = { const statsigOptions = {
environment: { environment: {

View File

@ -1,5 +1,4 @@
import {ModerationUI} from '@atproto/api' import {ModerationUI} from '@atproto/api'
import {describeModerationCause} from '../moderation' import {describeModerationCause} from '../moderation'
// \u2705 = ✅ // \u2705 = ✅

View File

@ -1,5 +1,5 @@
import {isWeb} from 'platform/detection'
import {Dimensions} from 'react-native' import {Dimensions} from 'react-native'
import {isWeb} from 'platform/detection'
const {height: SCREEN_HEIGHT} = Dimensions.get('window') const {height: SCREEN_HEIGHT} = Dimensions.get('window')
export const embedPlayerSources = [ export const embedPlayerSources = [

View File

@ -1,5 +1,4 @@
import {AppBskyRichtextFacet, RichText} from '@atproto/api' import {AppBskyRichtextFacet, RichText} from '@atproto/api'
import {linkRequiresWarning} from './url-helpers' import {linkRequiresWarning} from './url-helpers'
export function richTextToString(rt: RichText, loose: boolean): string { export function richTextToString(rt: RichText, loose: boolean): string {

View File

@ -1,5 +1,4 @@
import {RichText, UnicodeString} from '@atproto/api' import {RichText, UnicodeString} from '@atproto/api'
import {toShortUrl} from './url-helpers' import {toShortUrl} from './url-helpers'
export function shortenLinks(rt: RichText): RichText { export function shortenLinks(rt: RichText): RichText {

View File

@ -1,7 +1,7 @@
import {AtUri} from '@atproto/api' import {AtUri} from '@atproto/api'
import {BSKY_SERVICE} from 'lib/constants' import {BSKY_SERVICE} from 'lib/constants'
import psl from 'psl'
import TLDs from 'tlds' import TLDs from 'tlds'
import psl from 'psl'
export const BSKY_APP_HOST = 'https://bsky.app' export const BSKY_APP_HOST = 'https://bsky.app'

View File

@ -1,7 +1,6 @@
import {isWeb} from 'platform/detection'
import {Dimensions, StyleProp, StyleSheet, TextStyle} from 'react-native' import {Dimensions, StyleProp, StyleSheet, TextStyle} from 'react-native'
import {Theme, TypographyVariant} from './ThemeContext' import {Theme, TypographyVariant} from './ThemeContext'
import {isWeb} from 'platform/detection'
// 1 is lightest, 2 is light, 3 is mid, 4 is dark, 5 is darkest // 1 is lightest, 2 is light, 3 is mid, 4 is dark, 5 is darkest
export const colors = { export const colors = {

View File

@ -1,9 +1,8 @@
import {Platform} from 'react-native' import {Platform} from 'react-native'
import {darkPalette, dimPalette, lightPalette} from '#/alf/themes'
import {colors} from './styles'
import type {Theme} from './ThemeContext' import type {Theme} from './ThemeContext'
import {colors} from './styles'
import {darkPalette, lightPalette, dimPalette} from '#/alf/themes'
export const defaultTheme: Theme = { export const defaultTheme: Theme = {
colorScheme: 'light', colorScheme: 'light',

View File

@ -1,4 +1,4 @@
import {expect, test} from '@jest/globals' import {test, expect} from '@jest/globals'
import {sanitizeAppLanguageSetting} from '#/locale/helpers' import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {AppLanguage} from '#/locale/languages' import {AppLanguage} from '#/locale/languages'

View File

@ -1,8 +1,7 @@
import {AppBskyFeedDefs, AppBskyFeedPost} from '@atproto/api' import {AppBskyFeedDefs, AppBskyFeedPost} from '@atproto/api'
import * as bcp47Match from 'bcp-47-match'
import lande from 'lande' import lande from 'lande'
import {hasProp} from 'lib/type-guards' import {hasProp} from 'lib/type-guards'
import * as bcp47Match from 'bcp-47-match'
import { import {
AppLanguage, AppLanguage,
LANGUAGES_MAP_CODE2, LANGUAGES_MAP_CODE2,

View File

@ -1,22 +1,23 @@
import {i18n} from '@lingui/core'
import {useEffect} from 'react' import {useEffect} from 'react'
import {i18n} from '@lingui/core'
import {sanitizeAppLanguageSetting} from '#/locale/helpers' import {useLanguagePrefs} from '#/state/preferences'
import {AppLanguage} from '#/locale/languages'
import {messages as messagesCa} from '#/locale/locales/ca/messages'
import {messages as messagesDe} from '#/locale/locales/de/messages'
import {messages as messagesEn} from '#/locale/locales/en/messages' import {messages as messagesEn} from '#/locale/locales/en/messages'
import {messages as messagesDe} from '#/locale/locales/de/messages'
import {messages as messagesId} from '#/locale/locales/id/messages'
import {messages as messagesEs} from '#/locale/locales/es/messages' import {messages as messagesEs} from '#/locale/locales/es/messages'
import {messages as messagesFr} from '#/locale/locales/fr/messages' import {messages as messagesFr} from '#/locale/locales/fr/messages'
import {messages as messagesHi} from '#/locale/locales/hi/messages' import {messages as messagesHi} from '#/locale/locales/hi/messages'
import {messages as messagesId} from '#/locale/locales/id/messages'
import {messages as messagesIt} from '#/locale/locales/it/messages'
import {messages as messagesJa} from '#/locale/locales/ja/messages' import {messages as messagesJa} from '#/locale/locales/ja/messages'
import {messages as messagesKo} from '#/locale/locales/ko/messages' import {messages as messagesKo} from '#/locale/locales/ko/messages'
import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages' import {messages as messagesPt_BR} from '#/locale/locales/pt-BR/messages'
import {messages as messagesUk} from '#/locale/locales/uk/messages' import {messages as messagesUk} from '#/locale/locales/uk/messages'
import {messages as messagesCa} from '#/locale/locales/ca/messages'
import {messages as messagesZh_CN} from '#/locale/locales/zh-CN/messages' import {messages as messagesZh_CN} from '#/locale/locales/zh-CN/messages'
import {useLanguagePrefs} from '#/state/preferences' import {messages as messagesIt} from '#/locale/locales/it/messages'
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
import {AppLanguage} from '#/locale/languages'
/** /**
* We do a dynamic import of just the catalog that we need * We do a dynamic import of just the catalog that we need

Some files were not shown because too many files have changed in this diff Show More