Skip to content

Commit e4ad258

Browse files
committed
Make modal titles specific to the action
"Select Asset to Purchase/Sell" to match the Buy/Sell scenes' modals For the rest, generic "Select Wallet" since Swap can go either direction once you are on the scene, and Earn can be both the stake and/or reward asset.
1 parent 67705c9 commit e4ad258

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/components/scenes/CoinRankingDetailsScene.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ const CoinRankingDetailsSceneComponent = (props: Props) => {
355355
*/
356356
const chooseWalletListResult = async (
357357
filteredEdgeAssets: EdgeAsset[],
358-
filteredMatchingWallets: EdgeCurrencyWallet[]
358+
filteredMatchingWallets: EdgeCurrencyWallet[],
359+
title: string
359360
): Promise<Extract<WalletListResult, { type: 'wallet' }> | undefined> => {
360361
// No compatible assets. Shouldn't happen since buttons are blocked from
361362
// handlers anyway, if there's no filteredEdgeAssets
@@ -390,13 +391,7 @@ const CoinRankingDetailsSceneComponent = (props: Props) => {
390391

391392
// Else, If multiple wallets, show picker. Tokens also can be added here.
392393
const result = await Airship.show<WalletListResult>(bridge => (
393-
<WalletListModal
394-
bridge={bridge}
395-
navigation={navigation as NavigationBase}
396-
headerTitle={lstrings.select_wallet_to_send_from}
397-
allowedAssets={filteredEdgeAssets}
398-
showCreateWallet
399-
/>
394+
<WalletListModal bridge={bridge} navigation={navigation as NavigationBase} headerTitle={title} allowedAssets={filteredEdgeAssets} showCreateWallet />
400395
))
401396
// User aborted the flow. Callers will also noop.
402397
if (result?.type !== 'wallet') return
@@ -405,7 +400,7 @@ const CoinRankingDetailsSceneComponent = (props: Props) => {
405400

406401
const handleBuyPress = useHandler(async () => {
407402
if (edgeAssets.length === 0) return
408-
const forcedWalletResult = await chooseWalletListResult(edgeAssets, matchingWallets)
403+
const forcedWalletResult = await chooseWalletListResult(edgeAssets, matchingWallets, lstrings.fiat_plugin_select_asset_to_purchase)
409404
if (forcedWalletResult == null) return
410405

411406
navigation.navigate('edgeTabs', {
@@ -421,7 +416,7 @@ const CoinRankingDetailsSceneComponent = (props: Props) => {
421416

422417
const handleSellPress = useHandler(async () => {
423418
if (edgeAssets.length === 0) return
424-
const forcedWalletResult = await chooseWalletListResult(edgeAssets, matchingWallets)
419+
const forcedWalletResult = await chooseWalletListResult(edgeAssets, matchingWallets, lstrings.fiat_plugin_select_asset_to_sell)
425420
if (forcedWalletResult == null) return
426421

427422
navigation.navigate('edgeTabs', {
@@ -438,7 +433,7 @@ const CoinRankingDetailsSceneComponent = (props: Props) => {
438433
const handleSwapPress = useHandler(async () => {
439434
if (edgeAssets.length === 0) return
440435

441-
const walletListResult = await chooseWalletListResult(edgeAssets, matchingWallets)
436+
const walletListResult = await chooseWalletListResult(edgeAssets, matchingWallets, lstrings.select_wallet)
442437
if (walletListResult == null) return
443438

444439
const { walletId, tokenId } = walletListResult
@@ -483,7 +478,7 @@ const CoinRankingDetailsSceneComponent = (props: Props) => {
483478
})
484479

485480
const handleStakePress = useHandler(async () => {
486-
const walletListResult = await chooseWalletListResult(edgeStakingAssets, stakingWallets)
481+
const walletListResult = await chooseWalletListResult(edgeStakingAssets, stakingWallets, lstrings.select_wallet)
487482
if (walletListResult == null) return
488483
const { walletId } = walletListResult
489484

0 commit comments

Comments
 (0)