ci(release): publish latest release

parent 6f70e0b1
IPFS hash of the deployment:
- CIDv0: `QmTpccVs1zJ53DxsUVGfYDtekJLEkYkcz7ytv7ztQLAQoK`
- CIDv1: `bafybeicrorjzrhlzqcfsojgjsfofublb2gz6s3nl7v2r2vefkxe5ws7w6i`
- CIDv0: `QmSR8nYexuW3tYLMY62XR3PCG7tcT9QWpeVkHNX6wnZn3p`
- CIDv1: `bafybeib4stith4o7l5dyd5uejt25qoxfndl57qj2gfc5sgpsmpe6lcb3y4`
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
......@@ -10,15 +10,54 @@ You can also access the Uniswap Interface from an IPFS gateway.
Your Uniswap settings are never remembered across different URLs.
IPFS gateways:
- https://bafybeicrorjzrhlzqcfsojgjsfofublb2gz6s3nl7v2r2vefkxe5ws7w6i.ipfs.dweb.link/
- https://bafybeicrorjzrhlzqcfsojgjsfofublb2gz6s3nl7v2r2vefkxe5ws7w6i.ipfs.cf-ipfs.com/
- [ipfs://QmTpccVs1zJ53DxsUVGfYDtekJLEkYkcz7ytv7ztQLAQoK/](ipfs://QmTpccVs1zJ53DxsUVGfYDtekJLEkYkcz7ytv7ztQLAQoK/)
- https://bafybeib4stith4o7l5dyd5uejt25qoxfndl57qj2gfc5sgpsmpe6lcb3y4.ipfs.dweb.link/
- https://bafybeib4stith4o7l5dyd5uejt25qoxfndl57qj2gfc5sgpsmpe6lcb3y4.ipfs.cf-ipfs.com/
- [ipfs://QmSR8nYexuW3tYLMY62XR3PCG7tcT9QWpeVkHNX6wnZn3p/](ipfs://QmSR8nYexuW3tYLMY62XR3PCG7tcT9QWpeVkHNX6wnZn3p/)
### 5.28.1 (2024-05-22)
## 5.29.0 (2024-05-22)
### Features
* **web:** [multichain] show limits page in disabled state (#8164) df50ab0
* **web:** add PDP rich link previews (#8003) 564b6e1
* **web:** avoid fetching redundant on-chain receipts (#7508) 0cc8511
* **web:** unicon v2 education label (#8339) 1487fbd
* **web:** update wallet connect modal's color mode with app theme (#7993) 38a9308
### Bug Fixes
* **web:** lowercase unicon flag 626ec60
* **web:** add null check to OSCollectionsFetcher (#8188) e5077c0
* **web:** Allow viewing pool mgmt pages when disconnected (#8239) 0ac09da
* **web:** change gap on landing page (#8175) f98a7e8
* **web:** change You pay and You receive to Buy and Sell (#8198) 601d1d9
* **web:** chart dot grid size (#8085) cf94701
* **web:** check client chain for undefined (#8215) 03697e7
* **web:** check for supported network on pools page (#8224) 5c7d58d
* **web:** filtering out spam on send (#8386) (#8405) 2775043
* **web:** fix limits price parsing bug in different locales (#8199) b9613d9
* **web:** fix SEO metatags (#8286) c294e33
* **web:** hotfixing mouseover bug (#8402) 8c5cf28
* **web:** lowercase unicon flag 02dcbf7
* **web:** prevent connection from hanging when iframed - staging (#8394) 80ed62c
* **web:** set initial user state in cypress tests using localStorage (#8189) 941d8fe
* **web:** Show unsupported network in navbar (#8181) 7746ac4
* **web:** support multichain input params (#8250) 110976e
* **web:** window.ethereum fallback on mobile [prod] (#8261) 8b791cc
### Tests
* **web:** remove explicit blocknumbers (#8162) 4a83a6f
### Code Refactoring
* **web:** refactor NFT sell flow to use wagmi (#7636) 2ebaf2c
* **web:** screen size hooks (#8100) 9593763
* **web:** Use wagmi for add/remove liquidity and collecting fees (#7641) 6448ae2
* **web:** use wagmi for NFT Buys (#7633) f472ce0
* **web:** Use wagmi for Swap and Limit Order flow (#7779) 832d7ff
web/5.28.1
\ No newline at end of file
web/5.29.0
\ No newline at end of file
......@@ -29,7 +29,11 @@ class RNEthersRSModule(reactContext: ReactApplicationContext) : ReactContextBase
override fun getName() = "RNEthersRS"
@ReactMethod fun getMnemonicIds(promise: Promise) {
promise.resolve(ethersRs.mnemonicIds)
val array = WritableNativeArray()
ethersRs.mnemonicIds.forEach {
array.pushString(it)
}
promise.resolve(array)
}
@ReactMethod fun importMnemonic(mnemonic: String, promise: Promise) {
......
......@@ -28,10 +28,10 @@ class RnEthersRs(applicationContext: Context) {
)
}
val mnemonicIds: Array<String>
val mnemonicIds: List<String>
get() = keychain.all.keys.map {
key -> key.replace(ENTIRE_MNEMONIC_PREFIX, "")
}.toTypedArray()
}
/**
* Imports a mnemonic and returns the associated address.
......
import { by, element, expect } from 'detox'
import { TestWallet } from 'e2e/utils/fixtures'
import { ElementName } from 'wallet/src/telemetry/constants'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
export function CreateNewWallet(): void {
it('creates a new wallet', async () => {
......
import { by, element, expect } from 'detox'
import { TestWallet } from 'e2e/utils/fixtures'
import { ElementName } from 'wallet/src/telemetry/constants'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
export async function CreateNewWallet(): Promise<void> {
// Selects "Create a new wallet" option on the landing screen
......
import { by, element, expect } from 'detox'
import { TestWallet } from 'e2e/utils/fixtures'
import { ElementName } from 'wallet/src/telemetry/constants'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
export async function ImportWallet(): Promise<void> {
// Selects "Add an existing wallet" option on the landing screen
......
import { by, element, expect } from 'detox'
import { TestWatchedWallet } from 'e2e/utils/fixtures'
import { ElementName } from 'wallet/src/telemetry/constants'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
export async function WatchWallet(): Promise<void> {
// Selects "Add an existing wallet" option on the landing screen
......
import { by, element, expect } from 'detox'
import { TestWatchedWallet } from 'e2e/utils/fixtures'
import { ElementName } from 'wallet/src/telemetry/constants'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
export async function SwapBasicInteractions(): Promise<void> {
// Navigate to swap screen
......
......@@ -33,7 +33,7 @@
"link:assets": "react-native-asset",
"graphql:generate:swift": "cd ios && ./Pods/Apollo/apollo-ios-cli generate",
"hardhat": "hardhat node",
"check:circular": "../../scripts/check-circular-imports.sh ./src/app/App.tsx 8",
"check:circular": "../../scripts/check-circular-imports.sh ./src/app/App.tsx 7",
"ios": "yarn ios:prebuild && SKIP_BUNDLING=1 react-native run-ios",
"ios:prebuild": "yarn graphql:generate:swift && cd ios/WidgetsCore/MobileSchema && rm -rf !(README.md) && cd ../../.. && yarn graphql:generate:swift && yarn env:local:copy:swift",
"ios:smol": "SKIP_BUNDLING=1 react-native run-ios --simulator=\"iPhone SE (3rd generation)\"",
......@@ -131,7 +131,6 @@
"react-native-pager-view": "6.0.1",
"react-native-permissions": "3.6.0",
"react-native-reanimated": "3.8.1",
"react-native-restart": "0.0.27",
"react-native-safe-area-context": "4.9.0",
"react-native-screens": "3.30.1",
"react-native-splash-screen": "3.3.0",
......@@ -184,12 +183,10 @@
"postinstall-postinstall": "2.1.0",
"react-devtools": "4.28.0",
"react-dom": "18.2.0",
"react-native-apollo-devtools-client": "1.0.4",
"react-native-asset": "2.1.1",
"react-native-clean-project": "4.0.1",
"react-native-dotenv": "3.2.0",
"react-native-flipper": "0.212.0",
"react-native-mmkv-flipper-plugin": "1.0.0",
"react-native-monorepo-tools": "1.2.1",
"react-native-svg-transformer": "1.3.0",
"react-test-renderer": "18.2.0",
......
......@@ -2,16 +2,17 @@ import { ApolloProvider } from '@apollo/client'
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet'
import * as Sentry from '@sentry/react-native'
import { PerformanceProfiler, RenderPassReport } from '@shopify/react-native-performance'
import { MMKVWrapper } from 'apollo3-cache-persist'
import { PropsWithChildren, default as React, StrictMode, useCallback, useEffect } from 'react'
import { I18nextProvider } from 'react-i18next'
import { LogBox, NativeModules, StatusBar } from 'react-native'
import appsFlyer from 'react-native-appsflyer'
import { getUniqueId } from 'react-native-device-info'
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import { MMKV } from 'react-native-mmkv'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { enableFreeze } from 'react-native-screens'
import { PersistGate } from 'redux-persist/integration/react'
import { ErrorBoundary } from 'src/app/ErrorBoundary'
import { MobileWalletNavigationProvider } from 'src/app/MobileWalletNavigationProvider'
import { useAppDispatch, useAppSelector } from 'src/app/hooks'
import { AppModals } from 'src/app/modals/AppModals'
......@@ -19,20 +20,16 @@ import { NavigationContainer } from 'src/app/navigation/NavigationContainer'
import { useIsPartOfNavigationTree } from 'src/app/navigation/hooks'
import { AppStackNavigator } from 'src/app/navigation/navigation'
import { persistor, store } from 'src/app/store'
import Trace from 'src/components/Trace/Trace'
import { TraceUserProperties } from 'src/components/Trace/TraceUserProperties'
import { OfflineBanner } from 'src/components/banners/OfflineBanner'
// eslint-disable-next-line no-restricted-imports
import { usePersistedApolloClient } from 'src/data/usePersistedApolloClient'
import { initAppsFlyer } from 'src/features/analytics/appsflyer'
import { LockScreenContextProvider } from 'src/features/authentication/lockScreenContext'
import { BiometricContextProvider } from 'src/features/biometrics/context'
import { NotificationToastWrapper } from 'src/features/notifications/NotificationToastWrapper'
import { initOneSignal } from 'src/features/notifications/Onesignal'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { shouldLogScreen } from 'src/features/telemetry/directLogScreens'
import { selectAllowAnalytics } from 'src/features/telemetry/selectors'
import { selectCustomEndpoint } from 'src/features/tweaks/selectors'
import {
processWidgetEvents,
setAccountAddressesUserDefaults,
......@@ -53,6 +50,9 @@ import { WALLET_EXPERIMENTS } from 'uniswap/src/features/gating/experiments'
import { WALLET_FEATURE_FLAG_NAMES } from 'uniswap/src/features/gating/flags'
import { loadStatsigOverrides } from 'uniswap/src/features/gating/overrides/customPersistedOverrides'
import { Statsig, StatsigProvider } from 'uniswap/src/features/gating/sdk/statsig'
import Trace from 'uniswap/src/features/telemetry/Trace'
import { MobileEventName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { UnitagUpdaterContextProvider } from 'uniswap/src/features/unitags/context'
import i18n from 'uniswap/src/i18n/i18n'
import { CurrencyId } from 'uniswap/src/types/currency'
......@@ -61,6 +61,9 @@ import { registerConsoleOverrides } from 'utilities/src/logger/console'
import { logger } from 'utilities/src/logger/logger'
import { useAsyncData } from 'utilities/src/react/hooks'
import { AnalyticsNavigationContextProvider } from 'utilities/src/telemetry/trace/AnalyticsNavigationContext'
import { ErrorBoundary } from 'wallet/src/components/ErrorBoundary/ErrorBoundary'
// eslint-disable-next-line no-restricted-imports
import { usePersistedApolloClient } from 'wallet/src/data/apollo/usePersistedApolloClient'
import { initFirebaseAppCheck } from 'wallet/src/features/appCheck'
import { useCurrentAppearanceSetting } from 'wallet/src/features/appearance/hooks'
import { selectFavoriteTokens } from 'wallet/src/features/favorites/selectors'
......@@ -185,12 +188,19 @@ function SentryTags({ children }: PropsWithChildren): JSX.Element {
return <>{children}</>
}
const MAX_CACHE_SIZE_IN_BYTES = 1024 * 1024 * 25 // 25 MB
// Ensures redux state is available inside usePersistedApolloClient for the custom endpoint
function AppOuter(): JSX.Element | null {
const client = usePersistedApolloClient()
const customEndpoint = useAppSelector(selectCustomEndpoint)
const client = usePersistedApolloClient({
storageWrapper: new MMKVWrapper(new MMKV()),
maxCacheSizeInBytes: MAX_CACHE_SIZE_IN_BYTES,
customEndpoint,
})
const onReportPrepared = useCallback((report: RenderPassReport) => {
sendMobileAnalyticsEvent(MobileEventName.PerformanceReport, report)
sendAnalyticsEvent(MobileEventName.PerformanceReport, report)
}, [])
if (!client) {
......
......@@ -5,9 +5,12 @@ import { exploreNavigationRef } from 'src/app/navigation/navigation'
import { useAppStackNavigation } from 'src/app/navigation/types'
import { closeModal, openModal } from 'src/features/modals/modalSlice'
import { HomeScreenTabIndex } from 'src/screens/HomeScreenTabIndex'
import { Screens } from 'src/screens/Screens'
import { FeatureFlags } from 'uniswap/src/features/gating/flags'
import { useFeatureFlag } from 'uniswap/src/features/gating/hooks'
import { ModalName, WalletEventName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { ShareableEntity } from 'uniswap/src/types/sharing'
import { logger } from 'utilities/src/logger/logger'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import {
......@@ -21,8 +24,6 @@ import {
getNavigateToSwapFlowArgsInitialState,
} from 'wallet/src/contexts/WalletNavigationContext'
import { useFiatOnRampIpAddressQuery } from 'wallet/src/features/fiatOnRamp/api'
import { sendWalletAnalyticsEvent } from 'wallet/src/telemetry'
import { ModalName, ShareableEntity, WalletEventName } from 'wallet/src/telemetry/constants'
import { getNftUrl, getTokenUrl } from 'wallet/src/utils/linking'
export function MobileWalletNavigationProvider({ children }: PropsWithChildren): JSX.Element {
......@@ -61,7 +62,7 @@ function useHandleShareNft(): (args: ShareNftArgs) => Promise<void> {
await Share.share({ message: url })
sendWalletAnalyticsEvent(WalletEventName.ShareButtonClicked, {
sendAnalyticsEvent(WalletEventName.ShareButtonClicked, {
entity: ShareableEntity.NftItem,
url,
})
......@@ -88,7 +89,7 @@ function useHandleShareToken(): (args: ShareTokenArgs) => Promise<void> {
try {
await Share.share({ message: url })
sendWalletAnalyticsEvent(WalletEventName.ShareButtonClicked, {
sendAnalyticsEvent(WalletEventName.ShareButtonClicked, {
entity: ShareableEntity.Token,
url,
})
......@@ -104,7 +105,7 @@ function useNavigateToHomepageTab(tab: HomeScreenTabIndex): () => void {
const { navigate } = useAppStackNavigation()
return useCallback((): void => {
navigate(Screens.Home, { tab })
navigate(MobileScreens.Home, { tab })
}, [navigate, tab])
}
......@@ -149,9 +150,9 @@ function useNavigateToTokenDetails(): (currencyId: string) => void {
return useCallback(
(currencyId: string): void => {
if (exploreNavigationRef.isFocused()) {
exploreNavigationRef.navigate(Screens.TokenDetails, { currencyId })
exploreNavigationRef.navigate(MobileScreens.TokenDetails, { currencyId })
} else {
appNavigation.navigate(Screens.TokenDetails, { currencyId })
appNavigation.navigate(MobileScreens.TokenDetails, { currencyId })
}
},
[appNavigation]
......@@ -163,7 +164,7 @@ function useNavigateToNftDetails(): (args: NavigateToNftItemArgs) => void {
return useCallback(
({ owner, address, tokenId, isSpam, fallbackData }: NavigateToNftItemArgs): void => {
navigation.navigate(Screens.NFTItem, {
navigation.navigate(MobileScreens.NFTItem, {
owner,
address,
tokenId,
......
......@@ -76,6 +76,7 @@ import { initialModalsState } from 'src/features/modals/modalSlice'
import { initialTelemetryState } from 'src/features/telemetry/slice'
import { initialTweaksState } from 'src/features/tweaks/slice'
import { initialWalletConnectState } from 'src/features/walletConnect/walletConnectSlice'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { ChainId } from 'uniswap/src/types/chains'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import {
......@@ -103,7 +104,6 @@ import {
SignerMnemonicAccount,
} from 'wallet/src/features/wallet/accounts/types'
import { initialWalletState, SwapProtectionSetting } from 'wallet/src/features/wallet/slice'
import { ModalName } from 'wallet/src/telemetry/constants'
import {
fiatPurchaseTransactionInfo,
signerMnemonicAccount,
......
......@@ -4,6 +4,7 @@
/* eslint-disable max-lines */
import dayjs from 'dayjs'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { ChainId } from 'uniswap/src/types/chains'
import { ExtensionOnboardingState } from 'wallet/src/features/behaviorHistory/slice'
import { toSupportedChainId } from 'wallet/src/features/chains/utils'
......@@ -18,7 +19,6 @@ import {
} from 'wallet/src/features/transactions/types'
import { Account, AccountType } from 'wallet/src/features/wallet/accounts/types'
import { SwapProtectionSetting } from 'wallet/src/features/wallet/slice'
import { ModalName } from 'wallet/src/telemetry/constants'
export const OLD_DEMO_ACCOUNT_ADDRESS = '0xdd0E380579dF30E38524F9477808d9eE37E2dEa6'
......
......@@ -2,7 +2,7 @@ import React from 'react'
import { AccountSwitcher } from 'src/app/modals/AccountSwitcherModal'
import { preloadedMobileState, preloadedModalsState } from 'src/test/fixtures'
import { cleanup, render } from 'src/test/test-utils'
import { ModalName } from 'wallet/src/telemetry/constants'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { ACCOUNT } from 'wallet/src/test/fixtures'
import { noOpFunction } from 'wallet/src/test/mocks'
......
......@@ -9,7 +9,6 @@ import { isCloudStorageAvailable } from 'src/features/CloudBackup/RNCloudStorage
import { closeModal, openModal } from 'src/features/modals/modalSlice'
import { selectModalState } from 'src/features/modals/selectModalState'
import { useCompleteOnboardingCallback } from 'src/features/onboarding/hooks'
import { OnboardingScreens, Screens } from 'src/screens/Screens'
import { useSagaStatus } from 'src/utils/useSagaStatus'
import {
Button,
......@@ -22,7 +21,9 @@ import {
} from 'ui/src'
import { Plus } from 'ui/src/components/icons'
import { spacing } from 'ui/src/theme'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { ImportType, OnboardingEntryPoint } from 'uniswap/src/types/onboarding'
import { MobileScreens, OnboardingScreens } from 'uniswap/src/types/screens/mobile'
import { isAndroid } from 'uniswap/src/utils/platform'
import { AddressDisplay } from 'wallet/src/components/accounts/AddressDisplay'
import { ActionSheetModal, MenuItemProp } from 'wallet/src/components/modals/ActionSheetModal'
......@@ -39,7 +40,6 @@ import {
import { useActiveAccountAddress, useNativeAccountExists } from 'wallet/src/features/wallet/hooks'
import { selectAllAccountsSorted } from 'wallet/src/features/wallet/selectors'
import { setAccountAsActive } from 'wallet/src/features/wallet/slice'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
import { openSettings } from 'wallet/src/utils/linking'
export function AccountSwitcherModal(): JSX.Element {
......@@ -109,8 +109,8 @@ export function AccountSwitcher({ onClose }: { onClose: () => void }): JSX.Eleme
}
dispatch(closeModal({ name: ModalName.AccountSwitcher }))
navigate(Screens.SettingsStack, {
screen: Screens.SettingsWallet,
navigate(MobileScreens.SettingsStack, {
screen: MobileScreens.SettingsWallet,
params: { address: activeAccountAddress },
})
}
......@@ -133,7 +133,7 @@ export function AccountSwitcher({ onClose }: { onClose: () => void }): JSX.Eleme
setCreatedAdditionalAccount(true)
} else {
// create pending account and place into welcome flow
navigate(Screens.OnboardingStack, {
navigate(MobileScreens.OnboardingStack, {
screen: OnboardingScreens.WelcomeWallet,
params: {
importType: ImportType.CreateNew,
......@@ -147,7 +147,7 @@ export function AccountSwitcher({ onClose }: { onClose: () => void }): JSX.Eleme
}
const onPressAddViewOnlyWallet = (): void => {
navigate(Screens.OnboardingStack, {
navigate(MobileScreens.OnboardingStack, {
screen: OnboardingScreens.WatchWallet,
params: {
importType: ImportType.Watch,
......@@ -162,7 +162,7 @@ export function AccountSwitcher({ onClose }: { onClose: () => void }): JSX.Eleme
if (hasImportedSeedPhrase && activeAccountAddress) {
dispatch(openModal({ name: ModalName.RemoveWallet }))
} else {
navigate(Screens.OnboardingStack, {
navigate(MobileScreens.OnboardingStack, {
screen: OnboardingScreens.SeedPhraseInput,
params: { importType: ImportType.SeedPhrase, entryPoint: OnboardingEntryPoint.Sidebar },
})
......@@ -195,7 +195,7 @@ export function AccountSwitcher({ onClose }: { onClose: () => void }): JSX.Eleme
return
}
navigate(Screens.OnboardingStack, {
navigate(MobileScreens.OnboardingStack, {
screen: OnboardingScreens.RestoreCloudBackupLoading,
params: { importType: ImportType.Restore, entryPoint: OnboardingEntryPoint.Sidebar },
})
......
......@@ -20,7 +20,7 @@ import { ScantasticModal } from 'src/features/scantastic/ScantasticModal'
import { ReceiveCryptoModal } from 'src/screens/ReceiveCryptoModal'
import { SettingsFiatCurrencyModal } from 'src/screens/SettingsFiatCurrencyModal'
import { SettingsLanguageModal } from 'src/screens/SettingsLanguageModal'
import { ModalName } from 'wallet/src/telemetry/constants'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
export function AppModals(): JSX.Element {
return (
......
......@@ -8,10 +8,10 @@ import { selectCustomEndpoint } from 'src/features/tweaks/selectors'
import { setCustomEndpoint } from 'src/features/tweaks/slice'
import { Accordion, Button, Flex, Text, useDeviceInsets } from 'ui/src'
import { spacing } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { AccordionHeader, GatingOverrides } from 'wallet/src/components/gating/GatingOverrides'
import { TextInput } from 'wallet/src/components/input/TextInput'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { ModalName } from 'wallet/src/telemetry/constants'
export function ExperimentsModal(): JSX.Element {
const insets = useDeviceInsets()
......
......@@ -3,8 +3,8 @@ import { useAppDispatch } from 'src/app/hooks'
import { ExploreStackNavigator } from 'src/app/navigation/navigation'
import { closeModal } from 'src/features/modals/modalSlice'
import { useSporeColors } from 'ui/src'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { ModalName } from 'wallet/src/telemetry/constants'
export function ExploreModal(): JSX.Element {
const colors = useSporeColors()
......
import { ExploreStackParamList } from 'src/app/navigation/types'
import { Screens } from 'src/screens/Screens'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
type InnerExploreStackParamList = Omit<ExploreStackParamList, Screens.Explore>
type InnerExploreStackParamList = Omit<ExploreStackParamList, MobileScreens.Explore>
// The ExploreModalState allows a Screen and its Params to be defined, except for the initial Explore screen.
// This workaround facilitates navigation to any screen within the ExploreStack from outside.
......
......@@ -4,8 +4,8 @@ import { StyleSheet } from 'react-native'
import 'react-native-reanimated'
import { Button, Flex, Image, Text, useIsDarkMode } from 'ui/src'
import { EXTENSION_PROMO_MODAL_DARK, EXTENSION_PROMO_MODAL_LIGHT } from 'ui/src/assets'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { ModalName } from 'wallet/src/telemetry/constants'
export function ExtensionPromoModal({ onClose }: { onClose: () => void }): JSX.Element {
const { t } = useTranslation()
......
......@@ -9,10 +9,10 @@ import {
import { closeModal } from 'src/features/modals/modalSlice'
import { selectModalState } from 'src/features/modals/selectModalState'
import { useWalletRestore } from 'src/features/wallet/hooks'
import { useSwapPrefilledState } from 'wallet/src/features/transactions/swap/hooks/useSwapPrefilledState'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { updateSwapStartTimestamp } from 'wallet/src/features/timing/slice'
import { SwapFlow } from 'wallet/src/features/transactions/swap/SwapFlow'
import { ModalName } from 'wallet/src/telemetry/constants'
import { updateSwapStartTimestamp } from 'wallet/src/telemetry/timing/slice'
import { useSwapPrefilledState } from 'wallet/src/features/transactions/swap/hooks/useSwapPrefilledState'
export function SwapModal(): JSX.Element {
const appDispatch = useAppDispatch()
......
......@@ -7,8 +7,8 @@ import { TransferFlow as TransferFlowRewrite } from 'src/features/transactions/t
import { useSporeColors } from 'ui/src'
import { FeatureFlags } from 'uniswap/src/features/gating/flags'
import { useFeatureFlag } from 'uniswap/src/features/gating/hooks'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { ModalName } from 'wallet/src/telemetry/constants'
export function TransferTokenModal(): JSX.Element {
const colors = useSporeColors()
......
......@@ -14,10 +14,10 @@ import {
} from 'ui/src'
import { RightArrow } from 'ui/src/components/icons'
import { spacing } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { UniconGradient } from 'wallet/src/components/accounts/AccountIcon'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { setHasViewedUniconV2IntroModal } from 'wallet/src/features/behaviorHistory/slice'
import { ModalName } from 'wallet/src/telemetry/constants'
interface UniconsV2ModalProps {
address: string
......
import { useTranslation } from 'react-i18next'
import { navigate } from 'src/app/navigation/rootNavigation'
import { closeModal, openModal } from 'src/features/modals/modalSlice'
import { OnboardingScreens, Screens } from 'src/screens/Screens'
import { Button, Flex, Text, useIsDarkMode } from 'ui/src'
import ViewOnlyWalletDark from 'ui/src/assets/graphics/view-only-wallet-dark.svg'
import ViewOnlyWalletLight from 'ui/src/assets/graphics/view-only-wallet-light.svg'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { ImportType, OnboardingEntryPoint } from 'uniswap/src/types/onboarding'
import { MobileScreens, OnboardingScreens } from 'uniswap/src/types/screens/mobile'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { useActiveAccountAddress, useNativeAccountExists } from 'wallet/src/features/wallet/hooks'
import { useAppDispatch } from 'wallet/src/state'
import { ModalName } from 'wallet/src/telemetry/constants'
const WALLET_IMAGE_ASPECT_RATIO = 327 / 215
......@@ -28,7 +28,7 @@ export function ViewOnlyExplainerModal(): JSX.Element {
if (hasImportedSeedPhrase && activeAccountAddress) {
dispatch(openModal({ name: ModalName.RemoveWallet }))
} else {
navigate(Screens.OnboardingStack, {
navigate(MobileScreens.OnboardingStack, {
screen: OnboardingScreens.SeedPhraseInput,
params: { importType: ImportType.SeedPhrase, entryPoint: OnboardingEntryPoint.Sidebar },
})
......
......@@ -3,7 +3,7 @@ import { Text } from 'react-native'
import { LazyModalRenderer } from 'src/app/modals/utils'
import { preloadedMobileState, preloadedModalsState } from 'src/test/fixtures'
import { renderWithProviders } from 'src/test/render'
import { ModalName } from 'wallet/src/telemetry/constants'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
describe(LazyModalRenderer, () => {
it('renders null when modal is not open', () => {
......
......@@ -14,8 +14,6 @@ import {
import { useAppDispatch } from 'src/app/hooks'
import { pulseAnimation } from 'src/components/buttons/utils'
import { openModal } from 'src/features/modals/modalSlice'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { Screens } from 'src/screens/Screens'
import {
AnimatedFlex,
Flex,
......@@ -30,11 +28,13 @@ import {
} from 'ui/src'
import { Search } from 'ui/src/components/icons'
import { borderRadii, fonts } from 'ui/src/theme'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { isAndroid, isIOS } from 'uniswap/src/utils/platform'
import { useHighestBalanceNativeCurrencyId } from 'wallet/src/features/dataApi/balances'
import { prepareSwapFormState } from 'wallet/src/features/transactions/swap/utils'
import { useActiveAccountAddressWithThrow } from 'wallet/src/features/wallet/hooks'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
import { opacify } from 'wallet/src/utils/colors'
export const NAV_BAR_HEIGHT_XS = 52
......@@ -44,8 +44,8 @@ export const SWAP_BUTTON_HEIGHT = 56
const SWAP_BUTTON_SHADOW_OFFSET = { width: 0, height: 4 }
function sendSwapPressAnalyticsEvent(): void {
sendMobileAnalyticsEvent(SharedEventName.ELEMENT_CLICKED, {
screen: Screens.Home,
sendAnalyticsEvent(SharedEventName.ELEMENT_CLICKED, {
screen: MobileScreens.Home,
element: ElementName.Swap,
})
}
......
......@@ -9,14 +9,14 @@ import React, { FC, PropsWithChildren, useCallback, useState } from 'react'
import { Linking } from 'react-native'
import { useAppDispatch } from 'src/app/hooks'
import { RootParamList } from 'src/app/navigation/types'
import Trace from 'src/components/Trace/Trace'
import { openDeepLink } from 'src/features/deepLinking/handleDeepLinkSaga'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { getEventParams } from 'src/features/telemetry/constants'
import { DIRECT_LOG_ONLY_SCREENS } from 'src/features/telemetry/directLogScreens'
import { getEventParams } from 'src/features/telemetry/utils'
import { processWidgetEvents } from 'src/features/widgets/widgets'
import { AppScreen } from 'src/screens/Screens'
import { useSporeColors } from 'ui/src'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import Trace from 'uniswap/src/features/telemetry/Trace'
import { MobileAppScreen } from 'uniswap/src/types/screens/mobile'
import { useAsyncData } from 'utilities/src/react/hooks'
import { sleep } from 'utilities/src/time/timing'
......@@ -32,7 +32,7 @@ export const NavigationContainer: FC<PropsWithChildren<Props>> = ({
onReady,
}: PropsWithChildren<Props>) => {
const colors = useSporeColors()
const [routeName, setRouteName] = useState<AppScreen>()
const [routeName, setRouteName] = useState<MobileAppScreen>()
const [routeParams, setRouteParams] = useState<Record<string, unknown> | undefined>()
const [logImpression, setLogImpression] = useState<boolean>(false)
......@@ -48,17 +48,18 @@ export const NavigationContainer: FC<PropsWithChildren<Props>> = ({
}}
onReady={(): void => {
onReady(navigationRef)
sendMobileAnalyticsEvent(SharedEventName.APP_LOADED)
sendAnalyticsEvent(SharedEventName.APP_LOADED)
// Process widget events on app load
processWidgetEvents().catch(() => undefined)
// setting initial route name for telemetry
const initialRoute = navigationRef.getCurrentRoute()?.name as AppScreen
const initialRoute = navigationRef.getCurrentRoute()?.name as MobileAppScreen
setRouteName(initialRoute)
}}
onStateChange={(): void => {
const previousRouteName = routeName
const currentRouteName: AppScreen = navigationRef.getCurrentRoute()?.name as AppScreen
const currentRouteName: MobileAppScreen = navigationRef.getCurrentRoute()
?.name as MobileAppScreen
if (
currentRouteName &&
......@@ -67,7 +68,7 @@ export const NavigationContainer: FC<PropsWithChildren<Props>> = ({
) {
const currentRouteParams = getEventParams(
currentRouteName,
navigationRef.getCurrentRoute()?.params as RootParamList[AppScreen]
navigationRef.getCurrentRoute()?.params as RootParamList[MobileAppScreen]
)
setLogImpression(true)
setRouteName(currentRouteName)
......
......@@ -3,8 +3,8 @@ import { useCallback, useContext } from 'react'
import { navigate as rootNavigate } from 'src/app/navigation/rootNavigation'
import { useAppStackNavigation, useExploreStackNavigation } from 'src/app/navigation/types'
import { HomeScreenTabIndex } from 'src/screens/HomeScreenTabIndex'
import { Screens } from 'src/screens/Screens'
import { useTransactionListLazyQuery } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
/**
* Utility hook to simplify navigating to Activity screen.
......@@ -29,7 +29,7 @@ export function useEagerActivityNavigation(): {
)
const navigate = useCallback(
() => navigation.navigate(Screens.Home, { tab: HomeScreenTabIndex.Activity }),
() => navigation.navigate(MobileScreens.Home, { tab: HomeScreenTabIndex.Activity }),
[navigation]
)
......@@ -57,7 +57,7 @@ export function useEagerExternalProfileNavigation(): {
const navigate = useCallback(
(address: string) => {
navigation.navigate(Screens.ExternalProfile, { address })
navigation.navigate(MobileScreens.ExternalProfile, { address })
},
[navigation]
)
......@@ -83,7 +83,7 @@ export function useEagerExternalProfileRootNavigation(): {
)
const navigate = useCallback(async (address: string, callback?: () => void) => {
await rootNavigate(Screens.ExternalProfile, { address })
await rootNavigate(MobileScreens.ExternalProfile, { address })
callback?.()
}, [])
......
......@@ -46,7 +46,6 @@ import { ManualBackupScreen } from 'src/screens/Onboarding/ManualBackupScreen'
import { NotificationsSetupScreen } from 'src/screens/Onboarding/NotificationsSetupScreen'
import { SecuritySetupScreen } from 'src/screens/Onboarding/SecuritySetupScreen'
import { WelcomeWalletScreen } from 'src/screens/Onboarding/WelcomeWalletScreen'
import { FiatOnRampScreens, OnboardingScreens, Screens, UnitagScreens } from 'src/screens/Screens'
import { SettingsAppearanceScreen } from 'src/screens/SettingsAppearanceScreen'
import { SettingsBiometricAuthScreen } from 'src/screens/SettingsBiometricAuthScreen'
import { SettingsCloudBackupPasswordConfirmScreen } from 'src/screens/SettingsCloudBackupPasswordConfirmScreen'
......@@ -67,6 +66,12 @@ import { spacing } from 'ui/src/theme'
import { FeatureFlags } from 'uniswap/src/features/gating/flags'
import { useFeatureFlag } from 'uniswap/src/features/gating/hooks'
import { OnboardingEntryPoint } from 'uniswap/src/types/onboarding'
import {
FiatOnRampScreens,
MobileScreens,
OnboardingScreens,
UnitagScreens,
} from 'uniswap/src/types/screens/mobile'
import { useActiveAccountWithThrow } from 'wallet/src/features/wallet/hooks'
import { selectFinishedOnboarding } from 'wallet/src/features/wallet/selectors'
......@@ -85,49 +90,55 @@ function SettingsStackGroup(): JSX.Element {
fullScreenGestureEnabled: true,
animation: 'slide_from_right',
}}>
<SettingsStack.Screen component={SettingsScreen} name={Screens.Settings} />
<SettingsStack.Screen component={SettingsWallet} name={Screens.SettingsWallet} />
<SettingsStack.Screen component={SettingsWalletEdit} name={Screens.SettingsWalletEdit} />
<SettingsStack.Screen component={SettingsScreen} name={MobileScreens.Settings} />
<SettingsStack.Screen component={SettingsWallet} name={MobileScreens.SettingsWallet} />
<SettingsStack.Screen
component={SettingsWalletEdit}
name={MobileScreens.SettingsWalletEdit}
/>
<SettingsStack.Screen
component={SettingsWalletManageConnection}
name={Screens.SettingsWalletManageConnection}
name={MobileScreens.SettingsWalletManageConnection}
/>
<SettingsStack.Screen component={WebViewScreen} name={Screens.WebView} />
<SettingsStack.Screen component={DevScreen} name={Screens.Dev} />
<SettingsStack.Screen component={WebViewScreen} name={MobileScreens.WebView} />
<SettingsStack.Screen component={DevScreen} name={MobileScreens.Dev} />
<SettingsStack.Screen
component={SettingsBiometricAuthScreen}
name={Screens.SettingsBiometricAuth}
name={MobileScreens.SettingsBiometricAuth}
/>
<SettingsStack.Screen
component={SettingsViewSeedPhraseScreen}
name={Screens.SettingsViewSeedPhrase}
name={MobileScreens.SettingsViewSeedPhrase}
/>
<SettingsStack.Screen
component={SettingsCloudBackupPasswordCreateScreen}
name={Screens.SettingsCloudBackupPasswordCreate}
name={MobileScreens.SettingsCloudBackupPasswordCreate}
/>
<SettingsStack.Screen
component={SettingsCloudBackupPasswordConfirmScreen}
name={Screens.SettingsCloudBackupPasswordConfirm}
name={MobileScreens.SettingsCloudBackupPasswordConfirm}
/>
<SettingsStack.Screen
component={SettingsCloudBackupProcessingScreen}
name={Screens.SettingsCloudBackupProcessing}
name={MobileScreens.SettingsCloudBackupProcessing}
/>
<SettingsStack.Screen
component={SettingsCloudBackupStatus}
name={Screens.SettingsCloudBackupStatus}
name={MobileScreens.SettingsCloudBackupStatus}
/>
<SettingsStack.Screen
component={SettingsAppearanceScreen}
name={Screens.SettingsAppearance}
name={MobileScreens.SettingsAppearance}
/>
<SettingsStack.Screen
component={SettingsPrivacyScreen}
name={MobileScreens.SettingsPrivacy}
/>
<SettingsStack.Screen component={SettingsPrivacyScreen} name={Screens.SettingsPrivacy} />
</SettingsStack.Navigator>
)
}
export function WrappedHomeScreen(props: AppStackScreenProp<Screens.Home>): JSX.Element {
export function WrappedHomeScreen(props: AppStackScreenProp<MobileScreens.Home>): JSX.Element {
const activeAccount = useActiveAccountWithThrow()
// Adding `key` forces a full re-render and re-mount when switching accounts
// to avoid issues with wrong cached data being shown in some memoized components that are already mounted.
......@@ -156,24 +167,24 @@ export function ExploreStackNavigator(): JSX.Element {
}}>
<HorizontalEdgeGestureTarget />
<ExploreStack.Navigator
initialRouteName={Screens.Explore}
initialRouteName={MobileScreens.Explore}
screenOptions={{
...navOptions.noHeader,
fullScreenGestureEnabled: true,
gestureEnabled: true,
animation: 'slide_from_right',
}}>
<ExploreStack.Screen component={ExploreScreen} name={Screens.Explore} />
<ExploreStack.Screen component={ExploreScreen} name={MobileScreens.Explore} />
<ExploreStack.Group
screenOptions={{ contentStyle: { backgroundColor: colors.surface1.val } }}>
<ExploreStack.Screen name={Screens.ExternalProfile}>
<ExploreStack.Screen name={MobileScreens.ExternalProfile}>
{(props): JSX.Element => <ExternalProfileScreen {...props} renderedInModal />}
</ExploreStack.Screen>
<ExploreStack.Screen name={Screens.NFTCollection}>
<ExploreStack.Screen name={MobileScreens.NFTCollection}>
{(props): JSX.Element => <NFTCollectionScreen {...props} renderedInModal />}
</ExploreStack.Screen>
<ExploreStack.Screen component={NFTItemScreen} name={Screens.NFTItem} />
<ExploreStack.Screen component={TokenDetailsScreen} name={Screens.TokenDetails} />
<ExploreStack.Screen component={NFTItemScreen} name={MobileScreens.NFTItem} />
<ExploreStack.Screen component={TokenDetailsScreen} name={MobileScreens.TokenDetails} />
</ExploreStack.Group>
</ExploreStack.Navigator>
</NavigationContainer>
......@@ -360,25 +371,27 @@ export function AppStackNavigator(): JSX.Element {
gestureEnabled: true,
animation: 'slide_from_right',
}}>
{finishedOnboarding && <AppStack.Screen component={WrappedHomeScreen} name={Screens.Home} />}
{finishedOnboarding && (
<AppStack.Screen component={WrappedHomeScreen} name={MobileScreens.Home} />
)}
<AppStack.Screen
component={OnboardingStackNavigator}
name={Screens.OnboardingStack}
name={MobileScreens.OnboardingStack}
navigationKey={
finishedOnboarding
? OnboardingEntryPoint.Sidebar.valueOf()
: OnboardingEntryPoint.FreshInstallOrReplace.valueOf()
}
/>
<AppStack.Screen component={UnitagStackNavigator} name={Screens.UnitagStack} />
<AppStack.Screen component={ExternalProfileScreen} name={Screens.ExternalProfile} />
<AppStack.Screen component={TokenDetailsScreen} name={Screens.TokenDetails} />
<AppStack.Screen component={NFTItemScreen} name={Screens.NFTItem} />
<AppStack.Screen component={NFTCollectionScreen} name={Screens.NFTCollection} />
<AppStack.Screen component={WebViewScreen} name={Screens.WebView} />
<AppStack.Screen component={SettingsStackGroup} name={Screens.SettingsStack} />
<AppStack.Screen component={UnitagStackNavigator} name={MobileScreens.UnitagStack} />
<AppStack.Screen component={ExternalProfileScreen} name={MobileScreens.ExternalProfile} />
<AppStack.Screen component={TokenDetailsScreen} name={MobileScreens.TokenDetails} />
<AppStack.Screen component={NFTItemScreen} name={MobileScreens.NFTItem} />
<AppStack.Screen component={NFTCollectionScreen} name={MobileScreens.NFTCollection} />
<AppStack.Screen component={WebViewScreen} name={MobileScreens.WebView} />
<AppStack.Screen component={SettingsStackGroup} name={MobileScreens.SettingsStack} />
<AppStack.Group screenOptions={navOptions.presentationModal}>
<AppStack.Screen component={EducationScreen} name={Screens.Education} />
<AppStack.Screen component={EducationScreen} name={MobileScreens.Education} />
</AppStack.Group>
</AppStack.Navigator>
)
......
......@@ -7,9 +7,14 @@ import {
import { NativeStackNavigationProp, NativeStackScreenProps } from '@react-navigation/native-stack'
import { EducationContentType } from 'src/components/education'
import { HomeScreenTabIndex } from 'src/screens/HomeScreenTabIndex'
import { FiatOnRampScreens, OnboardingScreens, Screens, UnitagScreens } from 'src/screens/Screens'
import { UnitagClaim } from 'uniswap/src/features/unitags/types'
import { ImportType, OnboardingEntryPoint } from 'uniswap/src/types/onboarding'
import {
FiatOnRampScreens,
MobileScreens,
OnboardingScreens,
UnitagScreens,
} from 'uniswap/src/types/screens/mobile'
import { NFTItem } from 'wallet/src/features/nfts/types'
type NFTItemScreenParams = {
......@@ -26,13 +31,13 @@ export type CloudBackupFormParams = {
}
export type ExploreStackParamList = {
[Screens.Explore]: undefined
[Screens.ExternalProfile]: {
[MobileScreens.Explore]: undefined
[MobileScreens.ExternalProfile]: {
address: string
}
[Screens.NFTItem]: NFTItemScreenParams
[Screens.NFTCollection]: { collectionAddress: string }
[Screens.TokenDetails]: {
[MobileScreens.NFTItem]: NFTItemScreenParams
[MobileScreens.NFTCollection]: { collectionAddress: string }
[MobileScreens.TokenDetails]: {
currencyId: string
}
}
......@@ -44,22 +49,22 @@ export type FiatOnRampStackParamList = {
}
export type SettingsStackParamList = {
[Screens.Dev]: undefined
[Screens.Settings]: undefined
[Screens.SettingsAppearance]: undefined
[Screens.SettingsBiometricAuth]: undefined
[Screens.SettingsCloudBackupPasswordConfirm]: CloudBackupFormParams
[Screens.SettingsCloudBackupPasswordCreate]: { address: Address }
[Screens.SettingsCloudBackupProcessing]: CloudBackupFormParams
[Screens.SettingsCloudBackupStatus]: { address: Address }
[Screens.SettingsHelpCenter]: undefined
[Screens.SettingsLanguage]: undefined
[Screens.SettingsPrivacy]: undefined
[Screens.SettingsViewSeedPhrase]: { address: Address; walletNeedsRestore?: boolean }
[Screens.SettingsWallet]: { address: Address }
[Screens.SettingsWalletEdit]: { address: Address }
[Screens.SettingsWalletManageConnection]: { address: Address }
[Screens.WebView]: { headerTitle: string; uriLink: string }
[MobileScreens.Dev]: undefined
[MobileScreens.Settings]: undefined
[MobileScreens.SettingsAppearance]: undefined
[MobileScreens.SettingsBiometricAuth]: undefined
[MobileScreens.SettingsCloudBackupPasswordConfirm]: CloudBackupFormParams
[MobileScreens.SettingsCloudBackupPasswordCreate]: { address: Address }
[MobileScreens.SettingsCloudBackupProcessing]: CloudBackupFormParams
[MobileScreens.SettingsCloudBackupStatus]: { address: Address }
[MobileScreens.SettingsHelpCenter]: undefined
[MobileScreens.SettingsLanguage]: undefined
[MobileScreens.SettingsPrivacy]: undefined
[MobileScreens.SettingsViewSeedPhrase]: { address: Address; walletNeedsRestore?: boolean }
[MobileScreens.SettingsWallet]: { address: Address }
[MobileScreens.SettingsWalletEdit]: { address: Address }
[MobileScreens.SettingsWalletManageConnection]: { address: Address }
[MobileScreens.WebView]: { headerTitle: string; uriLink: string }
}
export type OnboardingStackBaseParams = {
......@@ -68,7 +73,10 @@ export type OnboardingStackBaseParams = {
unitagClaim?: UnitagClaim
}
export type UnitagEntryPoint = OnboardingScreens.Landing | Screens.Home | Screens.Settings
export type UnitagEntryPoint =
| OnboardingScreens.Landing
| MobileScreens.Home
| MobileScreens.Settings
export type SharedUnitagScreenParams = {
[UnitagScreens.ClaimUnitag]: {
......@@ -117,27 +125,27 @@ export type UnitagStackParamList = SharedUnitagScreenParams & {
[UnitagScreens.EditProfile]: {
address: Address
unitag: string
entryPoint: UnitagScreens.UnitagConfirmation | Screens.SettingsWallet
entryPoint: UnitagScreens.UnitagConfirmation | MobileScreens.SettingsWallet
}
}
export type AppStackParamList = {
[Screens.Education]: {
[MobileScreens.Education]: {
type: EducationContentType
} & OnboardingStackBaseParams
[Screens.Home]?: { tab?: HomeScreenTabIndex }
[Screens.OnboardingStack]: NavigatorScreenParams<OnboardingStackParamList>
[Screens.SettingsStack]: NavigatorScreenParams<SettingsStackParamList>
[Screens.UnitagStack]: NavigatorScreenParams<UnitagStackParamList>
[Screens.TokenDetails]: {
[MobileScreens.Home]?: { tab?: HomeScreenTabIndex }
[MobileScreens.OnboardingStack]: NavigatorScreenParams<OnboardingStackParamList>
[MobileScreens.SettingsStack]: NavigatorScreenParams<SettingsStackParamList>
[MobileScreens.UnitagStack]: NavigatorScreenParams<UnitagStackParamList>
[MobileScreens.TokenDetails]: {
currencyId: string
}
[Screens.NFTItem]: NFTItemScreenParams
[Screens.NFTCollection]: { collectionAddress: string }
[Screens.ExternalProfile]: {
[MobileScreens.NFTItem]: NFTItemScreenParams
[MobileScreens.NFTCollection]: { collectionAddress: string }
[MobileScreens.ExternalProfile]: {
address: string
}
[Screens.WebView]: { headerTitle: string; uriLink: string }
[MobileScreens.WebView]: { headerTitle: string; uriLink: string }
}
export type AppStackNavigationProp = NativeStackNavigationProp<AppStackParamList>
......
import { PersistState } from 'redux-persist'
import { apolloClientRef } from 'src/data/usePersistedApolloClient'
import { appRatingWatcherSaga } from 'src/features/appRating/saga'
import { cloudBackupsManagerSaga } from 'src/features/CloudBackup/saga'
import { appRatingWatcherSaga } from 'src/features/appRating/saga'
import { deepLinkWatcher } from 'src/features/deepLinking/handleDeepLinkSaga'
import { firebaseDataWatcher } from 'src/features/firebase/firebaseDataSaga'
import { modalWatcher } from 'src/features/modals/saga'
......@@ -10,6 +9,7 @@ import { restoreMnemonicCompleteWatcher } from 'src/features/wallet/saga'
import { walletConnectSaga } from 'src/features/walletConnect/saga'
import { signWcRequestSaga } from 'src/features/walletConnect/signWcRequestSaga'
import { call, delay, select, spawn } from 'typed-redux-saga'
import { apolloClientRef } from 'wallet/src/data/apollo/usePersistedApolloClient'
import { appLanguageWatcherSaga } from 'wallet/src/features/language/saga'
import {
swapActions,
......@@ -43,7 +43,7 @@ import {
importAccountSaga,
importAccountSagaName,
} from 'wallet/src/features/wallet/import/importAccountSaga'
import { getMonitoredSagaReducers, MonitoredSaga } from 'wallet/src/state/saga'
import { MonitoredSaga, getMonitoredSagaReducers } from 'wallet/src/state/saga'
const REHYDRATION_STATUS_POLLING_INTERVAL = 50
......
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { ExtensionOnboardingState } from 'wallet/src/features/behaviorHistory/slice'
import { initialFiatCurrencyState } from 'wallet/src/features/fiatCurrency/slice'
import { initialLanguageState } from 'wallet/src/features/language/slice'
import { SwapProtectionSetting } from 'wallet/src/features/wallet/slice'
import { ModalName } from 'wallet/src/telemetry/constants'
// only add fields that are persisted
export const initialSchema = {
......
......@@ -8,9 +8,9 @@ import {
} from 'react-native-reanimated'
import { TIME_RANGES } from 'src/components/PriceExplorer/constants'
import { useChartDimensions } from 'src/components/PriceExplorer/useChartDimensions'
import Trace from 'src/components/Trace/Trace'
import { AnimatedFlex, AnimatedText, Flex, TouchableArea, useSporeColors } from 'ui/src'
import { HistoryDuration } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import Trace from 'uniswap/src/features/telemetry/Trace'
interface Props {
label: string
......
import { HistoryDuration } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
import i18n from 'uniswap/src/i18n/i18n'
import { ElementName } from 'wallet/src/telemetry/constants'
export const NUM_GRAPHS = 5
......
......@@ -9,11 +9,11 @@ import { Flex, HapticFeedback, Text, TouchableArea, useIsDarkMode, useSporeColor
import Scan from 'ui/src/assets/icons/receive.svg'
import ScanQRIcon from 'ui/src/assets/icons/scan.svg'
import { iconSizes } from 'ui/src/theme'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import { WalletQRCode } from 'wallet/src/components/QRCodeScanner/WalletQRCode'
import { selectActiveAccountAddress } from 'wallet/src/features/wallet/selectors'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
type Props = {
onClose: () => void
......
......@@ -6,13 +6,13 @@ import { RecipientScanModal } from 'src/components/RecipientSelect/RecipientScan
import { AnimatedFlex, Flex, Text, TouchableArea, useSporeColors } from 'ui/src'
import ScanQRIcon from 'ui/src/assets/icons/scan.svg'
import { iconSizes } from 'ui/src/theme'
import { useBottomSheetContext } from 'wallet/src/components/modals/BottomSheetContext'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
import { RecipientList } from 'wallet/src/components/RecipientSearch/RecipientList'
import { filterRecipientByNameAndAddress } from 'wallet/src/components/RecipientSearch/filter'
import { useRecipients } from 'wallet/src/components/RecipientSearch/hooks'
import { RecipientList } from 'wallet/src/components/RecipientSearch/RecipientList'
import { filterSections } from 'wallet/src/components/RecipientSearch/utils'
import { useBottomSheetContext } from 'wallet/src/components/modals/BottomSheetContext'
import { SearchBar } from 'wallet/src/features/search/SearchBar'
import { ElementName } from 'wallet/src/telemetry/constants'
interface RecipientSelectProps {
onSelectRecipient: (newRecipientAddress: string) => void
......
import React, { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Button, CheckBox, Flex, Text } from 'ui/src'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
import { SpinningLoader } from 'wallet/src/components/loading/SpinningLoader'
import { ElementName } from 'wallet/src/telemetry/constants'
export function RemoveLastMnemonicWalletFooter({
onPress,
......
......@@ -11,10 +11,11 @@ import { Delay } from 'src/components/layout/Delayed'
import { useBiometricAppSettings, useBiometricPrompt } from 'src/features/biometrics/hooks'
import { closeModal } from 'src/features/modals/modalSlice'
import { selectModalState } from 'src/features/modals/selectModalState'
import { OnboardingScreens, Screens } from 'src/screens/Screens'
import { AnimatedFlex, Button, ColorTokens, Flex, Text, ThemeKeys, useSporeColors } from 'ui/src'
import { iconSizes, opacify } from 'ui/src/theme'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { ImportType, OnboardingEntryPoint } from 'uniswap/src/types/onboarding'
import { MobileScreens, OnboardingScreens } from 'uniswap/src/types/screens/mobile'
import { SpinningLoader } from 'wallet/src/components/loading/SpinningLoader'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import {
......@@ -24,7 +25,6 @@ import {
import { useAccounts } from 'wallet/src/features/wallet/hooks'
import { selectSignerMnemonicAccounts } from 'wallet/src/features/wallet/selectors'
import { setFinishedOnboarding } from 'wallet/src/features/wallet/slice'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
export function RemoveWalletModal(): JSX.Element | null {
const { t } = useTranslation()
......@@ -65,7 +65,7 @@ export function RemoveWalletModal(): JSX.Element | null {
navigateToOnboardingImportMethod()
} else if (isReplacing) {
// there are account left and it's replacing, user has view-only accounts left
navigate(Screens.OnboardingStack, {
navigate(MobileScreens.OnboardingStack, {
screen: OnboardingScreens.ImportMethod,
params: {
importType: ImportType.NotYetSelected,
......
import { CommonActions } from '@react-navigation/core'
import { dispatchNavigationAction } from 'src/app/navigation/rootNavigation'
import { OnboardingScreens, Screens } from 'src/screens/Screens'
import { ImportType, OnboardingEntryPoint } from 'uniswap/src/types/onboarding'
import { MobileScreens, OnboardingScreens } from 'uniswap/src/types/screens/mobile'
// This fast-forwards user to the same app state as if
// they have pressed "Get Started" on Landing and should now see import method view
......@@ -11,7 +11,7 @@ export function navigateToOnboardingImportMethod(): void {
index: 0,
routes: [
{
name: Screens.OnboardingStack,
name: MobileScreens.OnboardingStack,
state: {
index: 1,
routes: [
......
......@@ -3,13 +3,13 @@ import { useTranslation } from 'react-i18next'
import { useAppDispatch } from 'src/app/hooks'
import { navigate } from 'src/app/navigation/rootNavigation'
import { closeAllModals, closeModal } from 'src/features/modals/modalSlice'
import { OnboardingScreens, Screens } from 'src/screens/Screens'
import { Button, Flex, Text, useSporeColors } from 'ui/src'
import LockIcon from 'ui/src/assets/icons/lock.svg'
import { iconSizes, opacify } from 'ui/src/theme'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { ImportType, OnboardingEntryPoint } from 'uniswap/src/types/onboarding'
import { MobileScreens, OnboardingScreens } from 'uniswap/src/types/screens/mobile'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
export function RestoreWalletModal(): JSX.Element | null {
const { t } = useTranslation()
......@@ -22,7 +22,7 @@ export function RestoreWalletModal(): JSX.Element | null {
const onRestore = (): void => {
dispatch(closeAllModals())
navigate(Screens.OnboardingStack, {
navigate(MobileScreens.OnboardingStack, {
screen: OnboardingScreens.RestoreCloudBackupLoading,
params: {
entryPoint: OnboardingEntryPoint.Sidebar,
......
import React from 'react'
import { useTranslation } from 'react-i18next'
import { useBiometricName } from 'src/features/biometrics/hooks'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { isAndroid } from 'uniswap/src/utils/platform'
import {
WarningModal,
WarningModalProps,
} from 'wallet/src/components/modals/WarningModal/WarningModal'
import { WarningSeverity } from 'wallet/src/features/transactions/WarningModal/types'
import { ModalName } from 'wallet/src/telemetry/constants'
type Props = {
isTouchIdDevice: boolean
......
......@@ -8,14 +8,14 @@ import {
SettingsStackParamList,
} from 'src/app/navigation/types'
import { openModal } from 'src/features/modals/modalSlice'
import { Screens } from 'src/screens/Screens'
import { Flex, Text, TouchableArea, useSporeColors } from 'ui/src'
import { RotatableChevron } from 'ui/src/components/icons'
import { iconSizes } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { Switch } from 'wallet/src/components/buttons/Switch'
import { Arrow } from 'wallet/src/components/icons/Arrow'
import { useAppDispatch } from 'wallet/src/state'
import { ModalName } from 'wallet/src/telemetry/constants'
import { openUri } from 'wallet/src/utils/linking'
export interface SettingsSection {
......@@ -31,7 +31,7 @@ export interface SettingsSectionItemComponent {
type SettingsModal = typeof ModalName.FiatCurrencySelector | typeof ModalName.LanguageSelector
export interface SettingsSectionItem {
screen?: keyof SettingsStackParamList | typeof Screens.OnboardingStack
screen?: keyof SettingsStackParamList | typeof MobileScreens.OnboardingStack
modal?: SettingsModal
screenProps?: ValueOf<SettingsStackParamList> | NavigatorScreenParams<OnboardingStackParamList>
externalLink?: string
......
......@@ -13,7 +13,6 @@ import {
TAB_VIEW_SCROLL_THROTTLE,
TabProps,
} from 'src/components/layout/TabHelpers'
import { Screens } from 'src/screens/Screens'
import {
AnimatedFlex,
Flex,
......@@ -24,6 +23,7 @@ import {
} from 'ui/src'
import { zIndices } from 'ui/src/theme'
import { CurrencyId } from 'uniswap/src/types/currency'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { isAndroid } from 'uniswap/src/utils/platform'
import { BaseCard } from 'wallet/src/components/BaseCard/BaseCard'
import { isError, isNonPollingRequestInFlight } from 'wallet/src/data/utils'
......@@ -194,7 +194,7 @@ export const TokenBalanceListInner = forwardRef<
interactive={balancesById !== undefined}
screenName={
// Marks the home screen as interactive when balances are defined
Screens.Home
MobileScreens.Home
}>
{!balancesById ? (
isNonPollingRequestInFlight(networkStatus) ? (
......
import React from 'react'
import { SvgProps } from 'react-native-svg'
import { useAppDispatch } from 'src/app/hooks'
import Trace from 'src/components/Trace/Trace'
import { Flex, IconProps, Text, TouchableArea, useSporeColors } from 'ui/src'
import CopyIcon from 'ui/src/assets/icons/copy-sheets.svg'
import { iconSizes } from 'ui/src/theme'
import Trace from 'uniswap/src/features/telemetry/Trace'
import { ElementNameType } from 'uniswap/src/features/telemetry/constants'
import { pushNotification } from 'wallet/src/features/notifications/slice'
import { AppNotificationType, CopyNotificationType } from 'wallet/src/features/notifications/types'
import { ElementNameType } from 'wallet/src/telemetry/constants'
import { setClipboard } from 'wallet/src/utils/clipboard'
import { openUri } from 'wallet/src/utils/linking'
......
......@@ -2,7 +2,7 @@ import React from 'react'
import { Flex, TouchableArea } from 'ui/src'
import SendIcon from 'ui/src/assets/icons/send-action.svg'
import { iconSizes } from 'ui/src/theme'
import { ElementName } from 'wallet/src/telemetry/constants'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
type Props = {
onPress: () => void
......
import React, { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { useTokenDetailsNavigation } from 'src/components/TokenDetails/hooks'
import Trace from 'src/components/Trace/Trace'
import { MobileEventName } from 'src/features/telemetry/constants'
import { Flex, Separator, Text, TouchableArea, useSporeColors } from 'ui/src'
import { iconSizes } from 'ui/src/theme'
import { PortfolioBalance } from 'uniswap/src/features/dataApi/types'
import Trace from 'uniswap/src/features/telemetry/Trace'
import { MobileEventName } from 'uniswap/src/features/telemetry/constants'
import { CurrencyId } from 'uniswap/src/types/currency'
import { NumberType } from 'utilities/src/format/types'
import { TokenLogo } from 'wallet/src/components/CurrencyLogo/TokenLogo'
......
import React from 'react'
import { useTranslation } from 'react-i18next'
import Trace from 'src/components/Trace/Trace'
import { Button, Flex, useSporeColors } from 'ui/src'
import { opacify, validColor } from 'ui/src/theme'
import { ElementName, ElementNameType, SectionName } from 'wallet/src/telemetry/constants'
import Trace from 'uniswap/src/features/telemetry/Trace'
import { ElementName, ElementNameType, SectionName } from 'uniswap/src/features/telemetry/constants'
import { getContrastPassingTextColor } from 'wallet/src/utils/colors'
function CTAButton({
......
......@@ -6,9 +6,9 @@ import { Flex, Text } from 'ui/src'
import GlobeIcon from 'ui/src/assets/icons/globe-filled.svg'
import TwitterIcon from 'ui/src/assets/icons/x-twitter.svg'
import { TokenDetailsScreenQuery } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
import { ChainId } from 'uniswap/src/types/chains'
import { CHAIN_INFO } from 'wallet/src/constants/chains'
import { ElementName } from 'wallet/src/telemetry/constants'
import {
currencyIdToAddress,
currencyIdToChain,
......
import { useCrossChainBalances, useTokenDetailsNavigation } from 'src/components/TokenDetails/hooks'
import { Screens } from 'src/screens/Screens'
import { preloadedMobileState } from 'src/test/fixtures'
import { act, renderHook, waitFor } from 'src/test/test-utils'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { currencyIdToContractInput } from 'wallet/src/features/dataApi/utils'
import {
SAMPLE_CURRENCY_ID_1,
......@@ -155,7 +155,7 @@ describe(useTokenDetailsNavigation, () => {
await act(() => result.current.navigate(SAMPLE_CURRENCY_ID_1))
expect(mockedNavigation.navigate).toHaveBeenCalledTimes(1)
expect(mockedNavigation.navigate).toHaveBeenNthCalledWith(1, Screens.TokenDetails, {
expect(mockedNavigation.navigate).toHaveBeenNthCalledWith(1, MobileScreens.TokenDetails, {
currencyId: SAMPLE_CURRENCY_ID_1,
})
})
......@@ -169,7 +169,7 @@ describe(useTokenDetailsNavigation, () => {
expect(mockedNavigation.pop).toHaveBeenCalledTimes(1)
expect(mockedNavigation.push).toHaveBeenCalledTimes(1)
expect(mockedNavigation.push).toHaveBeenNthCalledWith(1, Screens.TokenDetails, {
expect(mockedNavigation.push).toHaveBeenNthCalledWith(1, MobileScreens.TokenDetails, {
currencyId: SAMPLE_CURRENCY_ID_1,
})
})
......@@ -182,7 +182,7 @@ describe(useTokenDetailsNavigation, () => {
expect(mockedNavigation.pop).not.toHaveBeenCalled()
expect(mockedNavigation.push).toHaveBeenCalledTimes(1)
expect(mockedNavigation.push).toHaveBeenNthCalledWith(1, Screens.TokenDetails, {
expect(mockedNavigation.push).toHaveBeenNthCalledWith(1, MobileScreens.TokenDetails, {
currencyId: SAMPLE_CURRENCY_ID_1,
})
})
......
import { useCallback, useMemo } from 'react'
import { useAppStackNavigation } from 'src/app/navigation/types'
import { useBalances } from 'src/features/dataApi/balances'
import { Screens } from 'src/screens/Screens'
import {
Chain,
useTokenDetailsScreenLazyQuery,
} from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { PortfolioBalance } from 'uniswap/src/features/dataApi/types'
import { CurrencyId } from 'uniswap/src/types/currency'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { fromGraphQLChain } from 'wallet/src/features/chains/utils'
import { currencyIdToContractInput } from 'wallet/src/features/dataApi/utils'
import {
......@@ -80,14 +80,14 @@ export function useTokenDetailsNavigation(): {
if (navigation.canGoBack()) {
navigation.pop()
}
navigation.push(Screens.TokenDetails, { currencyId })
navigation.push(MobileScreens.TokenDetails, { currencyId })
},
[navigation]
)
const navigate = useCallback(
(currencyId: CurrencyId): void => {
navigation.navigate(Screens.TokenDetails, { currencyId })
navigation.navigate(MobileScreens.TokenDetails, { currencyId })
},
[navigation]
)
......
import { memo, PropsWithChildren } from 'react'
import { ManualPageViewScreen, MobileEventName } from 'src/features/telemetry/constants'
import { AppScreen } from 'src/screens/Screens'
import { TraceProps, Trace as UntypedTrace } from 'utilities/src/telemetry/trace/Trace'
import { ElementNameType, ModalNameType, SectionNameType } from 'wallet/src/telemetry/constants'
// Mobile specific version of ITraceContext
interface MobileTraceContext {
screen?: AppScreen | ManualPageViewScreen
section?: SectionNameType
modal?: ModalNameType
element?: ElementNameType
}
interface MobileTracePropsOverrides {
pressEvent?: MobileEventName
}
type MobileTraceProps = MobileTraceContext &
Omit<TraceProps, 'pressEvent'> &
MobileTracePropsOverrides
function _Trace({ children, ...rest }: PropsWithChildren<MobileTraceProps>): JSX.Element {
return <UntypedTrace {...rest}>{children}</UntypedTrace>
}
const Trace = memo(_Trace)
export default Trace
import { SharedEventName } from '@uniswap/analytics-events'
import React from 'react'
import { Route, TabView, TabViewProps } from 'react-native-tab-view'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { Screens } from 'src/screens/Screens'
import { SectionNameType } from 'wallet/src/telemetry/constants'
import { SectionNameType } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
type TraceRouteProps = { key: SectionNameType } & Route
......@@ -12,9 +12,9 @@ export default function TraceTabView<T extends TraceRouteProps>({
navigationState,
screenName,
...rest
}: TabViewProps<T> & { screenName: Screens }): JSX.Element {
}: TabViewProps<T> & { screenName: MobileScreens }): JSX.Element {
const onIndexChangeTrace = (index: number): void => {
sendMobileAnalyticsEvent(SharedEventName.PAGE_VIEWED, {
sendAnalyticsEvent(SharedEventName.PAGE_VIEWED, {
section: navigationState.routes[index]?.key,
screen: screenName,
})
......
......@@ -4,9 +4,10 @@ import renderer, { act } from 'react-test-renderer'
import * as appHooks from 'src/app/hooks'
import { TraceUserProperties } from 'src/components/Trace/TraceUserProperties'
import * as biometricHooks from 'src/features/biometrics/hooks'
import { AuthMethod, UserPropertyName } from 'src/features/telemetry/constants'
import { AuthMethod } from 'src/features/telemetry/utils'
import * as versionUtils from 'src/utils/version'
import * as useIsDarkModeFile from 'ui/src/hooks/useIsDarkMode'
import { MobileUserPropertyName } from 'uniswap/src/features/telemetry/user'
import { analytics } from 'utilities/src/telemetry/analytics/analytics'
import { FiatCurrency } from 'wallet/src/features/fiatCurrency/constants'
import * as fiatCurrencyHooks from 'wallet/src/features/fiatCurrency/hooks'
......@@ -23,6 +24,13 @@ function mockFn(module: any, func: string, returnValue: any): jest.SpyInstance<a
jest.mock('react-native/Libraries/Utilities/useColorScheme')
jest.mock('wallet/src/features/gating/userPropertyHooks')
jest.mock('wallet/src/features/wallet/Keyring/Keyring', () => {
return {
Keyring: {
getMnemonicIds: (): Promise<string[]> => Promise.resolve([]),
},
}
})
const address1 = '0x168fA52Da8A45cEb01318E72B299b2d6A17167BF'
const address2 = '0x168fA52Da8A45cEb01318E72B299b2d6A17167BD'
......@@ -94,34 +102,37 @@ describe('TraceUserProperties', () => {
})
// Check setUserProperty calls with correct values
expect(mocked).toHaveBeenCalledWith(UserPropertyName.AppVersion, '1.0.0.345')
expect(mocked).toHaveBeenCalledWith(UserPropertyName.DarkMode, true)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.ActiveWalletAddress, 'address')
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.AppVersion, '1.0.0.345')
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.DarkMode, true)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.ActiveWalletAddress, 'address')
expect(mocked).toHaveBeenCalledWith(
UserPropertyName.ActiveWalletType,
MobileUserPropertyName.ActiveWalletType,
AccountType.SignerMnemonic
)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.IsCloudBackedUp, true)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.IsPushEnabled, true)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.IsHideSmallBalancesEnabled, false)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.IsHideSpamTokensEnabled, true)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.WalletViewOnlyCount, 2)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.WalletSignerCount, 3)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.WalletSignerAccounts, [
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.IsCloudBackedUp, true)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.IsPushEnabled, true)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.IsHideSmallBalancesEnabled, false)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.IsHideSpamTokensEnabled, true)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.WalletViewOnlyCount, 2)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.WalletSignerCount, 3)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.WalletSignerAccounts, [
address1,
address2,
address3,
])
expect(mocked).toHaveBeenCalledWith(
UserPropertyName.WalletSwapProtectionSetting,
MobileUserPropertyName.WalletSwapProtectionSetting,
SwapProtectionSetting.On
)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.AppOpenAuthMethod, AuthMethod.FaceId)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.TransactionAuthMethod, AuthMethod.FaceId)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.Language, 'English')
expect(mocked).toHaveBeenCalledWith(UserPropertyName.Currency, 'USD')
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.AppOpenAuthMethod, AuthMethod.FaceId)
expect(mocked).toHaveBeenCalledWith(
MobileUserPropertyName.TransactionAuthMethod,
AuthMethod.FaceId
)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.Language, 'English')
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.Currency, 'USD')
expect(mocked).toHaveBeenCalledTimes(16)
expect(mocked).toHaveBeenCalledTimes(17)
})
it('sets user properties without active account', async () => {
......@@ -154,13 +165,16 @@ describe('TraceUserProperties', () => {
})
// Check setUserProperty calls with correct values
expect(mocked).toHaveBeenCalledWith(UserPropertyName.AppVersion, '1.0.0.345')
expect(mocked).toHaveBeenCalledWith(UserPropertyName.DarkMode, true)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.WalletViewOnlyCount, 0)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.WalletSignerCount, 0)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.AppOpenAuthMethod, AuthMethod.None)
expect(mocked).toHaveBeenCalledWith(UserPropertyName.TransactionAuthMethod, AuthMethod.None)
expect(mocked).toHaveBeenCalledTimes(10)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.AppVersion, '1.0.0.345')
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.DarkMode, true)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.WalletViewOnlyCount, 0)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.WalletSignerCount, 0)
expect(mocked).toHaveBeenCalledWith(MobileUserPropertyName.AppOpenAuthMethod, AuthMethod.None)
expect(mocked).toHaveBeenCalledWith(
MobileUserPropertyName.TransactionAuthMethod,
AuthMethod.None
)
expect(mocked).toHaveBeenCalledTimes(11)
})
})
......@@ -5,16 +5,17 @@ import {
useBiometricAppSettings,
useDeviceSupportsBiometricAuth,
} from 'src/features/biometrics/hooks'
import { setUserProperty } from 'src/features/telemetry'
import { UserPropertyName, getAuthMethod } from 'src/features/telemetry/constants'
import { selectAllowAnalytics } from 'src/features/telemetry/selectors'
import { getAuthMethod } from 'src/features/telemetry/utils'
import { getFullAppVersion } from 'src/utils/version'
import { useIsDarkMode } from 'ui/src'
import { MobileUserPropertyName, setUserProperty } from 'uniswap/src/features/telemetry/user'
import { isAndroid } from 'uniswap/src/utils/platform'
import { analytics } from 'utilities/src/telemetry/analytics/analytics'
import { useAppFiatCurrency } from 'wallet/src/features/fiatCurrency/hooks'
import { useGatingUserPropertyUsernames } from 'wallet/src/features/gating/userPropertyHooks'
import { useCurrentLanguageInfo } from 'wallet/src/features/language/hooks'
import { Keyring } from 'wallet/src/features/wallet/Keyring/Keyring'
import { BackupType } from 'wallet/src/features/wallet/accounts/types'
import {
useActiveAccount,
......@@ -45,10 +46,15 @@ export function TraceUserProperties(): null {
useGatingUserPropertyUsernames()
useEffect(() => {
setUserProperty(UserPropertyName.AppVersion, getFullAppVersion())
setUserProperty(MobileUserPropertyName.AppVersion, getFullAppVersion())
Keyring.getMnemonicIds() // Temporary to prepare for fix, should be removed in 1.28
.then((mnemonicIds) => {
setUserProperty(MobileUserPropertyName.MnemonicCount, mnemonicIds.length)
})
.catch(() => {})
if (isAndroid) {
NativeModules.AndroidDeviceModule.getPerformanceClass().then((perfClass: number) => {
setUserProperty(UserPropertyName.AndroidPerfClass, perfClass)
setUserProperty(MobileUserPropertyName.AndroidPerfClass, perfClass)
})
}
return () => {
......@@ -57,58 +63,61 @@ export function TraceUserProperties(): null {
}, [allowAnalytics])
useEffect(() => {
setUserProperty(UserPropertyName.WalletSwapProtectionSetting, swapProtectionSetting)
setUserProperty(MobileUserPropertyName.WalletSwapProtectionSetting, swapProtectionSetting)
}, [allowAnalytics, swapProtectionSetting])
useEffect(() => {
setUserProperty(UserPropertyName.DarkMode, isDarkMode)
setUserProperty(MobileUserPropertyName.DarkMode, isDarkMode)
}, [allowAnalytics, isDarkMode])
useEffect(() => {
setUserProperty(UserPropertyName.WalletSignerCount, signerAccounts.length)
setUserProperty(MobileUserPropertyName.WalletSignerCount, signerAccounts.length)
setUserProperty(
UserPropertyName.WalletSignerAccounts,
MobileUserPropertyName.WalletSignerAccounts,
signerAccounts.map((account) => account.address)
)
}, [allowAnalytics, signerAccounts])
useEffect(() => {
setUserProperty(UserPropertyName.WalletViewOnlyCount, viewOnlyAccounts.length)
setUserProperty(MobileUserPropertyName.WalletViewOnlyCount, viewOnlyAccounts.length)
}, [allowAnalytics, viewOnlyAccounts])
useEffect(() => {
if (!activeAccount) {
return
}
setUserProperty(UserPropertyName.ActiveWalletAddress, activeAccount.address)
setUserProperty(UserPropertyName.ActiveWalletType, activeAccount.type)
setUserProperty(MobileUserPropertyName.ActiveWalletAddress, activeAccount.address)
setUserProperty(MobileUserPropertyName.ActiveWalletType, activeAccount.type)
setUserProperty(
UserPropertyName.IsCloudBackedUp,
MobileUserPropertyName.IsCloudBackedUp,
Boolean(activeAccount.backups?.includes(BackupType.Cloud))
)
setUserProperty(UserPropertyName.IsPushEnabled, Boolean(activeAccount.pushNotificationsEnabled))
setUserProperty(
MobileUserPropertyName.IsPushEnabled,
Boolean(activeAccount.pushNotificationsEnabled)
)
setUserProperty(UserPropertyName.IsHideSmallBalancesEnabled, hideSmallBalances)
setUserProperty(UserPropertyName.IsHideSpamTokensEnabled, hideSpamTokens)
setUserProperty(MobileUserPropertyName.IsHideSmallBalancesEnabled, hideSmallBalances)
setUserProperty(MobileUserPropertyName.IsHideSpamTokensEnabled, hideSpamTokens)
}, [allowAnalytics, activeAccount, hideSmallBalances, hideSpamTokens])
useEffect(() => {
setUserProperty(
UserPropertyName.AppOpenAuthMethod,
MobileUserPropertyName.AppOpenAuthMethod,
getAuthMethod(biometricsAppSettingsState.requiredForAppAccess, touchId, faceId)
)
setUserProperty(
UserPropertyName.TransactionAuthMethod,
MobileUserPropertyName.TransactionAuthMethod,
getAuthMethod(biometricsAppSettingsState.requiredForTransactions, touchId, faceId)
)
}, [allowAnalytics, biometricsAppSettingsState, touchId, faceId])
useEffect(() => {
setUserProperty(UserPropertyName.Language, currentLanguage)
setUserProperty(MobileUserPropertyName.Language, currentLanguage)
}, [allowAnalytics, currentLanguage])
useEffect(() => {
setUserProperty(UserPropertyName.Currency, currentFiatCurrency)
setUserProperty(MobileUserPropertyName.Currency, currentFiatCurrency)
}, [allowAnalytics, currentFiatCurrency])
return null
......
......@@ -14,8 +14,8 @@ import {
import { AnimatedFlex, Flex, Text, TouchableArea, useDeviceDimensions } from 'ui/src'
import { Edit, Scan } from 'ui/src/components/icons'
import { spacing } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import { ModalName } from 'wallet/src/telemetry/constants'
type ConnectedDappsProps = {
sessions: WalletConnectSession[]
......
......@@ -8,6 +8,8 @@ import { wcWeb3Wallet } from 'src/features/walletConnect/saga'
import { WalletConnectSession, removeSession } from 'src/features/walletConnect/walletConnectSlice'
import { Button, Flex, Text } from 'ui/src'
import { iconSizes } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { WalletConnectEvent } from 'uniswap/src/types/walletConnect'
import { logger } from 'utilities/src/logger/logger'
import { ONE_SECOND_MS } from 'utilities/src/time/time'
import { NetworkLogo } from 'wallet/src/components/CurrencyLogo/NetworkLogo'
......@@ -16,8 +18,6 @@ import { CHAIN_INFO } from 'wallet/src/constants/chains'
import { pushNotification } from 'wallet/src/features/notifications/slice'
import { AppNotificationType } from 'wallet/src/features/notifications/types'
import { useActiveAccountAddressWithThrow } from 'wallet/src/features/wallet/hooks'
import { WalletConnectEvent } from 'wallet/src/features/walletConnect/types'
import { ModalName } from 'wallet/src/telemetry/constants'
interface DappConnectedNetworkModalProps {
session: WalletConnectSession
onClose: () => void
......
......@@ -12,14 +12,14 @@ import { WalletConnectSession, removeSession } from 'src/features/walletConnect/
import { disableOnPress } from 'src/utils/disableOnPress'
import { AnimatedTouchableArea, Flex, ImpactFeedbackStyle, Text, TouchableArea } from 'ui/src'
import { iconSizes, spacing } from 'ui/src/theme'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
import { WalletConnectEvent } from 'uniswap/src/types/walletConnect'
import { logger } from 'utilities/src/logger/logger'
import { ONE_SECOND_MS } from 'utilities/src/time/time'
import { NetworkLogos } from 'wallet/src/components/network/NetworkLogos'
import { pushNotification } from 'wallet/src/features/notifications/slice'
import { AppNotificationType } from 'wallet/src/features/notifications/types'
import { useActiveAccountAddressWithThrow } from 'wallet/src/features/wallet/hooks'
import { WalletConnectEvent } from 'wallet/src/features/walletConnect/types'
import { ElementName } from 'wallet/src/telemetry/constants'
export function DappConnectionItem({
session,
......
......@@ -3,10 +3,10 @@ import { StyleSheet } from 'react-native'
import { Flex } from 'ui/src'
import { borderRadii, iconSizes } from 'ui/src/theme'
import { CurrencyInfo } from 'uniswap/src/features/dataApi/types'
import { DappInfo } from 'uniswap/src/types/walletConnect'
import { CurrencyLogo } from 'wallet/src/components/CurrencyLogo/CurrencyLogo'
import { DappIconPlaceholder } from 'wallet/src/components/WalletConnect/DappIconPlaceholder'
import { ImageUri } from 'wallet/src/features/images/ImageUri'
import { DappInfo } from 'wallet/src/features/walletConnect/types'
export function DappHeaderIcon({
dapp,
......
......@@ -17,9 +17,9 @@ import { useDerivedValue } from 'react-native-reanimated'
import { ScrollDownOverlay } from 'src/components/WalletConnect/ModalWithOverlay/ScrollDownOverlay'
import { Button, Flex, useDeviceInsets } from 'ui/src'
import { spacing } from 'ui/src/theme'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { BottomSheetModalProps } from 'wallet/src/components/modals/BottomSheetModalProps'
import { ElementName } from 'wallet/src/telemetry/constants'
const MEASURE_LAYOUT_TIMEOUT = 100
......
......@@ -3,7 +3,7 @@ import React from 'react'
import { Trans } from 'react-i18next'
import { WalletConnectRequest } from 'src/features/walletConnect/walletConnectSlice'
import { Text } from 'ui/src'
import { EthMethod, UwULinkMethod } from 'wallet/src/features/walletConnect/types'
import { EthMethod, UwULinkMethod } from 'uniswap/src/types/walletConnect'
import { ValueType, getCurrencyAmount } from 'wallet/src/utils/getCurrencyAmount'
export function HeaderText({
......
......@@ -14,10 +14,10 @@ import { useNoYoloParser } from 'src/utils/useNoYoloParser'
import { Flex, Text, useSporeColors } from 'ui/src'
import { TextVariantTokens, iconSizes } from 'ui/src/theme'
import { ChainId } from 'uniswap/src/types/chains'
import { EthMethod, EthTransaction } from 'uniswap/src/types/walletConnect'
import { logger } from 'utilities/src/logger/logger'
import { toSupportedChainId } from 'wallet/src/features/chains/utils'
import { useENS } from 'wallet/src/features/ens/useENS'
import { EthMethod, EthTransaction } from 'wallet/src/features/walletConnect/types'
import { getValidAddress, shortenAddress } from 'wallet/src/utils/addresses'
import { ExplorerDataType, getExplorerLink } from 'wallet/src/utils/linking'
......
......@@ -7,14 +7,16 @@ import { UwuLinkErc20Request } from 'src/features/walletConnect/walletConnectSli
import { Flex, Text } from 'ui/src'
import { iconSizes } from 'ui/src/theme'
import { CurrencyInfo } from 'uniswap/src/features/dataApi/types'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { TokenLogo } from 'wallet/src/components/CurrencyLogo/TokenLogo'
import { SpinningLoader } from 'wallet/src/components/loading/SpinningLoader'
import { NetworkFee } from 'wallet/src/components/network/NetworkFee'
import { CHAIN_INFO } from 'wallet/src/constants/chains'
import { GasFeeResult } from 'wallet/src/features/gas/types'
import { useOnChainCurrencyBalance } from 'wallet/src/features/portfolio/api'
import { NativeCurrency } from 'wallet/src/features/tokens/NativeCurrency'
import { useCurrencyInfo } from 'wallet/src/features/tokens/useCurrencyInfo'
import { useActiveAccountAddressWithThrow } from 'wallet/src/features/wallet/hooks'
import { ModalName } from 'wallet/src/telemetry/constants'
import { buildCurrencyId } from 'wallet/src/utils/currencyId'
type Props = {
......@@ -23,9 +25,11 @@ type Props = {
onReject: () => void
request: UwuLinkErc20Request
hasSufficientGasFunds: boolean
gasFee: GasFeeResult
}
export function UwULinkErc20SendModal({
gasFee,
onClose,
onConfirm,
onReject,
......@@ -52,6 +56,7 @@ export function UwULinkErc20SendModal({
onReject={onReject}>
<UwULinkErc20SendModalContent
currencyInfo={currencyInfo}
gasFee={gasFee}
hasSufficientGasFunds={hasSufficientGasFunds}
hasSufficientTokenFunds={hasSufficientTokenFunds}
loading={!balance || !currencyInfo}
......@@ -62,12 +67,14 @@ export function UwULinkErc20SendModal({
}
function UwULinkErc20SendModalContent({
gasFee,
request,
loading,
currencyInfo,
hasSufficientGasFunds,
hasSufficientTokenFunds,
}: {
gasFee: GasFeeResult
request: UwuLinkErc20Request
loading: boolean
hasSufficientGasFunds: boolean
......@@ -124,6 +131,9 @@ function UwULinkErc20SendModalContent({
<Text>{symbol}</Text>
</Flex>
</Flex>
<Flex alignSelf="stretch" borderTopColor="$surface3" borderTopWidth={1} pt="$spacing16">
<NetworkFee chainId={chainId} gasFee={gasFee} />
</Flex>
{!hasSufficientGasFunds && (
<Text color="$DEP_accentWarning" pt="$spacing8" textAlign="center" variant="body3">
{t('walletConnect.request.error.insufficientFunds', {
......
......@@ -11,8 +11,6 @@ import {
} from 'src/components/WalletConnect/RequestModal/WalletConnectRequestModalContent'
import { useHasSufficientFunds } from 'src/components/WalletConnect/RequestModal/hooks'
import { useBiometricAppSettings, useBiometricPrompt } from 'src/features/biometrics/hooks'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { returnToPreviousApp } from 'src/features/walletConnect/WalletConnect'
import { wcWeb3Wallet } from 'src/features/walletConnect/saga'
import { selectDidOpenFromDeepLink } from 'src/features/walletConnect/selectors'
......@@ -21,17 +19,18 @@ import {
WalletConnectRequest,
isTransactionRequest,
} from 'src/features/walletConnect/walletConnectSlice'
import { useTransactionGasFee } from 'wallet/src/features/gas/hooks'
import { GasSpeed } from 'wallet/src/features/gas/types'
import { useIsBlocked, useIsBlockedActiveAddress } from 'wallet/src/features/trm/hooks'
import { useSignerAccounts } from 'wallet/src/features/wallet/hooks'
import { MobileEventName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import {
EthMethod,
UwULinkMethod,
WCEventType,
WCRequestOutcome,
} from 'wallet/src/features/walletConnect/types'
import { ModalName } from 'wallet/src/telemetry/constants'
} from 'uniswap/src/types/walletConnect'
import { useTransactionGasFee } from 'wallet/src/features/gas/hooks'
import { GasSpeed } from 'wallet/src/features/gas/types'
import { useIsBlocked, useIsBlockedActiveAddress } from 'wallet/src/features/trm/hooks'
import { useSignerAccounts } from 'wallet/src/features/wallet/hooks'
import { areAddressesEqual } from 'wallet/src/utils/addresses'
import { UwULinkErc20SendModal } from './UwULinkErc20SendModal'
......@@ -130,7 +129,7 @@ export function WalletConnectRequestModal({ onClose, request }: Props): JSX.Elem
rejectOnCloseRef.current = false
sendMobileAnalyticsEvent(MobileEventName.WalletConnectSheetCompleted, {
sendAnalyticsEvent(MobileEventName.WalletConnectSheetCompleted, {
request_type: isTransactionRequest(request)
? WCEventType.TransactionRequest
: WCEventType.SignRequest,
......@@ -184,7 +183,7 @@ export function WalletConnectRequestModal({ onClose, request }: Props): JSX.Elem
rejectOnCloseRef.current = false
sendMobileAnalyticsEvent(MobileEventName.WalletConnectSheetCompleted, {
sendAnalyticsEvent(MobileEventName.WalletConnectSheetCompleted, {
request_type: isTransactionRequest(request)
? WCEventType.TransactionRequest
: WCEventType.SignRequest,
......@@ -228,6 +227,7 @@ export function WalletConnectRequestModal({ onClose, request }: Props): JSX.Elem
if (request.type === UwULinkMethod.Erc20Send) {
return (
<UwULinkErc20SendModal
gasFee={gasFee}
hasSufficientGasFunds={hasSufficientFunds}
request={request}
onClose={handleClose}
......
......@@ -17,6 +17,7 @@ import {
import { Flex, Text, useSporeColors } from 'ui/src'
import AlertTriangle from 'ui/src/assets/icons/alert-triangle.svg'
import { iconSizes } from 'ui/src/theme'
import { EthMethod, isPrimaryTypePermit } from 'uniswap/src/types/walletConnect'
import { logger } from 'utilities/src/logger/logger'
import { BaseCard } from 'wallet/src/components/BaseCard/BaseCard'
import { AccountDetails } from 'wallet/src/components/accounts/AccountDetails'
......@@ -24,7 +25,6 @@ import { NetworkFee } from 'wallet/src/components/network/NetworkFee'
import { NetworkPill } from 'wallet/src/components/network/NetworkPill'
import { GasFeeResult } from 'wallet/src/features/gas/types'
import { BlockedAddressWarning } from 'wallet/src/features/trm/BlockedAddressWarning'
import { EthMethod, isPrimaryTypePermit } from 'wallet/src/features/walletConnect/types'
import { buildCurrencyId } from 'wallet/src/utils/currencyId'
const MAX_MODAL_MESSAGE_HEIGHT = 200
......
......@@ -9,8 +9,6 @@ import { ModalWithOverlay } from 'src/components/WalletConnect/ModalWithOverlay/
import { PendingConnectionSwitchAccountModal } from 'src/components/WalletConnect/ScanSheet/PendingConnectionSwitchAccountModal'
import { truncateQueryParams } from 'src/components/WalletConnect/ScanSheet/util'
import { LinkButton } from 'src/components/buttons/LinkButton'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { returnToPreviousApp } from 'src/features/walletConnect/WalletConnect'
import { wcWeb3Wallet } from 'src/features/walletConnect/saga'
import { selectDidOpenFromDeepLink } from 'src/features/walletConnect/selectors'
......@@ -23,7 +21,10 @@ import {
import { Flex, Text, TouchableArea, useSporeColors } from 'ui/src'
import { Check, X } from 'ui/src/components/icons'
import { iconSizes } from 'ui/src/theme'
import { ElementName, MobileEventName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { ChainId } from 'uniswap/src/types/chains'
import { WCEventType, WCRequestOutcome, WalletConnectEvent } from 'uniswap/src/types/walletConnect'
import { ONE_SECOND_MS } from 'utilities/src/time/time'
import { AccountDetails } from 'wallet/src/components/accounts/AccountDetails'
import { NetworkLogos } from 'wallet/src/components/network/NetworkLogos'
......@@ -35,12 +36,6 @@ import {
useSignerAccounts,
} from 'wallet/src/features/wallet/hooks'
import { setAccountAsActive } from 'wallet/src/features/wallet/slice'
import {
WCEventType,
WCRequestOutcome,
WalletConnectEvent,
} from 'wallet/src/features/walletConnect/types'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
type Props = {
pendingSession: WalletConnectPendingSession
......@@ -191,7 +186,7 @@ export const PendingConnectionModal = ({ pendingSession, onClose }: Props): JSX.
const onPressSettleConnection = useCallback(
async (approved: boolean) => {
sendMobileAnalyticsEvent(MobileEventName.WalletConnectSheetCompleted, {
sendAnalyticsEvent(MobileEventName.WalletConnectSheetCompleted, {
request_type: WCEventType.SessionPending,
dapp_url: pendingSession.dapp.url,
dapp_name: pendingSession.dapp.name,
......
......@@ -2,10 +2,10 @@ import React, { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { SwitchAccountOption } from 'src/components/WalletConnect/ScanSheet/SwitchAccountOption'
import { Flex, Text } from 'ui/src'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { ActionSheetModal } from 'wallet/src/components/modals/ActionSheetModal'
import { Account } from 'wallet/src/features/wallet/accounts/types'
import { useSignerAccounts } from 'wallet/src/features/wallet/hooks'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
type Props = {
activeAccount: Account | null
......
......@@ -3,11 +3,11 @@ import { useTranslation } from 'react-i18next'
import { Flex, Separator, Text, useSporeColors } from 'ui/src'
import Check from 'ui/src/assets/icons/check.svg'
import { iconSizes } from 'ui/src/theme'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { ChainId } from 'uniswap/src/types/chains'
import { NetworkLogo } from 'wallet/src/components/CurrencyLogo/NetworkLogo'
import { ActionSheetModal } from 'wallet/src/components/modals/ActionSheetModal'
import { ALL_SUPPORTED_CHAIN_IDS, CHAIN_INFO } from 'wallet/src/constants/chains'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
type Props = {
selectedChainId: ChainId
......
......@@ -5,7 +5,6 @@ import 'react-native-reanimated'
import { useAppDispatch } from 'src/app/hooks'
import { useEagerExternalProfileRootNavigation } from 'src/app/navigation/hooks'
import { QRCodeScanner } from 'src/components/QRCodeScanner/QRCodeScanner'
import Trace from 'src/components/Trace/Trace'
import { ConnectedDappsList } from 'src/components/WalletConnect/ConnectedDapps/ConnectedDappsList'
import {
URIType,
......@@ -27,14 +26,15 @@ import ScanQRIcon from 'ui/src/assets/icons/scan.svg'
import { iconSizes } from 'ui/src/theme'
import { FeatureFlags } from 'uniswap/src/features/gating/flags'
import { useFeatureFlag } from 'uniswap/src/features/gating/hooks'
import Trace from 'uniswap/src/features/telemetry/Trace'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { EthMethod, UwULinkMethod, UwULinkRequest } from 'uniswap/src/types/walletConnect'
import { logger } from 'utilities/src/logger/logger'
import { WalletQRCode } from 'wallet/src/components/QRCodeScanner/WalletQRCode'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { useContractManager, useProviderManager } from 'wallet/src/features/wallet/context'
import { useActiveAccount } from 'wallet/src/features/wallet/hooks'
import { EthMethod, UwULinkMethod, UwULinkRequest } from 'wallet/src/features/walletConnect/types'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
type Props = {
initialScreenState?: ScannerModalState
......
......@@ -8,6 +8,13 @@ import {
} from 'src/features/deepLinking/constants'
import { DynamicConfigs } from 'uniswap/src/features/gating/configs'
import { useDynamicConfig } from 'uniswap/src/features/gating/hooks'
import {
EthMethod,
EthTransaction,
UwULinkErc20SendRequest,
UwULinkMethod,
UwULinkRequest,
} from 'uniswap/src/types/walletConnect'
import { logger } from 'utilities/src/logger/logger'
import { RPCType } from 'wallet/src/constants/chains'
import { AssetType } from 'wallet/src/entities/assets'
......@@ -17,13 +24,6 @@ import { ScantasticParams, ScantasticParamsSchema } from 'wallet/src/features/sc
import { getTokenTransferRequest } from 'wallet/src/features/transactions/transfer/hooks/useTransferTransactionRequest'
import { TransferCurrencyParams } from 'wallet/src/features/transactions/transfer/types'
import { Account } from 'wallet/src/features/wallet/accounts/types'
import {
EthMethod,
EthTransaction,
UwULinkErc20SendRequest,
UwULinkMethod,
UwULinkRequest,
} from 'wallet/src/features/walletConnect/types'
import { areAddressesEqual, getValidAddress } from 'wallet/src/utils/addresses'
export enum URIType {
......
......@@ -16,6 +16,7 @@ import { useAppStateTrigger } from 'src/utils/useAppStateTrigger'
import { Flex, useSporeColors } from 'ui/src'
import EyeIcon from 'ui/src/assets/icons/eye.svg'
import { iconSizes } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { AccountDetails } from 'wallet/src/components/accounts/AccountDetails'
import { WarningModal } from 'wallet/src/components/modals/WarningModal/WarningModal'
import { WarningSeverity } from 'wallet/src/features/transactions/WarningModal/types'
......@@ -24,7 +25,6 @@ import {
useActiveAccountAddressWithThrow,
useSignerAccounts,
} from 'wallet/src/features/wallet/hooks'
import { ModalName } from 'wallet/src/telemetry/constants'
import { areAddressesEqual } from 'wallet/src/utils/addresses'
export function WalletConnectModals(): JSX.Element {
......
......@@ -5,17 +5,17 @@ import { useAppDispatch } from 'src/app/hooks'
import { navigate } from 'src/app/navigation/rootNavigation'
import { NotificationBadge } from 'src/components/notifications/Badge'
import { closeModal, openModal } from 'src/features/modals/modalSlice'
import { Screens } from 'src/screens/Screens'
import { disableOnPress } from 'src/utils/disableOnPress'
import { Flex, HapticFeedback, Text, TouchableArea } from 'ui/src'
import { iconSizes } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { NumberType } from 'utilities/src/format/types'
import { AddressDisplay } from 'wallet/src/components/accounts/AddressDisplay'
import { useAccountList } from 'wallet/src/features/accounts/hooks'
import { useLocalizationContext } from 'wallet/src/features/language/LocalizationContext'
import { pushNotification } from 'wallet/src/features/notifications/slice'
import { AppNotificationType, CopyNotificationType } from 'wallet/src/features/notifications/types'
import { ModalName } from 'wallet/src/telemetry/constants'
import { setClipboard } from 'wallet/src/utils/clipboard'
type AccountCardItemProps = {
......@@ -86,8 +86,8 @@ export function AccountCardItem({
const onPressWalletSettings = (): void => {
dispatch(closeModal({ name: ModalName.AccountSwitcher }))
navigate(Screens.SettingsStack, {
screen: Screens.SettingsWallet,
navigate(MobileScreens.SettingsStack, {
screen: MobileScreens.SettingsWallet,
params: { address },
})
}
......
......@@ -2,9 +2,9 @@ import * as ExpoClipboard from 'expo-clipboard'
import { navigationRef } from 'src/app/navigation/NavigationContainer'
import { MobileState } from 'src/app/reducer'
import { AccountHeader } from 'src/components/accounts/AccountHeader'
import { Screens } from 'src/screens/Screens'
import { fireEvent, render, screen, waitFor, within } from 'src/test/test-utils'
import { ModalName } from 'wallet/src/telemetry/constants'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import {
ACCOUNT,
ON_PRESS_EVENT_PAYLOAD,
......@@ -109,7 +109,9 @@ describe(AccountHeader, () => {
await waitFor(() => {
expect(navigate).toHaveBeenCalledTimes(1)
expect(navigate).toHaveBeenCalledWith(Screens.SettingsStack, { screen: Screens.Settings })
expect(navigate).toHaveBeenCalledWith(MobileScreens.SettingsStack, {
screen: MobileScreens.Settings,
})
})
})
})
......@@ -2,11 +2,11 @@ import React, { useCallback, useEffect } from 'react'
import { useAppDispatch, useAppSelector } from 'src/app/hooks'
import { navigate } from 'src/app/navigation/rootNavigation'
import { openModal } from 'src/features/modals/modalSlice'
import { setUserProperty } from 'src/features/telemetry'
import { UserPropertyName } from 'src/features/telemetry/constants'
import { Screens } from 'src/screens/Screens'
import { Flex, HapticFeedback, ImpactFeedbackStyle, Text, TouchableArea } from 'ui/src'
import { CopyAlt, Settings } from 'ui/src/components/icons'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { MobileUserPropertyName, setUserProperty } from 'uniswap/src/features/telemetry/user'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { isDevEnv } from 'uniswap/src/utils/env'
import { AccountIcon } from 'wallet/src/components/accounts/AccountIcon'
import { AnimatedUnitagDisplayName } from 'wallet/src/components/accounts/AnimatedUnitagDisplayName'
......@@ -19,7 +19,6 @@ import {
selectActiveAccountAddress,
} from 'wallet/src/features/wallet/selectors'
import { DisplayNameType } from 'wallet/src/features/wallet/types'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
import { sanitizeAddressText, shortenAddress } from 'wallet/src/utils/addresses'
import { setClipboard } from 'wallet/src/utils/clipboard'
......@@ -35,10 +34,10 @@ export function AccountHeader(): JSX.Element {
useEffect(() => {
switch (displayName?.type) {
case DisplayNameType.ENS:
setUserProperty(UserPropertyName.HasLoadedENS, true)
setUserProperty(MobileUserPropertyName.HasLoadedENS, true)
return
case DisplayNameType.Unitag:
setUserProperty(UserPropertyName.HasLoadedUnitag, true)
setUserProperty(MobileUserPropertyName.HasLoadedUnitag, true)
return
default:
return
......@@ -50,7 +49,7 @@ export function AccountHeader(): JSX.Element {
}, [dispatch])
const onPressSettings = (): void => {
navigate(Screens.SettingsStack, { screen: Screens.Settings })
navigate(MobileScreens.SettingsStack, { screen: MobileScreens.Settings })
}
const onPressCopyAddress = async (): Promise<void> => {
......
......@@ -84,7 +84,7 @@ describe(AccountList, () => {
const viewOnlyAccounts = createArray(3, readOnlyAccount)
render(<AccountList accounts={viewOnlyAccounts} onPress={jest.fn()} />, { resolvers })
expect(screen.queryByText('View only wallets')).toBeTruthy()
expect(screen.queryByText('View-only wallets')).toBeTruthy()
viewOnlyAccounts.forEach((account) => {
const address = sanitizeAddressText(shortenAddress(account.address))
......@@ -100,7 +100,7 @@ describe(AccountList, () => {
resolvers,
})
expect(screen.queryByText('View only wallets')).toBeFalsy()
expect(screen.queryByText('View-only wallets')).toBeFalsy()
cleanup()
})
})
......
......@@ -13,12 +13,12 @@ import {
} from 'ui/src'
import { EXTENSION_PROMO_BANNER_DARK, EXTENSION_PROMO_BANNER_LIGHT } from 'ui/src/assets'
import { borderRadii, iconSizes, spacing } from 'ui/src/theme'
import { MobileEventName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import {
ExtensionOnboardingState,
setExtensionOnboardingState,
} from 'wallet/src/features/behaviorHistory/slice'
import { sendWalletAnalyticsEvent } from 'wallet/src/telemetry'
import { ExtensionOnboardingEventName } from 'wallet/src/telemetry/constants'
const IMAGE_ASPECT_RATIO = 0.69
const IMAGE_SCREEN_WIDTH_PROPORTION = 0.3
......@@ -40,14 +40,14 @@ export function ExtensionPromoBanner({
const onPressClaimNow = (): void => {
Keyboard.dismiss()
sendWalletAnalyticsEvent(ExtensionOnboardingEventName.PromoBannerActionTaken, {
sendAnalyticsEvent(MobileEventName.ExtensionPromoBannerActionTaken, {
action: 'join',
})
onShowExtensionPromoModal()
}
const onPressMaybeLater = (): void => {
sendWalletAnalyticsEvent(ExtensionOnboardingEventName.PromoBannerActionTaken, {
sendAnalyticsEvent(MobileEventName.ExtensionPromoBannerActionTaken, {
action: 'dismiss',
})
dispatch(setExtensionOnboardingState(ExtensionOnboardingState.Completed))
......
......@@ -5,8 +5,8 @@ import { runOnJS } from 'react-native-reanimated'
import { OnboardingStackBaseParams, useOnboardingStackNavigation } from 'src/app/navigation/types'
import { CloseButton } from 'src/components/buttons/CloseButton'
import { CarouselContext } from 'src/components/carousel/Carousel'
import { OnboardingScreens } from 'src/screens/Screens'
import { Flex, Text, useDeviceDimensions } from 'ui/src'
import { OnboardingScreens } from 'uniswap/src/types/screens/mobile'
import { getCloudProviderName } from 'uniswap/src/utils/cloud-backup/getCloudProviderName'
function Page({
......
......@@ -12,6 +12,7 @@ import { usePollOnFocusOnly } from 'src/utils/hooks'
import { AnimatedFlex, AnimatedTouchableArea, Flex, ImpactFeedbackStyle, Text } from 'ui/src'
import { borderRadii, imageSizes } from 'ui/src/theme'
import { useFavoriteTokenCardQuery } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { SectionName } from 'uniswap/src/features/telemetry/constants'
import { ChainId } from 'uniswap/src/types/chains'
import { NumberType } from 'utilities/src/format/types'
import { BaseCard } from 'wallet/src/components/BaseCard/BaseCard'
......@@ -23,7 +24,6 @@ import { fromGraphQLChain } from 'wallet/src/features/chains/utils'
import { currencyIdToContractInput } from 'wallet/src/features/dataApi/utils'
import { removeFavoriteToken } from 'wallet/src/features/favorites/slice'
import { useLocalizationContext } from 'wallet/src/features/language/LocalizationContext'
import { SectionName } from 'wallet/src/telemetry/constants'
import { getSymbolDisplayText } from 'wallet/src/utils/currency'
export const FAVORITE_TOKEN_CARD_LOADER_HEIGHT = 114
......
import { makeMutable } from 'react-native-reanimated'
import configureMockStore from 'redux-mock-store'
import { Screens } from 'src/screens/Screens'
import { preloadedMobileState } from 'src/test/fixtures'
import { fireEvent, render, waitFor } from 'src/test/test-utils'
import * as unitagHooks from 'uniswap/src/features/unitags/hooks'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import * as ensHooks from 'wallet/src/features/ens/api'
import {
ON_PRESS_EVENT_PAYLOAD,
......@@ -103,7 +103,7 @@ describe('FavoriteWalletCard', () => {
const touchable = getByTestId('favorite-wallet-card')
fireEvent.press(touchable, ON_PRESS_EVENT_PAYLOAD)
expect(mockedNavigation.navigate).toHaveBeenCalledWith(Screens.ExternalProfile, {
expect(mockedNavigation.navigate).toHaveBeenCalledWith(MobileScreens.ExternalProfile, {
address: defaultProps.address,
})
})
......
......@@ -6,13 +6,13 @@ import {
getTokensOrderByMenuLabel,
getTokensOrderBySelectedLabel,
} from 'src/features/explore/utils'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { disableOnPress } from 'src/utils/disableOnPress'
import { Flex, Text, TouchableArea, useIsDarkMode } from 'ui/src'
import { RotatableChevron } from 'ui/src/components/icons'
import { iconSizes } from 'ui/src/theme'
import { TokenSortableField } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { MobileEventName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { logger } from 'utilities/src/logger/logger'
import { setTokensOrderBy } from 'wallet/src/features/wallet/slice'
import { ClientTokensOrderBy, TokensOrderBy } from 'wallet/src/features/wallet/types'
......@@ -70,7 +70,7 @@ function _SortButton({ orderBy }: FilterGroupProps): JSX.Element {
}
dispatch(setTokensOrderBy({ newTokensOrderBy: selectedMenuAction.orderBy }))
sendMobileAnalyticsEvent(MobileEventName.ExploreFilterSelected, {
sendAnalyticsEvent(MobileEventName.ExploreFilterSelected, {
filter_type: selectedMenuAction.orderBy,
})
}}>
......
......@@ -4,17 +4,16 @@ import ContextMenu from 'react-native-context-menu-view'
import { useTokenDetailsNavigation } from 'src/components/TokenDetails/hooks'
import { useExploreTokenContextMenu } from 'src/components/explore/hooks'
import { TokenMetadata } from 'src/components/tokens/TokenMetadata'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { disableOnPress } from 'src/utils/disableOnPress'
import { AnimatedFlex, Flex, ImpactFeedbackStyle, Text, TouchableArea } from 'ui/src'
import { MobileEventName, SectionName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { ChainId } from 'uniswap/src/types/chains'
import { NumberType } from 'utilities/src/format/types'
import { TokenLogo } from 'wallet/src/components/CurrencyLogo/TokenLogo'
import { RelativeChange } from 'wallet/src/components/text/RelativeChange'
import { useLocalizationContext } from 'wallet/src/features/language/LocalizationContext'
import { TokenMetadataDisplayType } from 'wallet/src/features/wallet/types'
import { SectionName } from 'wallet/src/telemetry/constants'
import {
buildCurrencyId,
buildNativeCurrencyId,
......@@ -88,7 +87,7 @@ export const TokenItem = memo(function _TokenItem({
const onPress = (): void => {
tokenDetailsNavigation.preload(_currencyId)
tokenDetailsNavigation.navigate(_currencyId)
sendMobileAnalyticsEvent(MobileEventName.ExploreTokenItemSelected, {
sendAnalyticsEvent(MobileEventName.ExploreTokenItemSelected, {
address: currencyIdToAddress(_currencyId),
chain: currencyIdToChain(_currencyId) as number,
name,
......
......@@ -30,7 +30,7 @@ exports[`TokenItem renders without error 1`] = `
],
}
}
testID="token-item-cum"
testID="token-item-tkn"
>
<View
collapsable={false}
......@@ -143,7 +143,7 @@ exports[`TokenItem renders without error 1`] = `
}
suppressHighlighting={true}
>
cum
tkn
</Text>
<Text
allowFontScaling={true}
......
......@@ -4,9 +4,9 @@ import configureMockStore from 'redux-mock-store'
import { useExploreTokenContextMenu } from 'src/components/explore/hooks'
import { renderHookWithProviders } from 'src/test/render'
import { Resolvers } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { SectionName } from 'uniswap/src/features/telemetry/constants'
import { FavoritesState } from 'wallet/src/features/favorites/slice'
import { CurrencyField } from 'wallet/src/features/transactions/transactionState/types'
import { SectionName } from 'wallet/src/telemetry/constants'
import { SAMPLE_SEED_ADDRESS_1 } from 'wallet/src/test/fixtures/constants'
import { cleanup } from 'wallet/src/test/test-utils'
......
......@@ -6,7 +6,8 @@ import { ContextMenuAction, ContextMenuOnPressNativeEvent } from 'react-native-c
import { SharedValue, StyleProps, interpolate, useAnimatedStyle } from 'react-native-reanimated'
import { useSelectHasTokenFavorited, useToggleFavoriteCallback } from 'src/features/favorites/hooks'
import { openModal } from 'src/features/modals/modalSlice'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { ElementName, ModalName, SectionNameType } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { ChainId } from 'uniswap/src/types/chains'
import { CurrencyId } from 'uniswap/src/types/currency'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
......@@ -17,7 +18,6 @@ import {
TransactionState,
} from 'wallet/src/features/transactions/transactionState/types'
import { useAppDispatch } from 'wallet/src/state'
import { ElementName, ModalName, SectionNameType } from 'wallet/src/telemetry/constants'
import { currencyIdToAddress } from 'wallet/src/utils/currencyId'
interface TokenMenuParams {
......@@ -74,7 +74,7 @@ export function useExploreTokenContextMenu({
},
}
dispatch(openModal({ name: ModalName.Swap, initialState: swapFormState }))
sendMobileAnalyticsEvent(SharedEventName.ELEMENT_CLICKED, {
sendAnalyticsEvent(SharedEventName.ELEMENT_CLICKED, {
element: ElementName.Swap,
section: analyticsSection,
})
......
......@@ -3,11 +3,11 @@ import { useAppDispatch } from 'src/app/hooks'
import { getBlockExplorerIcon } from 'src/components/icons/BlockExplorerIcon'
import { Flex, ImpactFeedbackStyle, Text, TouchableArea, useSporeColors } from 'ui/src'
import { iconSizes } from 'ui/src/theme'
import { ElementName } from 'uniswap/src/features/telemetry/constants'
import { ChainId } from 'uniswap/src/types/chains'
import { Arrow } from 'wallet/src/components/icons/Arrow'
import { EtherscanSearchResult } from 'wallet/src/features/search/SearchResult'
import { addToSearchHistory } from 'wallet/src/features/search/searchHistorySlice'
import { ElementName } from 'wallet/src/telemetry/constants'
import { shortenAddress } from 'wallet/src/utils/addresses'
import { ExplorerDataType, getExplorerLink, openUri } from 'wallet/src/utils/linking'
......
import { default as React } from 'react'
import { useAppDispatch } from 'src/app/hooks'
import { useAppStackNavigation } from 'src/app/navigation/types'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { Screens } from 'src/screens/Screens'
import { Flex, ImpactFeedbackStyle, Text, TouchableArea } from 'ui/src'
import { Verified } from 'ui/src/components/icons'
import { iconSizes } from 'ui/src/theme'
import { ElementName, MobileEventName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { NFTViewer } from 'wallet/src/features/images/NFTViewer'
import { SearchContext } from 'wallet/src/features/search/SearchContext'
import {
......@@ -14,7 +14,6 @@ import {
SearchResultType,
} from 'wallet/src/features/search/SearchResult'
import { addToSearchHistory } from 'wallet/src/features/search/searchHistorySlice'
import { ElementName } from 'wallet/src/telemetry/constants'
type NFTCollectionItemProps = {
collection: NFTCollectionSearchResult
......@@ -30,12 +29,12 @@ export function SearchNFTCollectionItem({
const navigation = useAppStackNavigation()
const onPress = (): void => {
navigation.navigate(Screens.NFTCollection, {
navigation.navigate(MobileScreens.NFTCollection, {
collectionAddress: address,
})
if (searchContext) {
sendMobileAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
sendAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
query: searchContext.query,
name,
chain: chainId,
......
......@@ -3,17 +3,16 @@ import ContextMenu from 'react-native-context-menu-view'
import { useAppDispatch } from 'src/app/hooks'
import { useTokenDetailsNavigation } from 'src/components/TokenDetails/hooks'
import { useExploreTokenContextMenu } from 'src/components/explore/hooks'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { disableOnPress } from 'src/utils/disableOnPress'
import { Flex, ImpactFeedbackStyle, Text, TouchableArea, useIsDarkMode } from 'ui/src'
import { SafetyLevel } from 'uniswap/src/data/graphql/uniswap-data-api/__generated__/types-and-hooks'
import { ElementName, MobileEventName, SectionName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { TokenLogo } from 'wallet/src/components/CurrencyLogo/TokenLogo'
import WarningIcon from 'wallet/src/components/icons/WarningIcon'
import { SearchContext } from 'wallet/src/features/search/SearchContext'
import { SearchResultType, TokenSearchResult } from 'wallet/src/features/search/SearchResult'
import { addToSearchHistory } from 'wallet/src/features/search/searchHistorySlice'
import { ElementName, SectionName } from 'wallet/src/telemetry/constants'
import { shortenAddress } from 'wallet/src/utils/addresses'
import { buildCurrencyId, buildNativeCurrencyId } from 'wallet/src/utils/currencyId'
......@@ -34,7 +33,7 @@ export function SearchTokenItem({ token, searchContext }: SearchTokenItemProps):
tokenDetailsNavigation.preload(currencyId)
tokenDetailsNavigation.navigate(currencyId)
if (searchContext) {
sendMobileAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
sendAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
query: searchContext.query,
name: name ?? '',
chain: token.chainId,
......
......@@ -4,10 +4,10 @@ import ContextMenu from 'react-native-context-menu-view'
import { useAppDispatch, useAppSelector } from 'src/app/hooks'
import { useEagerExternalProfileNavigation } from 'src/app/navigation/hooks'
import { useToggleWatchedWalletCallback } from 'src/features/favorites/hooks'
import { sendMobileAnalyticsEvent } from 'src/features/telemetry'
import { MobileEventName } from 'src/features/telemetry/constants'
import { disableOnPress } from 'src/utils/disableOnPress'
import { ImpactFeedbackStyle, TouchableArea } from 'ui/src'
import { MobileEventName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { selectWatchedAddressSet } from 'wallet/src/features/favorites/selectors'
import { SearchContext } from 'wallet/src/features/search/SearchContext'
import {
......@@ -42,7 +42,7 @@ export function SearchWalletItemBase({
: type === SearchResultType.ENSAddress
? searchResult.ensName
: undefined
sendMobileAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
sendAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
query: searchContext.query,
name: walletName,
address,
......
......@@ -7,12 +7,12 @@ import { UpgradeStatus } from 'src/features/forceUpgrade/types'
import { Flex, Text, TouchableArea, useSporeColors } from 'ui/src'
import { DynamicConfigs } from 'uniswap/src/features/gating/configs'
import { useDynamicConfig } from 'uniswap/src/features/gating/hooks'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { WarningModal } from 'wallet/src/components/modals/WarningModal/WarningModal'
import { WarningSeverity } from 'wallet/src/features/transactions/WarningModal/types'
import { SignerMnemonicAccount } from 'wallet/src/features/wallet/accounts/types'
import { useNonPendingSignerAccounts } from 'wallet/src/features/wallet/hooks'
import { ModalName } from 'wallet/src/telemetry/constants'
import { openUri } from 'wallet/src/utils/linking'
export function ForceUpgradeModal(): JSX.Element {
......
......@@ -13,10 +13,10 @@ import { openModal } from 'src/features/modals/modalSlice'
import { removePendingSession } from 'src/features/walletConnect/walletConnectSlice'
import { Flex, useDeviceInsets, useSporeColors } from 'ui/src'
import { GQLQueries } from 'uniswap/src/data/graphql/uniswap-data-api/queries'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { isAndroid } from 'uniswap/src/utils/platform'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import { useActivityData } from 'wallet/src/features/activity/useActivityData'
import { ModalName } from 'wallet/src/telemetry/constants'
export const ACTIVITY_TAB_DATA_DEPENDENCIES = [GQLQueries.TransactionList]
......
......@@ -12,6 +12,7 @@ import { removePendingSession } from 'src/features/walletConnect/walletConnectSl
import { Flex, Text, useDeviceInsets, useSporeColors } from 'ui/src'
import { NoTransactions } from 'ui/src/components/icons'
import { GQLQueries } from 'uniswap/src/data/graphql/uniswap-data-api/queries'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { isAndroid } from 'uniswap/src/utils/platform'
import { BaseCard } from 'wallet/src/components/BaseCard/BaseCard'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
......@@ -20,7 +21,6 @@ import { selectWatchedAddressSet } from 'wallet/src/features/favorites/selectors
import TransactionSummaryLayout from 'wallet/src/features/transactions/SummaryCards/SummaryItems/TransactionSummaryLayout'
import { generateActivityItemRenderer } from 'wallet/src/features/transactions/SummaryCards/utils'
import { useHideSpamTokensSetting } from 'wallet/src/features/wallet/hooks'
import { ModalName } from 'wallet/src/telemetry/constants'
export const FEED_TAB_DATA_DEPENDENCIES = [GQLQueries.FeedTransactionList]
......
......@@ -5,9 +5,9 @@ import { useAppStackNavigation } from 'src/app/navigation/types'
import { NftView } from 'src/components/NFT/NftView'
import { useAdaptiveFooter } from 'src/components/home/hooks'
import { TAB_BAR_HEIGHT, TabProps } from 'src/components/layout/TabHelpers'
import { Screens } from 'src/screens/Screens'
import { Flex, useDeviceInsets, useSporeColors } from 'ui/src'
import { GQLQueries } from 'uniswap/src/data/graphql/uniswap-data-api/queries'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { isAndroid } from 'uniswap/src/utils/platform'
import { NftsList } from 'wallet/src/components/nfts/NftsList'
import { NFTItem } from 'wallet/src/features/nfts/types'
......@@ -39,7 +39,7 @@ export const NftsTab = memo(
const renderNFTItem = useCallback(
(item: NFTItem) => {
const onPressNft = (): void => {
navigation.navigate(Screens.NFTItem, {
navigation.navigate(MobileScreens.NFTItem, {
owner,
address: item.contractAddress ?? '',
tokenId: item.tokenId ?? '',
......
......@@ -8,15 +8,15 @@ import { useTokenDetailsNavigation } from 'src/components/TokenDetails/hooks'
import { WalletEmptyState } from 'src/components/home/WalletEmptyState'
import { TabContentProps, TabProps } from 'src/components/layout/TabHelpers'
import { openModal } from 'src/features/modals/modalSlice'
import { Screens } from 'src/screens/Screens'
import { Flex } from 'ui/src'
import { NoTokens } from 'ui/src/components/icons'
import { GQLQueries } from 'uniswap/src/data/graphql/uniswap-data-api/queries'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { CurrencyId } from 'uniswap/src/types/currency'
import { MobileScreens } from 'uniswap/src/types/screens/mobile'
import { BaseCard } from 'wallet/src/components/BaseCard/BaseCard'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import { TokenBalanceListRow } from 'wallet/src/features/portfolio/TokenBalanceListContext'
import { ModalName } from 'wallet/src/telemetry/constants'
export const TOKENS_TAB_DATA_DEPENDENCIES = [GQLQueries.PortfolioBalances]
......@@ -44,7 +44,7 @@ export const TokensTab = memo(
const onPressToken = useCallback(
(currencyId: CurrencyId): void => {
startProfilerTimer({ source: Screens.Home })
startProfilerTimer({ source: MobileScreens.Home })
tokenDetailsNavigation.navigate(currencyId)
},
[startProfilerTimer, tokenDetailsNavigation]
......
......@@ -9,7 +9,6 @@ import {
VirtualizedList,
} from 'react-native'
import { useAppDispatch } from 'src/app/hooks'
import Trace from 'src/components/Trace/Trace'
import { openModal } from 'src/features/modals/modalSlice'
import { Flex, Text, TouchableArea, useIsDarkMode } from 'ui/src'
import { CRYPTO_PURCHASE_BACKGROUND_DARK, CRYPTO_PURCHASE_BACKGROUND_LIGHT } from 'ui/src/assets'
......@@ -17,12 +16,13 @@ import { ArrowDownCircle, Buy as BuyIcon, PaperStack } from 'ui/src/components/i
import { borderRadii } from 'ui/src/theme'
import { FeatureFlags } from 'uniswap/src/features/gating/flags'
import { useFeatureFlag } from 'uniswap/src/features/gating/hooks'
import Trace from 'uniswap/src/features/telemetry/Trace'
import { ElementName, ElementNameType, ModalName } from 'uniswap/src/features/telemetry/constants'
import { ScannerModalState } from 'wallet/src/components/QRCodeScanner/constants'
import { useCexTransferProviders } from 'wallet/src/features/fiatOnRamp/api'
import { ImageUri } from 'wallet/src/features/images/ImageUri'
import { AccountType } from 'wallet/src/features/wallet/accounts/types'
import { useActiveAccount } from 'wallet/src/features/wallet/hooks'
import { ElementName, ElementNameType, ModalName } from 'wallet/src/telemetry/constants'
interface ActionCardItem {
title: string
......
......@@ -61,7 +61,7 @@ export const TAB_STYLES = StyleSheet.create({
// For padding on the list components themselves within tabs.
tabListInner: {
paddingBottom: spacing.spacing12,
paddingTop: spacing.spacing8,
paddingTop: spacing.spacing4,
},
})
......
......@@ -7,9 +7,9 @@ import { MnemonicDisplay } from 'src/components/mnemonic/MnemonicDisplay'
import { useBiometricAppSettings, useBiometricPrompt } from 'src/features/biometrics/hooks'
import { useWalletRestore } from 'src/features/wallet/hooks'
import { Button, Flex } from 'ui/src'
import { ElementName, ModalName } from 'uniswap/src/features/telemetry/constants'
import { WarningModal } from 'wallet/src/components/modals/WarningModal/WarningModal'
import { WarningSeverity } from 'wallet/src/features/transactions/WarningModal/types'
import { ElementName, ModalName } from 'wallet/src/telemetry/constants'
type Props = {
mnemonicId: string
......
......@@ -3,8 +3,8 @@ import { useTranslation } from 'react-i18next'
import { ColorValue, Keyboard } from 'react-native'
import { TouchableArea, TouchableAreaProps, useSporeColors } from 'ui/src'
import InfoCircle from 'ui/src/assets/icons/info-circle.svg'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { WarningModal } from 'wallet/src/components/modals/WarningModal/WarningModal'
import { ModalName } from 'wallet/src/telemetry/constants'
const DEFAULT_ICON_SIZE = 20
......
......@@ -6,6 +6,8 @@ import { getUniqueId } from 'react-native-device-info'
import { Button, Flex, Text, useSporeColors } from 'ui/src'
import { AlertTriangle } from 'ui/src/components/icons'
import { fonts, spacing } from 'ui/src/theme'
import { ElementName, ModalName, UnitagEventName } from 'uniswap/src/features/telemetry/constants'
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
import { useUnitagUpdater } from 'uniswap/src/features/unitags/context'
import { UnitagErrorCodes } from 'uniswap/src/features/unitags/types'
import { isIOS } from 'uniswap/src/utils/platform'
......@@ -22,8 +24,6 @@ import { parseUnitagErrorCode } from 'wallet/src/features/unitags/utils'
import { useWalletSigners } from 'wallet/src/features/wallet/context'
import { useAccount } from 'wallet/src/features/wallet/hooks'
import { useAppDispatch } from 'wallet/src/state'
import { sendWalletAnalyticsEvent } from 'wallet/src/telemetry'
import { ElementName, ModalName, UnitagEventName } from 'wallet/src/telemetry/constants'
export function ChangeUnitagModal({
unitag,
......@@ -123,7 +123,7 @@ export function ChangeUnitagModal({
// If change succeeded, exit the modal and display a success message
if (changeResponse.success) {
sendWalletAnalyticsEvent(UnitagEventName.UnitagChanged)
sendAnalyticsEvent(UnitagEventName.UnitagChanged)
triggerRefetchUnitags()
dispatch(
pushNotification({
......@@ -197,11 +197,7 @@ export function ChangeUnitagModal({
{showConfirmModal && (
<ChangeUnitagConfirmModal onChangeSubmit={onChangeSubmit} onClose={onCloseConfirmModal} />
)}
<BottomSheetModal
isDismissible
isModalOpen={!showConfirmModal}
name={ModalName.UnitagsChange}
onClose={onClose}>
<BottomSheetModal isDismissible name={ModalName.UnitagsChange} onClose={onClose}>
<Flex
centered
gap="$spacing12"
......
import { NftView } from 'src/components/NFT/NftView'
import { useDeviceInsets, useSporeColors } from 'ui/src'
import { spacing } from 'ui/src/theme'
import { ModalName } from 'uniswap/src/features/telemetry/constants'
import { BottomSheetModal } from 'wallet/src/components/modals/BottomSheetModal'
import { NftsList } from 'wallet/src/components/nfts/NftsList'
import { NFTItem } from 'wallet/src/features/nfts/types'
import { ModalName } from 'wallet/src/telemetry/constants'
type ChooseNftProps = {
address: string
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment