diff --git a/src/actions/WalletListMenuActions.tsx b/src/actions/WalletListMenuActions.tsx index 037cbc89786..89806c4f7c5 100644 --- a/src/actions/WalletListMenuActions.tsx +++ b/src/actions/WalletListMenuActions.tsx @@ -38,7 +38,7 @@ export type WalletListMenuKey = | string // for split keys like splitbitcoincash, splitethereum, etc. export function walletListMenuAction( - navigation: WalletsTabSceneProps<'walletList' | 'transactionList'>['navigation'], + navigation: WalletsTabSceneProps<'walletList' | 'walletDetails'>['navigation'], walletId: string, option: WalletListMenuKey, tokenId: EdgeTokenId, @@ -292,7 +292,7 @@ export function walletListMenuAction( const { currencyWallets } = account const wallet = currencyWallets[walletId] - navigation.navigate('transactionList', { + navigation.navigate('walletDetails', { walletId, tokenId: null, walletName: getWalletName(wallet) diff --git a/src/components/Main.tsx b/src/components/Main.tsx index fbe5eb52fe8..0a55d23f83c 100644 --- a/src/components/Main.tsx +++ b/src/components/Main.tsx @@ -125,10 +125,10 @@ import { SweepPrivateKeyCompletionScene as SweepPrivateKeyCompletionSceneCompone import { SweepPrivateKeyProcessingScene as SweepPrivateKeyProcessingSceneComponent } from './scenes/SweepPrivateKeyProcessingScene' import { SweepPrivateKeySelectCryptoScene as SweepPrivateKeySelectCryptoSceneComponent } from './scenes/SweepPrivateKeySelectCryptoScene' import { TransactionDetailsScene as TransactionDetailsSceneComponent } from './scenes/TransactionDetailsScene' -import { TransactionList as TransactionListComponent } from './scenes/TransactionListScene' -import { TransactionList2 as TransactionList2Component } from './scenes/TransactionListScene2' +import { TransactionList as TransactionListComponent } from './scenes/TransactionListScene2' import { TransactionsExportScene as TransactionsExportSceneComponent } from './scenes/TransactionsExportScene' import { UpgradeUsernameScene as UpgradeUsernameSceneComponent } from './scenes/UpgradeUsernameScreen' +import { WalletDetails as WalletDetailsComponent } from './scenes/WalletDetailsScene' import { WalletListScene as WalletListSceneComponent } from './scenes/WalletListScene' import { WalletRestoreScene as WalletRestoreSceneComponent } from './scenes/WalletRestoreScene' import { WcConnectionsScene as WcConnectionsSceneComponent } from './scenes/WcConnectionsScene' @@ -219,7 +219,7 @@ const SwapSettingsScene = ifLoggedIn(SwapSettingsSceneComponent) const SwapSuccessScene = ifLoggedIn(SwapSuccessSceneComponent) const TransactionDetailsScene = ifLoggedIn(TransactionDetailsSceneComponent) const TransactionList = ifLoggedIn(TransactionListComponent) -const TransactionList2 = ifLoggedIn(TransactionList2Component) +const WalletDetails = ifLoggedIn(WalletDetailsComponent) const TransactionsExportScene = ifLoggedIn(TransactionsExportSceneComponent) const WalletListScene = ifLoggedIn(WalletListSceneComponent) const WalletRestoreScene = ifLoggedIn(WalletRestoreSceneComponent) @@ -279,10 +279,10 @@ const EdgeWalletsTabScreen = () => { }} /> fromParams={params => params.walletName} /> + headerTitle: () => fromParams={params => params.walletName} /> }} /> @@ -791,10 +791,10 @@ const EdgeAppStack = () => { }} /> fromParams={params => params.walletName} /> + headerTitle: () => fromParams={params => params.walletName} /> }} /> ['navigation'] + navigation: WalletsTabSceneProps<'walletDetails'>['navigation'] } export const VisaCardCard = (props: Props) => { diff --git a/src/components/modals/WalletListMenuModal.tsx b/src/components/modals/WalletListMenuModal.tsx index 301d63ace93..95bc9eb9186 100644 --- a/src/components/modals/WalletListMenuModal.tsx +++ b/src/components/modals/WalletListMenuModal.tsx @@ -28,7 +28,7 @@ interface Option { interface Props { bridge: AirshipBridge - navigation: WalletsTabSceneProps<'walletList' | 'transactionList'>['navigation'] + navigation: WalletsTabSceneProps<'walletList' | 'walletDetails'>['navigation'] // Wallet identity: tokenId: EdgeTokenId diff --git a/src/components/scenes/TransactionListScene2.tsx b/src/components/scenes/TransactionListScene2.tsx index 3513b2aa11a..104690e2d37 100644 --- a/src/components/scenes/TransactionListScene2.tsx +++ b/src/components/scenes/TransactionListScene2.tsx @@ -25,7 +25,7 @@ import { SearchFooter } from '../themed/SearchFooter' import { EmptyLoader, SectionHeader, SectionHeaderCentered } from '../themed/TransactionListComponents' import { TransactionListRow } from '../themed/TransactionListRow' -export interface TransactionList2Params { +export interface TransactionListParams { walletId: string walletName: string tokenId: EdgeTokenId @@ -33,11 +33,11 @@ export interface TransactionList2Params { } type ListItem = EdgeTransaction | string | null -interface Props extends WalletsTabSceneProps<'transactionList2'> { +interface Props extends WalletsTabSceneProps<'transactionList'> { wallet: EdgeCurrencyWallet } -function TransactionList2Component(props: Props) { +function TransactionListComponent(props: Props) { const { navigation, route, wallet } = props const theme = useTheme() const styles = getStyles(theme) @@ -257,7 +257,7 @@ function checkToken(tokenId: EdgeTokenId, allTokens: EdgeTokenMap): EdgeTokenId return tokenId } -export const TransactionList2 = withWallet(TransactionList2Component) +export const TransactionList = withWallet(TransactionListComponent) const getStyles = cacheStyles(() => ({ flatList: { diff --git a/src/components/scenes/TransactionListScene.tsx b/src/components/scenes/WalletDetailsScene.tsx similarity index 95% rename from src/components/scenes/TransactionListScene.tsx rename to src/components/scenes/WalletDetailsScene.tsx index 6e5cc11e057..4511f9b0091 100644 --- a/src/components/scenes/TransactionListScene.tsx +++ b/src/components/scenes/WalletDetailsScene.tsx @@ -39,7 +39,7 @@ import { EmptyLoader, SectionHeaderCentered } from '../themed/TransactionListCom import { TransactionListRow } from '../themed/TransactionListRow' import { TransactionListTop } from '../themed/TransactionListTop' -export interface TransactionListParams { +export interface WalletDetailsParams { walletId: string walletName: string tokenId: EdgeTokenId @@ -47,11 +47,11 @@ export interface TransactionListParams { } type ListItem = EdgeTransaction | string | null -interface Props extends WalletsTabSceneProps<'transactionList'> { +interface Props extends WalletsTabSceneProps<'walletDetails'> { wallet: EdgeCurrencyWallet } -function TransactionListComponent(props: Props) { +function WalletDetailsComponent(props: Props) { const { navigation, route, wallet } = props const theme = useTheme() const styles = getStyles(theme) @@ -61,8 +61,7 @@ function TransactionListComponent(props: Props) { const tokenId = checkToken(route.params.tokenId, wallet.currencyConfig.allTokens) const { pluginId } = wallet.currencyInfo - const { currencyCode } = tokenId == null ? wallet.currencyInfo : wallet.currencyConfig.allTokens[tokenId] - const { displayName } = tokenId == null ? wallet.currencyInfo : wallet.currencyConfig.allTokens[tokenId] + const { currencyCode, displayName } = tokenId == null ? wallet.currencyInfo : wallet.currencyConfig.allTokens[tokenId] // State: const flashListRef = React.useRef | null>(null) @@ -173,7 +172,7 @@ function TransactionListComponent(props: Props) { }) const handlePressSeeAll = useHandler(() => { - navigation.navigate('transactionList2', route.params) + navigation.navigate('transactionList', route.params) }) // @@ -223,7 +222,7 @@ function TransactionListComponent(props: Props) { {fiatRateFormat} - + )} ({ flatList: { diff --git a/src/components/themed/TransactionListTop.tsx b/src/components/themed/TransactionListTop.tsx index d91de41abe7..e302b545b76 100644 --- a/src/components/themed/TransactionListTop.tsx +++ b/src/components/themed/TransactionListTop.tsx @@ -66,7 +66,7 @@ const SWAP_ASSET_PRIORITY: Array<{ pluginId: string; tokenId: EdgeTokenId }> = [ ] interface OwnProps { - navigation: WalletsTabSceneProps<'transactionList'>['navigation'] + navigation: WalletsTabSceneProps<'walletDetails'>['navigation'] isLightAccount: boolean diff --git a/src/components/themed/WalletListSwipeable.tsx b/src/components/themed/WalletListSwipeable.tsx index 0a18bfce487..34962a873bb 100644 --- a/src/components/themed/WalletListSwipeable.tsx +++ b/src/components/themed/WalletListSwipeable.tsx @@ -87,7 +87,7 @@ function WalletListSwipeableComponent(props: Props) { .then( activationNotRequired => activationNotRequired && - navigation.navigate('transactionList', { + navigation.navigate('walletDetails', { walletId, tokenId, walletName: wallet.name ?? wallet.currencyInfo.displayName, diff --git a/src/components/themed/WalletListSwipeableCurrencyRow.tsx b/src/components/themed/WalletListSwipeableCurrencyRow.tsx index d46b7425cce..c677e5722f2 100644 --- a/src/components/themed/WalletListSwipeableCurrencyRow.tsx +++ b/src/components/themed/WalletListSwipeableCurrencyRow.tsx @@ -86,7 +86,7 @@ function WalletListSwipeableCurrencyRowComponent(props: Props) { .then(async activated => { const { countryCode } = await getFirstOpenInfo() if (activated) { - navigation.navigate('transactionList', { + navigation.navigate('walletDetails', { tokenId, walletId: wallet.id, walletName: wallet.name ?? wallet.currencyInfo.displayName, diff --git a/src/types/routerTypes.tsx b/src/types/routerTypes.tsx index 59e79d9140f..f984b2a2c02 100644 --- a/src/types/routerTypes.tsx +++ b/src/types/routerTypes.tsx @@ -62,9 +62,9 @@ import type { SweepPrivateKeyCompletionParams } from '../components/scenes/Sweep import type { SweepPrivateKeyProcessingParams } from '../components/scenes/SweepPrivateKeyProcessingScene' import type { SweepPrivateKeySelectCryptoParams } from '../components/scenes/SweepPrivateKeySelectCryptoScene' import type { TransactionDetailsParams } from '../components/scenes/TransactionDetailsScene' -import type { TransactionListParams } from '../components/scenes/TransactionListScene' -import type { TransactionList2Params } from '../components/scenes/TransactionListScene2' +import type { TransactionListParams } from '../components/scenes/TransactionListScene2' import type { TransactionsExportParams } from '../components/scenes/TransactionsExportScene' +import type { WalletDetailsParams } from '../components/scenes/WalletDetailsScene' import type { WcConnectionsParams } from '../components/scenes/WcConnectionsScene' import type { WcConnectParams } from '../components/scenes/WcConnectScene' import type { WcDisconnectParams } from '../components/scenes/WcDisconnectScene' @@ -88,8 +88,8 @@ import type { FiatPluginSepaFormParams } from '../plugins/gui/scenes/SepaFormSce export type WalletsTabParamList = {} & { walletList: undefined + walletDetails: WalletDetailsParams transactionList: TransactionListParams - transactionList2: TransactionList2Params transactionDetails: TransactionDetailsParams } @@ -206,7 +206,7 @@ export type EdgeAppStackParamList = {} & { sweepPrivateKeySelectCrypto: SweepPrivateKeySelectCryptoParams testScene: undefined transactionDetails: TransactionDetailsParams - transactionList2: TransactionList2Params + transactionList2: TransactionListParams transactionsExport: TransactionsExportParams upgradeUsername: undefined walletRestore: undefined