Skip to content

Commit 031ac22

Browse files
committed
Change title for WalletDetailsScene
For the TransactionList, keep the same title so the user knows which wallet the transactions are for.
1 parent d7715cf commit 031ac22

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased (develop)
44

5+
- changed: `WalletDetailsScene` title shows the name of the network for most use cases
6+
57
## 4.22.0 (staging)
68

79
- added: `NotificationCenterScene`

src/actions/WalletListMenuActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function walletListMenuAction(
295295
navigation.navigate('walletDetails', {
296296
walletId,
297297
tokenId: null,
298-
walletName: getWalletName(wallet)
298+
sceneTitle: sprintf(lstrings.create_wallet_account_metadata_name, wallet.currencyInfo.displayName)
299299
})
300300
}
301301
}

src/components/Main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ const EdgeWalletsTabScreen = () => {
284284
name="walletDetails"
285285
component={WalletDetails}
286286
options={{
287-
headerTitle: () => <ParamHeaderTitle<'walletDetails'> fromParams={params => params.walletName} />
287+
headerTitle: () => <ParamHeaderTitle<'walletDetails'> fromParams={params => params.sceneTitle} />
288288
}}
289289
/>
290290
</WalletsStack.Navigator>

src/components/scenes/WalletDetailsScene.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { FooterRender } from '../../state/SceneFooterState'
2121
import { useSceneScrollHandler } from '../../state/SceneScrollState'
2222
import { useDispatch, useSelector } from '../../types/reactRedux'
2323
import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes'
24+
import { getWalletName } from '../../util/CurrencyWalletHelpers'
2425
import { coinrankListData, infoServerData } from '../../util/network'
2526
import { calculateSpamThreshold, convertNativeToDenomination, darkenHexColor, zeroString } from '../../util/utils'
2627
import { EdgeCard } from '../cards/EdgeCard'
@@ -42,7 +43,7 @@ import { TransactionListTop } from '../themed/TransactionListTop'
4243

4344
export interface WalletDetailsParams {
4445
walletId: string
45-
walletName: string
46+
sceneTitle: string
4647
tokenId: EdgeTokenId
4748
countryCode?: string
4849
}
@@ -174,7 +175,12 @@ function WalletDetailsComponent(props: Props) {
174175
})
175176

176177
const handlePressSeeAll = useHandler(() => {
177-
navigation.navigate('transactionList', route.params)
178+
navigation.navigate('transactionList', {
179+
walletId: wallet.id,
180+
tokenId,
181+
walletName: getWalletName(wallet),
182+
countryCode: route.params.countryCode
183+
})
178184
})
179185

180186
//

src/components/themed/WalletListSwipeable.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import * as React from 'react'
33
import { useMemo } from 'react'
44
import { FlatList, RefreshControl } from 'react-native'
55
import Animated from 'react-native-reanimated'
6+
import { sprintf } from 'sprintf-js'
67

78
import { getFirstOpenInfo } from '../../actions/FirstOpenActions'
89
import { selectWalletToken } from '../../actions/WalletActions'
910
import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings'
1011
import { useHandler } from '../../hooks/useHandler'
12+
import { lstrings } from '../../locales/strings'
1113
import { filterWalletCreateItemListBySearchText, getCreateWalletList, WalletCreateItem } from '../../selectors/getCreateWalletList'
1214
import { useSceneScrollHandler } from '../../state/SceneScrollState'
1315
import { useDispatch, useSelector } from '../../types/reactRedux'
@@ -90,7 +92,7 @@ function WalletListSwipeableComponent(props: Props) {
9092
navigation.navigate('walletDetails', {
9193
walletId,
9294
tokenId,
93-
walletName: wallet.name ?? wallet.currencyInfo.displayName,
95+
sceneTitle: sprintf(lstrings.create_wallet_account_metadata_name, wallet.currencyInfo.displayName),
9496
countryCode
9597
})
9698
)

src/components/themed/WalletListSwipeableCurrencyRow.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { EdgeCurrencyWallet, EdgeToken, EdgeTokenId } from 'edge-core-js'
22
import * as React from 'react'
33
import { Text } from 'react-native'
44
import { SharedValue } from 'react-native-reanimated'
5+
import { sprintf } from 'sprintf-js'
56

67
import { checkAndShowLightBackupModal } from '../../actions/BackupModalActions'
78
import { getFirstOpenInfo } from '../../actions/FirstOpenActions'
89
import { selectWalletToken } from '../../actions/WalletActions'
910
import { Fontello } from '../../assets/vector/index'
1011
import { useHandler } from '../../hooks/useHandler'
12+
import { lstrings } from '../../locales/strings'
1113
import { useDispatch, useSelector } from '../../types/reactRedux'
1214
import { NavigationBase, WalletsTabSceneProps } from '../../types/routerTypes'
1315
import { EdgeTouchableOpacity } from '../common/EdgeTouchableOpacity'
@@ -89,7 +91,7 @@ function WalletListSwipeableCurrencyRowComponent(props: Props) {
8991
navigation.navigate('walletDetails', {
9092
tokenId,
9193
walletId: wallet.id,
92-
walletName: wallet.name ?? wallet.currencyInfo.displayName,
94+
sceneTitle: sprintf(lstrings.create_wallet_account_metadata_name, wallet.currencyInfo.displayName),
9395
countryCode
9496
})
9597
}

0 commit comments

Comments
 (0)