Skip to content

Commit 5cf0c8c

Browse files
committed
fixup! Change title for WalletDetailsScene For the TransactionList, keep the same title so the user knows which wallet the transactions are for.
1 parent e7770a5 commit 5cf0c8c

File tree

8 files changed

+16
-30
lines changed

8 files changed

+16
-30
lines changed

src/actions/WalletListMenuActions.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,9 @@ export function walletListMenuAction(
287287

288288
case 'goToParent': {
289289
return async (dispatch, getState) => {
290-
const state = getState()
291-
const { account } = state.core
292-
const { currencyWallets } = account
293-
const wallet = currencyWallets[walletId]
294-
295290
navigation.navigate('walletDetails', {
296291
walletId,
297-
tokenId: null,
298-
walletName: getWalletName(wallet)
292+
tokenId: null
299293
})
300294
}
301295
}

src/components/cards/InfoCardCarousel.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { getBuildNumber, getVersion } from 'react-native-device-info'
66
import shajs from 'sha.js'
77

88
import { hideMessageTweak } from '../../actions/AccountReferralActions'
9+
import { getFirstOpenInfo } from '../../actions/FirstOpenActions'
10+
import { useAsyncValue } from '../../hooks/useAsyncValue'
911
import { useHandler } from '../../hooks/useHandler'
1012
import { useIsAccountFunded } from '../../hooks/useIsAccountFunded'
1113
import { useDispatch, useSelector } from '../../types/reactRedux'
@@ -22,16 +24,18 @@ interface Props {
2224
enterAnim: Anim
2325
screenWidth: number
2426
cards?: InfoCard[]
25-
countryCode?: string
2627
}
2728

2829
export const InfoCardCarousel = (props: Props) => {
29-
const { enterAnim, countryCode, navigation, screenWidth, cards } = props
30+
const { enterAnim, navigation, screenWidth, cards } = props
3031
const theme = useTheme()
3132
const dispatch = useDispatch()
3233

3334
const accountReferral = useSelector(state => state.account.accountReferral)
3435

36+
const [firstOpenInfo] = useAsyncValue(async () => await getFirstOpenInfo())
37+
const { countryCode } = firstOpenInfo ?? {}
38+
3539
const [filteredCards, setFilteredCards] = React.useState<FilteredInfoCard[]>([])
3640

3741
// Set account funded status

src/components/scenes/HomeScene.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ export const HomeScene = (props: Props) => {
147147
<InfoCardCarousel
148148
enterAnim={fadeInUp110}
149149
cards={infoServerData.rollup?.promoCards2}
150-
countryCode={countryCode}
151150
navigation={navigation as NavigationBase}
152151
screenWidth={screenWidth}
153152
/>

src/components/scenes/TransactionListScene.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ import { TransactionListRow } from '../themed/TransactionListRow'
3030

3131
export interface TransactionListParams {
3232
walletId: string
33-
walletName: string
3433
tokenId: EdgeTokenId
35-
countryCode?: string
3634
searchText?: string
3735
}
3836

src/components/scenes/WalletDetailsScene.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ import { TransactionListTop } from '../themed/TransactionListTop'
4646

4747
export interface WalletDetailsParams {
4848
walletId: string
49-
walletName: string
5049
tokenId: EdgeTokenId
51-
countryCode?: string
5250
}
5351

5452
interface Props extends WalletsTabSceneProps<'walletDetails'> {
@@ -284,7 +282,6 @@ function WalletDetailsComponent(props: Props) {
284282
enterAnim={fadeInDown10}
285283
cards={(infoServerData.rollup?.assetStatusCards2 ?? {})[`${pluginId}${tokenId == null ? '' : `_${tokenId}`}`]}
286284
navigation={navigation as NavigationBase}
287-
countryCode={route.params.countryCode}
288285
screenWidth={screenWidth}
289286
/>
290287
{assetId != null && <SectionHeaderUi4 leftTitle={displayName} rightNode={lstrings.coin_rank_see_more} onRightPress={handlePressCoinRanking} />}
@@ -315,7 +312,7 @@ function WalletDetailsComponent(props: Props) {
315312
) : isSearching ? (
316313
<EdgeText style={styles.noResultsText}>{lstrings.transaction_list_search_no_result}</EdgeText>
317314
) : (
318-
<BuyCrypto countryCode={route.params.countryCode} navigation={navigation as NavigationBase} wallet={wallet} tokenId={tokenId} />
315+
<BuyCrypto navigation={navigation as NavigationBase} wallet={wallet} tokenId={tokenId} />
319316
)}
320317
</View>
321318
</Reanimated.ScrollView>

src/components/themed/BuyCrypto.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import * as React from 'react'
33
import { View } from 'react-native'
44
import { sprintf } from 'sprintf-js'
55

6+
import { getFirstOpenInfo } from '../../actions/FirstOpenActions'
67
import { DONE_THRESHOLD, SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants'
8+
import { useAsyncValue } from '../../hooks/useAsyncValue'
79
import { useHandler } from '../../hooks/useHandler'
810
import { useWatch } from '../../hooks/useWatch'
911
import { toPercentString } from '../../locales/intl'
@@ -21,18 +23,20 @@ interface OwnProps {
2123
wallet: EdgeCurrencyWallet
2224
tokenId: EdgeTokenId
2325
navigation: NavigationBase
24-
countryCode?: string
2526
}
2627

2728
type Props = OwnProps
2829

2930
export const BuyCrypto = (props: Props) => {
30-
const { countryCode, wallet, tokenId, navigation } = props
31+
const { wallet, tokenId, navigation } = props
3132
const theme = useTheme()
3233
const styles = getStyles(theme)
3334

3435
const syncRatio = useWatch(wallet, 'syncRatio')
3536

37+
const [firstOpenInfo] = useAsyncValue(async () => await getFirstOpenInfo())
38+
const { countryCode } = firstOpenInfo ?? {}
39+
3640
const handlePress = useHandler(() => {
3741
navigation.navigate('buyTab', { screen: 'pluginListBuy' })
3842
})

src/components/themed/WalletListSwipeable.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useMemo } from 'react'
44
import { FlatList, RefreshControl } from 'react-native'
55
import Animated from 'react-native-reanimated'
66

7-
import { getFirstOpenInfo } from '../../actions/FirstOpenActions'
87
import { selectWalletToken } from '../../actions/WalletActions'
98
import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings'
109
import { useHandler } from '../../hooks/useHandler'
@@ -75,8 +74,6 @@ function WalletListSwipeableComponent(props: Props) {
7574
)
7675

7776
const handleCreateWallet = useHandler(async (walletId: string, tokenId: EdgeTokenId) => {
78-
const wallet = account.currencyWallets[walletId]
79-
const { countryCode } = await getFirstOpenInfo()
8077
dispatch(
8178
selectWalletToken({
8279
navigation: navigation as NavigationBase,
@@ -89,9 +86,7 @@ function WalletListSwipeableComponent(props: Props) {
8986
activationNotRequired &&
9087
navigation.navigate('walletDetails', {
9188
walletId,
92-
tokenId,
93-
walletName: wallet.name ?? wallet.currencyInfo.displayName,
94-
countryCode
89+
tokenId
9590
})
9691
)
9792
.finally(onReset)

src/components/themed/WalletListSwipeableCurrencyRow.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Text } from 'react-native'
44
import { SharedValue } from 'react-native-reanimated'
55

66
import { checkAndShowLightBackupModal } from '../../actions/BackupModalActions'
7-
import { getFirstOpenInfo } from '../../actions/FirstOpenActions'
87
import { selectWalletToken } from '../../actions/WalletActions'
98
import { Fontello } from '../../assets/vector/index'
109
import { useHandler } from '../../hooks/useHandler'
@@ -20,7 +19,6 @@ import { WalletListCurrencyRow } from '../themed/WalletListCurrencyRow'
2019

2120
interface Props {
2221
navigation: WalletsTabSceneProps<'walletList'>['navigation']
23-
2422
token?: EdgeToken
2523
tokenId: EdgeTokenId
2624
wallet: EdgeCurrencyWallet
@@ -84,13 +82,10 @@ function WalletListSwipeableCurrencyRowComponent(props: Props) {
8482
})
8583
)
8684
.then(async activated => {
87-
const { countryCode } = await getFirstOpenInfo()
8885
if (activated) {
8986
navigation.navigate('walletDetails', {
9087
tokenId,
91-
walletId: wallet.id,
92-
walletName: wallet.name ?? wallet.currencyInfo.displayName,
93-
countryCode
88+
walletId: wallet.id
9489
})
9590
}
9691
})

0 commit comments

Comments
 (0)