Skip to content

Commit 39d285e

Browse files
ci(release): publish latest release
1 parent 2dd993d commit 39d285e

File tree

6 files changed

+33
-65
lines changed

6 files changed

+33
-65
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mobile/1.62.1
1+
extension/1.62.1

apps/mobile/src/components/explore/ExploreSections/ExploreSections.tsx

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import { TokenItemData } from 'src/components/explore/TokenItemData'
3030
import { getTokenMetadataDisplayType } from 'src/features/explore/utils'
3131
import { Flex, Loader, Text } from 'ui/src'
3232
import { AnimatedBottomSheetFlashList } from 'ui/src/components/AnimatedFlashList/AnimatedFlashList'
33-
import { NoTokens } from 'ui/src/components/icons'
3433
import { spacing } from 'ui/src/theme'
3534
import { BaseCard } from 'uniswap/src/components/BaseCard/BaseCard'
3635
import { useTokenRankingsQuery } from 'uniswap/src/data/rest/tokenRankings'
@@ -155,15 +154,10 @@ function _ExploreSections({
155154
}, [insets.bottom])
156155

157156
const dataWithBottomTabs = useMemo(
158-
() => (showFullScreenLoadingState ? [] : topTokenItems),
157+
() => (showFullScreenLoadingState ? [] : (topTokenItems ?? [])),
159158
[showFullScreenLoadingState, topTokenItems],
160159
)
161160

