Skip to content

Commit

Permalink
chore: bumped react-query to 4.x (pkgs-fix-tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
stackchain committed Sep 30, 2024
1 parent 60864f9 commit 9955858
Show file tree
Hide file tree
Showing 135 changed files with 217 additions and 237 deletions.
2 changes: 1 addition & 1 deletion apps/wallet-mobile/.storybook/decorators/query.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import {QueryClient, QueryClientProvider} from 'react-query'
import {QueryClient, QueryClientProvider} from '@tanstack/react-query'

import {Boundary} from '../../src/components/Boundary/Boundary'

Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"react-native-url-polyfill": "^2.0.0",
"react-native-view-shot": "^3.8.0",
"react-native-webview": "^13.8.1",
"react-query": "^3.39.3",
"@tanstack/react-query": "4.36.1",
"reselect": "^4.0.0",
"rxjs": "7.8.1",
"sentry-expo": "^7.0.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/YoroiApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {LogBox, StyleSheet} from 'react-native'
import * as RNP from 'react-native-paper'
import {initialWindowMetrics, SafeAreaProvider} from 'react-native-safe-area-context'
import {enableFreeze, enableScreens} from 'react-native-screens'
import {QueryClientProvider} from 'react-query'
import {QueryClientProvider} from '@tanstack/react-query'

import {LoadingBoundary} from './components/Boundary/Boundary'
import {ErrorBoundary} from './components/ErrorBoundary/ErrorBoundary'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {storiesOf} from '@storybook/react-native'
import React from 'react'
import {ActivityIndicator, Button, StyleSheet, Text, View} from 'react-native'
import {useQuery} from 'react-query'
import {useQuery} from '@tanstack/react-query'

import {QueryProvider} from '../../../.storybook/decorators'
import {errorMessages} from '../../kernel/i18n/global-messages'
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/components/Boundary/Boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from 'react-error-boundary'
import {useIntl} from 'react-intl'
import {ActivityIndicator, Image, LayoutAnimation, StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native'
import {useQueryErrorResetBoundary} from 'react-query'
import {useQueryErrorResetBoundary} from '@tanstack/react-query'

import image from '../../assets/img/error.png'
import {LocalizableError} from '../../kernel/i18n/LocalizableError'
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/features/Auth/common/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react'
import {defineMessages, useIntl} from 'react-intl'
import {Alert, AppState, Platform} from 'react-native'
import RNKeychain from 'react-native-keychain'
import {useMutation, UseMutationOptions, useQuery, useQueryClient, UseQueryOptions} from 'react-query'
import {useMutation, UseMutationOptions, useQuery, useQueryClient, UseQueryOptions} from '@tanstack/react-query'

import {decryptData, encryptData} from '../../../kernel/encryption/encryption'
import globalMessages from '../../../kernel/i18n/global-messages'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useMutation, UseMutationOptions} from 'react-query'
import {useMutation, UseMutationOptions} from '@tanstack/react-query'

import {useWalletManager} from '../../WalletManager/context/WalletManagerProvider'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useMutationWithInvalidations} from '@yoroi/common'
import {UseMutationOptions} from 'react-query'
import {UseMutationOptions} from '@tanstack/react-query'

import {YoroiWallet} from '../../../yoroi-wallets/cardano/types'
import {useWalletManager} from '../../WalletManager/context/WalletManagerProvider'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {DecoratorFunction} from '@storybook/addons'
import {storiesOf} from '@storybook/react-native'
import {claimManagerMockInstances, ClaimProvider, mocksState} from '@yoroi/claim'
import * as React from 'react'
import {QueryClientProvider} from 'react-query'
import {QueryClientProvider} from '@tanstack/react-query'

import {queryClientFixture} from '../../../kernel/fixtures/fixtures'
import {mocks as walletMocks} from '../../../yoroi-wallets/mocks/wallet'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common'
import {Chain} from '@yoroi/types'
import * as React from 'react'
import {useQuery} from 'react-query'
import {useQuery} from '@tanstack/react-query'

