Skip to content

Commit e069322

Browse files
ci(release): publish latest release
1 parent d655de0 commit e069322

File tree

14 files changed

+53
-89
lines changed

14 files changed

+53
-89
lines changed

RELEASE

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Monad Testnet Support - Enjoy swapping on Monad testnet by toggling to Testnet m
66

77
Other changes:
88

9+
- Improved scrollbar behavior
910
- VND current support
1011
- Improvements to our NFT Spam reporting feature
1112
- Stronger warnings when sending funds to token contracts

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mobile/1.46
1+
extension/1.16.0

apps/extension/src/app/navigation/navigation.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useIsWalletUnlocked } from 'src/app/hooks/useIsWalletUnlocked'
1111
import { HideContentsWhenSidebarBecomesInactive } from 'src/app/navigation/HideContentsWhenSidebarBecomesInactive'
1212
import { SideBarNavigationProvider } from 'src/app/navigation/SideBarNavigationProvider'
1313
import { AppRoutes } from 'src/app/navigation/constants'
14-
import { subscribeToRouterState, useRouterState } from 'src/app/navigation/state'
14+
import { RouterState, subscribeToRouterState, useRouterState } from 'src/app/navigation/state'
1515
import { focusOrCreateOnboardingTab } from 'src/app/navigation/utils'
1616
import { isOnboardedSelector } from 'src/app/utils/isOnboardedSelector'
1717
import { Flex, SpinningLoader, styled } from 'ui/src'
@@ -74,8 +74,8 @@ const getAppRouteFromPathName = (pathname: string): AppRoutes | null => {
7474

7575
const animationVariant: Variants = {
7676
initial: (dir: Direction) => ({
77-
x: isVertical(dir) ? 0 : dir === 'right' ? 30 : -30,
78-
y: !isVertical(dir) ? 0 : dir === 'down' ? 15 : -15,
77+
x: isVertical(dir) ? 0 : dir === 'right' ? -30 : 30,
78+
y: !isVertical(dir) ? 0 : dir === 'down' ? -15 : 15,
7979
opacity: 0,
8080
zIndex: 1,
8181
}),
@@ -122,8 +122,11 @@ export function WebNavigation(): JSX.Element {
122122
useEffect(() => {
123123
// We're using subscribeToRouterState subscriber to detect, whether we will
124124
// navigate to another page, which will lead to the start of the animation.
125-
subscribeToRouterState(() => {
126-
setIsTransitioning(true)
125+
subscribeToRouterState(({ historyAction, location }: RouterState) => {
126+
const trimmedPathname = location.pathname.replace('/', '') as AppRoutes
127+
if (historyAction !== NavigationType.Replace && Object.values(AppRoutes).includes(trimmedPathname)) {
128+
setIsTransitioning(true)
129+
}
127130
})
128131
}, [])
129132

apps/extension/src/app/navigation/state.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from 'react'
22
import { Location, NavigationType, Router, createHashRouter } from 'react-router-dom'
33

4-
interface RouterState {
4+
export interface RouterState {
55
historyAction: NavigationType
66
location: Location
77
}

apps/mobile/ios/Podfile.lock

-10
Original file line numberDiff line numberDiff line change
@@ -3209,9 +3209,6 @@ PODS:
32093209
- React-Core
32103210
- RNPermissions (4.1.5):
32113211
- React-Core
3212-
- RNQrGenerator (1.4.3):
3213-
- React
3214-
- ZXingObjC
32153212
- RNReanimated (3.16.7):
32163213
- DoubleConversion
32173214
- glog
@@ -3335,9 +3332,6 @@ PODS:
33353332
- Statsig (1.49.0)
33363333
- UIImageColors (2.1.0)
33373334
- Yoga (0.0.0)
3338-
- ZXingObjC (3.6.9):
3339-
- ZXingObjC/All (= 3.6.9)
3340-
- ZXingObjC/All (3.6.9)
33413335
- ZXingObjC/Core (3.6.9)
33423336
- ZXingObjC/OneD (3.6.9):
33433337
- ZXingObjC/Core
@@ -3463,7 +3457,6 @@ DEPENDENCIES:
34633457
- RNImageColors (from `../../../node_modules/react-native-image-colors`)
34643458
- RNLocalize (from `../../../node_modules/react-native-localize`)
34653459
- RNPermissions (from `../../../node_modules/react-native-permissions`)
3466-
- RNQrGenerator (from `../../../node_modules/rn-qr-generator`)
34673460
- RNReanimated (from `../../../node_modules/react-native-reanimated`)
34683461
- RNScreens (from `../../../node_modules/react-native-screens`)
34693462
- RNSVG (from `../../../node_modules/react-native-svg`)
@@ -3747,8 +3740,6 @@ EXTERNAL SOURCES:
37473740
:path: "../../../node_modules/react-native-localize"
37483741
RNPermissions:
37493742
:path: "../../../node_modules/react-native-permissions"
3750-
RNQrGenerator:
3751-
:path: "../../../node_modules/rn-qr-generator"
37523743
RNReanimated:
37533744
:path: "../../../node_modules/react-native-reanimated"
37543745
RNScreens:
@@ -3912,7 +3903,6 @@ SPEC CHECKSUMS:
39123903
RNImageColors: 9ac05083b52d5c350e6972650ae3ba0e556466c1
39133904
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
39143905
RNPermissions: 87aac13521bea6dcb6dfd60b03ac69741ccef2b4
3915-
RNQrGenerator: ac6a6c766e80dd3625038929ed2b13e2f3edcafb
39163906
RNReanimated: 283b723ad4ac5295f1513519c938cb6c282c508f
39173907
RNScreens: 906192367b418a8d644090d7375d4657d5a5aab0
39183908
RNSVG: 7ff26379b2d1871b8571e6f9bc9630de6baf9bdf

apps/mobile/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
"redux-mock-store": "1.5.4",
154154
"redux-persist": "6.0.0",
155155
"redux-saga": "1.2.2",
156-
"rn-qr-generator": "1.4.3",
157156
"typed-redux-saga": "1.5.0",
158157
"uniswap": "workspace:^",
159158
"utilities": "workspace:^",

apps/mobile/src/components/QRCodeScanner/QRCodeScanner.tsx

+7-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BarcodeScanningResult, CameraView, CameraViewProps, useCameraPermissions } from 'expo-camera'
1+
import { BarcodeScanningResult, CameraView, CameraViewProps, scanFromURLAsync, useCameraPermissions } from 'expo-camera'
22
import { PermissionStatus } from 'expo-modules-core'
33
import { memo, useCallback, useEffect, useMemo, useState } from 'react'
44
import { useTranslation } from 'react-i18next'
@@ -7,7 +7,6 @@ import DeviceInfo from 'react-native-device-info'
77
import { launchImageLibrary } from 'react-native-image-picker'
88
import { FadeIn, FadeOut } from 'react-native-reanimated'
99
import { Defs, LinearGradient, Path, Rect, Stop, Svg } from 'react-native-svg'
10-
import RNQRGenerator from 'rn-qr-generator'
1110
import { DeprecatedButton, Flex, SpinningLoader, Text, ThemeName, useSporeColors } from 'ui/src'
1211
import CameraScan from 'ui/src/assets/icons/camera-scan.svg'
1312
import { Global, PhotoStacked } from 'ui/src/components/icons'
@@ -95,25 +94,16 @@ export function QRCodeScanner(props: QRCodeScannerProps | WCScannerProps): JSX.E
9594
return
9695
}
9796

98-
// TODO (WALL-6014): Migrate to expo-camera once Android issue is fixed
99-
try {
100-
const results = await RNQRGenerator.detect({ uri })
97+
const result = (await scanFromURLAsync(uri, [BarcodeType.QR]))[0]
10198

102-
if (results.values[0]) {
103-
const data = results.values[0]
104-
onScanCode(data)
105-
} else {
106-
Alert.alert(t('qrScanner.error.none'))
107-
}
108-
} catch (error) {
109-
logger.error(`Cannot detect QR code in image: ${error}`, {
110-
tags: { file: 'QRCodeScanner.tsx', function: 'onPickImageFilePress' },
111-
})
99+
if (!result) {
112100
Alert.alert(t('qrScanner.error.none'))
113-
} finally {
114101
setIsReadingImageFile(false)
102+
return
115103
}
116-
}, [isReadingImageFile, onScanCode, t])
104+
105+
handleBarcodeScanned(result)
106+
}, [handleBarcodeScanned, isReadingImageFile, t])
117107

118108
useEffect(() => {
119109
const handlePermissionStatus = async (): Promise<void> => {

apps/mobile/src/components/Settings/lists/SettingsFlashList.tsx

+13-7
Original file line numberDiff line numberDiff line change
@@ -86,40 +86,46 @@ type ProcessedRow =
8686
| { type: 'footer'; data: SectionInfo }
8787

8888
function processSections(sections: SettingsSection[]): ProcessedRow[] {
89-
const result: ProcessedRow[] = []
89+
const resultSize = sections.reduce((acc, section) => {
90+
const dataLength = section.data.length
91+
return acc + (section.subTitle ? 1 : 0) + dataLength
92+
}, 0)
93+
94+
const result: ProcessedRow[] = new Array(resultSize)
95+
let index = 0
9096

9197
for (const section of sections) {
9298
if (section.isHidden) {
9399
continue
94100
}
95101

96102
if (section.subTitle) {
97-
result.push({
103+
result[index++] = {
98104
type: 'header',
99105
data: {
100106
section,
101107
},
102-
})
108+
}
103109
}
104110

105111
for (const data of section.data) {
106112
if ('isHidden' in data && data.isHidden) {
107113
continue
108114
}
109115

110-
result.push({
116+
result[index++] = {
111117
type: 'item',
112118
data,
113-
})
119+
}
114120
}
115121

116122
if (section.subTitle) {
117-
result.push({
123+
result[index++] = {
118124
type: 'footer',
119125
data: {
120126
section,
121127
},
122-
})
128+
}
123129
}
124130
}
125131

apps/mobile/src/features/send/SendFormButton.tsx

+2-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Dispatch, SetStateAction, useCallback, useMemo } from 'react'
1+
import React, { Dispatch, SetStateAction, useCallback } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import { useSelector } from 'react-redux'
44
import { DeprecatedButton } from 'ui/src'
@@ -8,7 +8,6 @@ import { selectHasDismissedLowNetworkTokenWarning } from 'uniswap/src/features/b
88
import { WalletEventName } from 'uniswap/src/features/telemetry/constants'
99
import { sendAnalyticsEvent } from 'uniswap/src/features/telemetry/send'
1010
import { NativeCurrency } from 'uniswap/src/features/tokens/NativeCurrency'
11-
import { ValueType, getCurrencyAmount } from 'uniswap/src/features/tokens/getCurrencyAmount'
1211
import { useTransactionModalContext } from 'uniswap/src/features/transactions/TransactionModal/TransactionModalContext'
1312
import { useIsBlocked } from 'uniswap/src/features/trm/hooks'
1413
import { TestID } from 'uniswap/src/test/fixtures/testIDs'
@@ -35,29 +34,9 @@ export function SendFormButton({
3534
recipient,
3635
isMax,
3736
derivedSendInfo: { chainId, currencyInInfo },
38-
exactAmountToken,
39-
exactAmountFiat,
4037
} = useSendContext()
4138
const { walletNeedsRestore } = useTransactionModalContext()
4239

43-
const hasValueGreaterThanZero = useMemo(() => {
44-
if (exactAmountToken) {
45-
return getCurrencyAmount({
46-
value: exactAmountToken,
47-
valueType: ValueType.Exact,
48-
currency: currencyInInfo?.currency,
49-
})?.greaterThan(0)
50-
}
51-
if (exactAmountFiat) {
52-
return getCurrencyAmount({
53-
value: exactAmountFiat,
54-
valueType: ValueType.Exact,
55-
currency: currencyInInfo?.currency,
56-
})?.greaterThan(0)
57-
}
58-
return false
59-
}, [exactAmountToken, exactAmountFiat, currencyInInfo?.currency])
60-
6140
const isViewOnlyWallet = account.type === AccountType.Readonly
6241

6342
const { isBlocked: isActiveBlocked, isBlockedLoading: isActiveBlockedLoading } = useIsBlockedActiveAddress()
@@ -67,8 +46,7 @@ export function SendFormButton({
6746

6847
const insufficientGasFunds = warnings.warnings.some((warning) => warning.type === WarningLabel.InsufficientGasFunds)
6948

70-
const actionButtonDisabled =
71-
!!warnings.blockingWarning || isBlocked || isBlockedLoading || walletNeedsRestore || !hasValueGreaterThanZero
49+
const actionButtonDisabled = !!warnings.blockingWarning || isBlocked || isBlockedLoading || walletNeedsRestore
7250

7351
const onPressReview = useCallback(() => {
7452
if (isViewOnlyWallet) {

config/jest-presets/jest/jest-preset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = {
3333
// changedSince: 'master',
3434
// https://github.com/facebook/jest/issues/2663#issuecomment-341384494
3535
transformIgnorePatterns: [
36-
'node_modules/(?!(react-native|react-native-web|react-native-modal-selector|react-native-modal-datetime-picker|@storybook/react-native|@react-native-community/datetimepicker|react-native-image-colors|uuid|react-native-reanimated|react-native-safe-area-context|react-native-localize|@react-native-masked-view|statsig-js|statsig-react-native|statsig-react|@react-native|@react-native-firebase|react-native-webview|@gorhom|expo.*|d3-(array|color|format|interpolate|path|scale|shape|time-format|time)|internmap|react-native-qrcode-svg|react-native-modal|react-native-animatable|react-native-masked-view|redux-persist|react-native-url-polyfill|react-native-context-menu-view|react-native-wagmi-charts|react-native-markdown-display|react-native-redash|@walletconnect|moti|react-native-image-picker|wagmi|viem|rn-qr-generator)/)',
36+
'node_modules/(?!(react-native|react-native-web|react-native-modal-selector|react-native-modal-datetime-picker|@storybook/react-native|@react-native-community/datetimepicker|react-native-image-colors|uuid|react-native-reanimated|react-native-safe-area-context|react-native-localize|@react-native-masked-view|statsig-js|statsig-react-native|statsig-react|@react-native|@react-native-firebase|react-native-webview|@gorhom|expo.*|d3-(array|color|format|interpolate|path|scale|shape|time-format|time)|internmap|react-native-qrcode-svg|react-native-modal|react-native-animatable|react-native-masked-view|redux-persist|react-native-url-polyfill|react-native-context-menu-view|react-native-wagmi-charts|react-native-markdown-display|react-native-redash|@walletconnect|moti|react-native-image-picker|wagmi|viem)/)',
3737
],
3838
collectCoverage: false, // only collect in CI
3939
clearMocks: true,

packages/uniswap/src/components/TokenSelector/lists/TokenSectionBaseList/processTokenSections.ts

+13-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ export type ProcessedRow =
1717
| { type: ProcessedRowType.Footer; data: SectionRowInfo }
1818

1919
export function processTokenSections(sections: TokenSection[]): ProcessedRow[] {
20-
const result: ProcessedRow[] = []
20+
const resultSize = sections.reduce((acc, section) => {
21+
const dataLength = section.data.length
22+
return acc + (section.name ? 1 : 0) + dataLength
23+
}, 0)
24+
25+
const result: ProcessedRow[] = new Array(resultSize)
26+
let index = 0
2127

2228
for (const section of sections) {
2329
// process header
@@ -28,19 +34,19 @@ export function processTokenSections(sections: TokenSection[]): ProcessedRow[] {
2834
name: section.name,
2935
}
3036

31-
result.push({
37+
result[index++] = {
3238
type: ProcessedRowType.Header,
3339
data: {
3440
section: headerProps,
3541
},
36-
})
42+
}
3743

3844
// process items
3945
const tokenData = section.data
4046
let itemIndex = 0
4147

4248
for (const item of tokenData) {
43-
result.push({
49+
result[index++] = {
4450
type: ProcessedRowType.Item,
4551
data: {
4652
item,
@@ -49,15 +55,15 @@ export function processTokenSections(sections: TokenSection[]): ProcessedRow[] {
4955
// expanded is not used in native :thinking:
5056
expanded: false,
5157
},
52-
})
58+
}
5359
}
5460

55-
result.push({
61+
result[index++] = {
5662
type: ProcessedRowType.Footer,
5763
data: {
5864
section: headerProps,
5965
},
60-
})
66+
}
6167
}
6268

6369
return result

packages/uniswap/src/features/tokens/useCurrencyInfo.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ export function useCurrencyInfo(
3737
if (chainId && address) {
3838
const commonBase = getCommonBase(chainId, isNativeCurrencyAddress(chainId, address), address)
3939
if (commonBase) {
40+
// Creating new object to avoid error "Cannot assign to read only property"
41+
const copyCommonBase = { ...commonBase }
4042
// Related to TODO(WEB-5111)
4143
// Some common base images are broken so this'll ensure we read from uniswap images
4244
if (data?.token?.project?.logoUrl) {
43-
commonBase.logoUrl = data.token.project.logoUrl
45+
copyCommonBase.logoUrl = data.token.project.logoUrl
4446
}
45-
commonBase.currencyId = _currencyId
46-
return commonBase
47+
copyCommonBase.currencyId = _currencyId
48+
return copyCommonBase
4749
}
4850
}
4951

packages/uniswap/src/features/transactions/hooks/useUSDTokenUpdater.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ export function useUSDTokenUpdater({
3939
return undefined
4040
}
4141

42-
const _exactAmountFiat = exactAmountFiat === '.' ? '0' : exactAmountFiat || '0'
43-
const exactAmountUSD = (parseFloat(_exactAmountFiat) / conversionRate).toFixed(NUM_DECIMALS_USD)
42+
const exactAmountUSD = (parseFloat(exactAmountFiat || '0') / conversionRate).toFixed(NUM_DECIMALS_USD)
4443

4544
if (shouldUseUSDRef.current) {
4645
const stablecoinAmount = getCurrencyAmount({

yarn.lock

-10
Original file line numberDiff line numberDiff line change
@@ -17132,7 +17132,6 @@ __metadata:
1713217132
redux-persist: 6.0.0
1713317133
redux-saga: 1.2.2
1713417134
redux-saga-test-plan: 4.0.4
17135-
rn-qr-generator: 1.4.3
1713617135
typed-redux-saga: 1.5.0
1713717136
typescript: 5.3.3
1713817137
uniswap: "workspace:^"
@@ -42558,15 +42557,6 @@ __metadata:
4255842557
languageName: node
4255942558
linkType: hard
4256042559

42561-
"rn-qr-generator@npm:1.4.3":
42562-
version: 1.4.3
42563-
resolution: "rn-qr-generator@npm:1.4.3"
42564-
peerDependencies:
42565-
react-native: ">=0.55"
42566-
checksum: 570ee73fbc897a6fb5e9cb69b90e5f6542c2622004921658bec467b9cd564dc2b0f0b4440e87eac740121f717bf760e873ba0977ca1f7924e364f3586b98ba82
42567-
languageName: node
42568-
linkType: hard
42569-
4257042560
"roarr@npm:^2.15.3":
4257142561
version: 2.15.4
4257242562
resolution: "roarr@npm:2.15.4"

0 commit comments

Comments
 (0)