1+ import { useRoute } from '@react-navigation/native'
12import { gt , mul } from 'biggystring'
23import { EdgeCurrencyWallet , EdgeTokenId , EdgeTokenMap , EdgeTransaction } from 'edge-core-js'
34import * as React from 'react'
45import { Platform , RefreshControl , View } from 'react-native'
56import Reanimated from 'react-native-reanimated'
67import { AnimatedScrollView } from 'react-native-reanimated/lib/typescript/component/ScrollView'
78import { useSafeAreaFrame } from 'react-native-safe-area-context'
9+ import { sprintf } from 'sprintf-js'
810
911import { activateWalletTokens } from '../../actions/WalletActions'
1012import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings'
@@ -21,7 +23,7 @@ import { getExchangeRate } from '../../selectors/WalletSelectors'
2123import { FooterRender } from '../../state/SceneFooterState'
2224import { useSceneScrollHandler } from '../../state/SceneScrollState'
2325import { useDispatch , useSelector } from '../../types/reactRedux'
24- import { NavigationBase , WalletsTabSceneProps } from '../../types/routerTypes'
26+ import { NavigationBase , RouteProp , WalletsTabSceneProps } from '../../types/routerTypes'
2527import { coinrankListData , infoServerData } from '../../util/network'
2628import { calculateSpamThreshold , convertNativeToDenomination , darkenHexColor } from '../../util/utils'
2729import { EdgeCard } from '../cards/EdgeCard'
@@ -32,6 +34,7 @@ import { fadeInDown10 } from '../common/EdgeAnim'
3234import { SceneWrapper } from '../common/SceneWrapper'
3335import { SectionHeader as SectionHeaderUi4 } from '../common/SectionHeader'
3436import { withWallet } from '../hoc/withWallet'
37+ import { HeaderTitle } from '../navigation/HeaderTitle'
3538import { cacheStyles , Theme , useTheme } from '../services/ThemeContext'
3639import { BuyCrypto } from '../themed/BuyCrypto'
3740import { EdgeText , Paragraph } from '../themed/EdgeText'
@@ -43,9 +46,7 @@ import { TransactionListTop } from '../themed/TransactionListTop'
4346
4447export interface WalletDetailsParams {
4548 walletId : string
46- walletName : string
4749 tokenId : EdgeTokenId
48- countryCode ?: string
4950}
5051
5152interface Props extends WalletsTabSceneProps < 'walletDetails' > {
@@ -281,7 +282,6 @@ function WalletDetailsComponent(props: Props) {
281282 enterAnim = { fadeInDown10 }
282283 cards = { ( infoServerData . rollup ?. assetStatusCards2 ?? { } ) [ `${ pluginId } ${ tokenId == null ? '' : `_${ tokenId } ` } ` ] }
283284 navigation = { navigation as NavigationBase }
284- countryCode = { route . params . countryCode }
285285 screenWidth = { screenWidth }
286286 />
287287 { assetId != null && < SectionHeaderUi4 leftTitle = { displayName } rightNode = { lstrings . coin_rank_see_more } onRightPress = { handlePressCoinRanking } /> }
@@ -312,7 +312,7 @@ function WalletDetailsComponent(props: Props) {
312312 ) : isSearching ? (
313313 < EdgeText style = { styles . noResultsText } > { lstrings . transaction_list_search_no_result } </ EdgeText >
314314 ) : (
315- < BuyCrypto countryCode = { route . params . countryCode } navigation = { navigation as NavigationBase } wallet = { wallet } tokenId = { tokenId } />
315+ < BuyCrypto navigation = { navigation as NavigationBase } wallet = { wallet } tokenId = { tokenId } />
316316 ) }
317317 </ View >
318318 </ Reanimated . ScrollView >
@@ -321,6 +321,14 @@ function WalletDetailsComponent(props: Props) {
321321 )
322322}
323323
324+ export const WalletDetailsTitle = ( params : { customTitle ?: string } ) => {
325+ const route = useRoute < RouteProp < 'walletDetails' > > ( )
326+ const account = useSelector ( state => state . core . account )
327+ const wallet = account . currencyWallets [ route . params . walletId ]
328+ const title = sprintf ( lstrings . create_wallet_account_metadata_name , wallet ?. currencyInfo . displayName )
329+ return < HeaderTitle title = { title } />
330+ }
331+
324332const getStyles = cacheStyles ( ( theme : Theme ) => ( {
325333 txListContainer : {
326334 // A bit less than 5 transaction rows:
0 commit comments