import {GradientWarning} from '../../../components/ChainWarning/GradientWarning'
import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {DappConnection, useDappConnector} from '@yoroi/dapp-connector'
import {Chain} from '@yoroi/types'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {isBoolean, useAsyncStorage} from '@yoroi/common'
import * as React from 'react'
import {useMutation, UseMutationOptions, useQuery, UseQueryOptions} from 'react-query'
import {useMutation, UseMutationOptions, useQuery, UseQueryOptions} from '@tanstack/react-query'

import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {useEffect} from 'react'
import {StyleSheet, View} from 'react-native'
import {TouchableOpacity} from 'react-native-gesture-handler'
import {SafeAreaView} from 'react-native-safe-area-context'
import {useQuery} from 'react-query'
import {useQuery} from '@tanstack/react-query'
import {z} from 'zod'

import {Button} from '../../../../components/Button/Button'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common'
import {UseMutationOptions} from 'react-query'
import {UseMutationOptions} from '@tanstack/react-query'

import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet'
import {storageKeyShowBuyBannerSmall, storageRootExchange} from './constants'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {isNumber, parseNumber, useAsyncStorage} from '@yoroi/common'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {useBalances} from '../../../yoroi-wallets/hooks'
import {Amounts, asQuantity, Quantities} from '../../../yoroi-wallets/utils/utils'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react'
import {Alert, StyleSheet, Text, View} from 'react-native'
import DeviceInfo from 'react-native-device-info'
import {SafeAreaView} from 'react-native-safe-area-context'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {Button} from '../../../components/Button/Button'
import {Space} from '../../../components/Space/Space'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {defineMessages, useIntl} from 'react-intl'
import {Platform, Pressable, StyleSheet, Switch, View} from 'react-native'
import {ScrollView} from 'react-native-gesture-handler'
import {SafeAreaView} from 'react-native-safe-area-context'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {Button} from '../../../components/Button/Button'
import {Space} from '../../../components/Space/Space'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useAsyncStorage} from '@yoroi/common'
import {useCallback} from 'react'
import {useMutation, useQuery, useQueryClient} from 'react-query'
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'

import {agreementDate} from '../../../kernel/config'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme'
import React from 'react'
import {ActivityIndicator, StyleSheet, View} from 'react-native'
import Markdown from 'react-native-markdown-display'
import {useQuery} from 'react-query'
import {useQuery} from '@tanstack/react-query'

import {Spacer} from '../../../components/Spacer/Spacer'
import {LanguageCode} from '../../../kernel/i18n/languages'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {useTheme} from '@yoroi/theme'
import React from 'react'
import {ActivityIndicator, StyleSheet, View} from 'react-native'
import Markdown from 'react-native-markdown-display'
import {useQuery} from 'react-query'
import {useQuery} from '@tanstack/react-query'

import {Spacer} from '../../../components/Spacer/Spacer'
import {LanguageCode} from '../../../kernel/i18n/languages'
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/features/Menu/Menu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {storiesOf} from '@storybook/react-native'
import * as React from 'react'
import {QueryClient, QueryClientProvider} from 'react-query'
import {QueryClient, QueryClientProvider} from '@tanstack/react-query'

import {mocks} from '../../yoroi-wallets/mocks/wallet'
import {WalletManagerProviderMock} from '../../yoroi-wallets/mocks/WalletManagerProviderMock'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {isPrimaryToken} from '@yoroi/portfolio'
import {Portfolio} from '@yoroi/types'
import {freeze, produce} from 'immer'
import React from 'react'
import {useQuery, useQueryClient} from 'react-query'
import {useQuery, useQueryClient} from '@tanstack/react-query'
import {merge, switchMap} from 'rxjs'

import {time} from '../../../kernel/constants'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