162-
const listEmptyComponent = useMemo(
163-
() => <TokenListEmptyComponent isLoading={showFullScreenLoadingState} />,
164-
[showFullScreenLoadingState],
165-
)
166-
167161
if (!hasAllData && error) {
168162
return (
169163
<Flex height="100%" pb="$spacing60">
@@ -182,7 +176,7 @@ function _ExploreSections({
182176
<LegendList
183177
ref={legendListRef}
184178
refScrollView={scrollRef}
185-
ListEmptyComponent={listEmptyComponent}
179+
ListEmptyComponent={ListEmptyComponent}
186180
ListHeaderComponent={
187181
<ListHeaderComponent
188182
listRef={scrollRef}
@@ -214,7 +208,7 @@ function _ExploreSections({
214208
<Flex fill animation="100ms">
215209
<AnimatedBottomSheetFlashList
216210
ref={listRef}
217-
ListEmptyComponent={listEmptyComponent}
211+
ListEmptyComponent={ListEmptyComponent}
218212
ListHeaderComponent={
219213
<ListHeaderComponent
220214
listRef={listRef}
@@ -304,9 +298,9 @@ function processTokens(
304298

305299
function processTokenRankings(
306300
tokenRankings: TokenRankingsResponse['tokenRankings'] | undefined,
307-
): Partial<Record<ExploreOrderBy, TokenItemDataWithMetadata[]>> {
301+
): Record<ExploreOrderBy, TokenItemDataWithMetadata[]> {
308302
if (!tokenRankings) {
309-
return {} as const
303+
return {} as Record<ExploreOrderBy, TokenItemDataWithMetadata[]>
310304
}
311305

312306
const result: Record<string, TokenItemDataWithMetadata[]> = {}
@@ -327,11 +321,14 @@ function processTokenRankings(
327321
return result
328322
}
329323

330-
function useTokenItems(data: TokenRankingsResponse | undefined, orderBy: ExploreOrderBy): TokenItemDataWithMetadata[] {
324+
function useTokenItems(
325+
data: TokenRankingsResponse | undefined,
326+
orderBy: ExploreOrderBy,
327+
): TokenItemDataWithMetadata[] | undefined {
331328
// process all the token rankings into a map of orderBy to token items (only do this once)
332329
const allTokenItemsByOrderBy = useMemo(() => processTokenRankings(data?.tokenRankings), [data])
333-
// return the token items for the given orderBy, or empty array if the orderBy key doesn't exist
334-
return useMemo(() => allTokenItemsByOrderBy[orderBy] ?? [], [allTokenItemsByOrderBy, orderBy])
330+
// return the token items for the given orderBy
331+
return useMemo(() => allTokenItemsByOrderBy[orderBy], [allTokenItemsByOrderBy, orderBy])
335332
}
336333

337334
type ListHeaderProps = {
@@ -389,31 +386,11 @@ const ListHeaderComponent = ({
389386
)
390387
}
391388

392-
const TokenListEmptyComponent = memo(function TokenListEmptyComponent({
393-
isLoading,
394-
}: {
395-
isLoading: boolean
396-
}): JSX.Element {
397-
const { t } = useTranslation()
398-
399-
if (isLoading) {
400-
return (
401-
<Flex mx="$spacing24" my="$spacing12">
402-
<Loader.Token repeat={5} />
403-
</Flex>
404-
)
405-
}
406-
407-
return (
408-
<Flex centered pt="$spacing48" px="$spacing36">
409-
<BaseCard.EmptyState
410-
description={t('explore.tokens.empty.description')}
411-
icon={<NoTokens color="$neutral3" size="$icon.70" />}
412-
title={t('explore.tokens.empty.title')}
413-
/>
414-
</Flex>
415-
)
416-
})
389+
const ListEmptyComponent = (): JSX.Element => (
390+
<Flex mx="$spacing24" my="$spacing12">
391+
<Loader.Token repeat={5} />
392+
</Flex>
393+
)
417394

418395
function useOrderBy(): {
419396
uiOrderBy: ExploreOrderBy

packages/uniswap/src/components/menus/ContextMenuV2.native.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,15 @@ export function ContextMenu({
184184
setIsMenuVisible(false)
185185
}}
186186
onPress={() => {
187-
// close the menu first to allow the closing animation to trigger asap
188-
setIsMenuVisible(false)
189-
closeMenu()
190-
// pushes the main action (problematic navigation action) to the end of the event loop
191-
// to allow the menu to close properly before
192-
setTimeout(() => {
193-
try {
194-
// run both actions; `onPressAny` will not run if `onPressAction` throws
195-
onPressAction()
196-
onPressAny?.({ name: label, index, indexPath: [index] })
197-
} catch (error) {
198-
logger.error(error, {
199-
tags: { file: 'ContextMenuV2.tsx', function: 'createPressHandler' },
200-
})
201-
}
202-
}, 0)
187+
try {
188+
// run both actions; `onPressAny` will not run if `onPressAction` throws
189+
onPressAction()
190+
onPressAny?.({ name: label, index, indexPath: [index] })
191+
} catch (error) {
192+
logger.error(error, {
193+
tags: { file: 'ContextMenuV2.tsx', function: 'createPressHandler' },
194+
})
195+
}
203196
}}
204197
{...otherProps}
205198
/>

packages/uniswap/src/i18n/locales/source/en-US.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,8 +741,6 @@
741741
"explore.search.section.nft": "NFT Collections",
742742
"explore.search.section.popularNFT": "Popular NFT collections",
743743
"explore.search.section.wallets": "Wallets",
744-
"explore.tokens.empty.description": "There are no tokens available for this network and filter combination.",
745-
"explore.tokens.empty.title": "No tokens found",
746744
"explore.tokens.error": "Couldn’t load tokens",
747745
"explore.tokens.favorite.action.add": "Favorite token",
748746
"explore.tokens.favorite.action.edit": "Edit favorites",

packages/utilities/src/format/localeBased.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ it('formats fiat estimates for tokens correctly', () => {
8383
expect(formatNumber({ input: 1234.5678, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('$1,234.57')
8484

8585
expect(formatNumber({ input: 0.010235, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('$0.0102')
86-
expect(formatNumber({ input: 0.001231, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('$0.00123')
87-
expect(formatNumber({ input: 0.00001231, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('$0.0000123')
86+
expect(formatNumber({ input: 0.001231, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('<$0.01')
87+
expect(formatNumber({ input: 0.00001231, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('<$0.01')
8888

89-
expect(formatNumber({ input: 1.234e-7, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('$0.000000123')
90-
expect(formatNumber({ input: 9.876e-9, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('<$0.00000001')
89+
expect(formatNumber({ input: 1.234e-7, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('<$0.01')
90+
expect(formatNumber({ input: 9.876e-9, type: NumberType.FiatTokenPrice, locale: 'en-US' })).toBe('<$0.01')
9191
})
9292

9393
it('formats fiat estimates for token stats correctly', () => {

packages/utilities/src/format/localeBasedFormats.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ export const fiatTokenDetailsFormatter: Formatter = {
515515
export const fiatTokenPricesFormatter: Formatter = {
516516
rules: [
517517
{
518-
upperBound: 0.00000001,
519-
overrideValue: 0.00000001,
520-
formatter: SmallestNumCurrency,
518+
upperBound: 0.01,
519+
overrideValue: 0.01,
520+
formatter: TwoDecimalsCurrency,
521521
postFormatModifier: lessThanPostFormatModifier,
522522
},
523523
{ upperBound: 1, formatter: ThreeSigFigsCurrency },

0 commit comments

Comments
 (0)