interface IDAppPortfolioBalance {
quantity: bigint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Portfolio} from '@yoroi/types'
import {ImageSourcePropType} from 'react-native'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {getDappFallbackLogo} from '../../../Discover/common/helpers'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ImageSourcePropType} from 'react-native'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {getDappFallbackLogo} from '../../../Discover/common/helpers'
import {IAsset, mockAmount} from './useGetLiquidityPool'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {isRight} from '@yoroi/common'
import {isPrimaryToken} from '@yoroi/portfolio'
import {Chain, Portfolio} from '@yoroi/types'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {supportedCurrencies, time} from '../../../../kernel/constants'
import {useLanguage} from '../../../../kernel/i18n'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type Portfolio} from '@yoroi/types'
import {ImageSourcePropType} from 'react-native'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import AdaLogo from '../../../../assets/img/ada.png'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ImageSourcePropType} from 'react-native'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import AdaLogo from '../../../../assets/img/ada.png'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Portfolio} from '@yoroi/types'
import {Image} from 'expo-image'
import {useMutation} from 'react-query'
import {useMutation} from '@tanstack/react-query'

import {useSelectedNetwork} from '../../../WalletManager/common/hooks/useSelectedNetwork'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createUnknownTokenInfo, isPrimaryToken} from '@yoroi/portfolio'
import {Portfolio} from '@yoroi/types'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {isBoolean, parseSafe, useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common'
import {UseMutationOptions, useQuery, UseQueryOptions} from 'react-query'
import {UseMutationOptions, useQuery, UseQueryOptions} from '@tanstack/react-query'

import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Catalyst, useCatalyst} from '@yoroi/staking'
import {App} from '@yoroi/types'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {time} from '../../../kernel/constants'
import {throwLoggedError} from '../../../kernel/logger/helpers/throw-logged-error'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {useTheme} from '@yoroi/theme'
import React from 'react'
import {ActivityIndicator, ScrollView, StyleSheet, View, ViewProps} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'
import {useMutation, UseMutationOptions} from 'react-query'
import {useMutation, UseMutationOptions} from '@tanstack/react-query'

import {Button} from '../../../../components/Button/Button'
import {BACKSPACE, NumericKeyboard} from '../../../../components/NumericKeyboard'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {normalizeToAddress} from '@emurgo/yoroi-lib/dist/internals/utils/addresses'
import {useTransfer} from '@yoroi/transfer'
import * as React from 'react'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {CardanoMobile} from '../../../yoroi-wallets/wallets'
import {useSelectedWallet} from '../../WalletManager/common/hooks/useSelectedWallet'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {isDomain, isNameServer, isResolvableDomain, useResolverCryptoAddresses}
import {useTransfer} from '@yoroi/transfer'
import {Resolver} from '@yoroi/types'
import * as React from 'react'
import {useQueryClient} from 'react-query'
import {useQueryClient} from '@tanstack/react-query'

export const useSendReceiver = () => {
const queryClient = useQueryClient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {defineMessages, useIntl} from 'react-intl'
import {StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native'
import {FlatList} from 'react-native-gesture-handler'
import {SafeAreaView} from 'react-native-safe-area-context'
import {useMutation} from 'react-query'
import {useMutation} from '@tanstack/react-query'

import {Boundary} from '../../../../components/Boundary/Boundary'
import {Button} from '../../../../components/Button/Button'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {useTheme} from '@yoroi/theme'
import React from 'react'
import {Platform, StyleSheet, Text, View} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'
import {UseMutationOptions, useQuery, UseQueryOptions} from 'react-query'
import {UseMutationOptions, useQuery, UseQueryOptions} from '@tanstack/react-query'

import {Boundary} from '../../../components/Boundary/Boundary'
import {Button} from '../../../components/Button/Button'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'
import {defineMessages, useIntl} from 'react-intl'
import {ScrollView, StyleSheet, TextInput as RNTextInput, View, ViewProps} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'
import {MutationOptions, useMutation} from 'react-query'
import {MutationOptions, useMutation} from '@tanstack/react-query'

import {Button} from '../../../components/Button/Button'
import {KeyboardAvoidingView} from '../../../components/KeyboardAvoidingView/KeyboardAvoidingView'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {parseSafe, useAsyncStorage} from '@yoroi/common'
import React from 'react'
import {useMutation, UseMutationOptions, useQuery, useQueryClient} from 'react-query'
import {useMutation, UseMutationOptions, useQuery, useQueryClient} from '@tanstack/react-query'

import {configCurrencies, supportedCurrencies} from '../../../kernel/constants'
import {usePrimaryTokenActivity} from '../../../yoroi-wallets/cardano/usePrimaryTokenActivity'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
ViewProps,
} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'
import {useMutation} from 'react-query'
import {useMutation} from '@tanstack/react-query'

import {Button} from '../../../components/Button/Button'
import {CopyButton} from '../../../components/CopyButton'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {parseSafe, useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common'
import {UseMutationOptions, useQuery} from 'react-query'
import {UseMutationOptions, useQuery} from '@tanstack/react-query'

const useReadPrivacyMode = () => {
const storage = useAsyncStorage()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {isBoolean, useAsyncStorage, useMutationWithInvalidations} from '@yoroi/common'
import {useEffect, useState} from 'react'
import {NativeModules, Platform} from 'react-native'
import {useQuery} from 'react-query'
import {useQuery} from '@tanstack/react-query'

const {FlagSecure} = NativeModules

Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/features/Swap/common/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createTypeGuardFromSchema, parseSafe} from '@yoroi/common'
import {useTheme} from '@yoroi/theme'
import {HW} from '@yoroi/types'
import {SwapApi} from '@yoroi/types/src/swap/api'
import {useMutation, UseMutationOptions} from 'react-query'
import {useMutation, UseMutationOptions} from '@tanstack/react-query'
import {z} from 'zod'

import {normalisePtId} from '../../../kernel/helpers/normalisePtId'
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/features/Swap/common/useSwapTx.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useMutationWithInvalidations} from '@yoroi/common'
import {useSwap} from '@yoroi/swap'
import {UseMutationOptions} from 'react-query'
import {UseMutationOptions} from '@tanstack/react-query'

import {YoroiEntry, YoroiUnsignedTx} from '../../../yoroi-wallets/types/yoroi'
import {splitStringInto64CharArray} from '../../../yoroi-wallets/utils/utils'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {action} from '@storybook/addon-actions'
import {storiesOf} from '@storybook/react-native'
import React from 'react'
import {QueryClient, QueryClientProvider} from 'react-query'
import {QueryClient, QueryClientProvider} from '@tanstack/react-query'

import {mocks} from '../../../../yoroi-wallets/mocks/wallet'
import {WalletManagerProviderMock} from '../../../../yoroi-wallets/mocks/WalletManagerProviderMock'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Chain} from '@yoroi/types'
import {useQuery, UseQueryOptions} from 'react-query'
import {useQuery, UseQueryOptions} from '@tanstack/react-query'

import {useSelectedNetwork} from './useSelectedNetwork'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Wallet} from '@yoroi/types'
import {useMutation, UseMutationOptions} from 'react-query'
import {useMutation, UseMutationOptions} from '@tanstack/react-query'

import {useWalletManager} from '../../context/WalletManagerProvider'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {HW, Wallet} from '@yoroi/types'
import {useMutation, UseMutationOptions} from 'react-query'
import {useMutation, UseMutationOptions} from '@tanstack/react-query'

import {useWalletManager} from '../../context/WalletManagerProvider'

Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/kernel/fixtures/fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {QueryClient} from 'react-query'
import {QueryClient} from '@tanstack/react-query'

export const queryClientFixture = () =>
new QueryClient({
Expand Down
Loading

0 comments on commit 9955858

Please sign in to comment.