@@ -3,6 +3,7 @@ import { TouchableOpacity } from 'react-native';
3
3
import { useSelector } from 'react-redux' ;
4
4
5
5
import { BASE_CRYPTO_MAX_DISPLAYED_DECIMALS } from '@suite-common/formatters' ;
6
+ import { NetworkSymbol } from '@suite-common/wallet-config' ;
6
7
import { AccountsRootState , selectAccountNetworkSymbol } from '@suite-common/wallet-core' ;
7
8
import { Box , Card , Text } from '@suite-native/atoms' ;
8
9
import { CryptoAmountFormatter , CryptoToFiatAmountFormatter } from '@suite-native/formatters' ;
@@ -15,20 +16,34 @@ import {
15
16
import { NativeStakingRootState } from '@suite-native/staking/src/types' ;
16
17
import { prepareNativeStyle , useNativeStyles } from '@trezor/styles' ;
17
18
19
+ type StakePendingCardProps = {
20
+ accountKey : string ;
21
+ handleToggleBottomSheet : ( value : boolean ) => void ;
22
+ } ;
18
23
const stakingItemStyle = prepareNativeStyle ( utils => ( {
19
24
flexDirection : 'row' ,
20
25
alignItems : 'center' ,
21
26
gap : utils . spacings . sp4 ,
22
27
} ) ) ;
23
28
24
29
const valuesContainerStyle = prepareNativeStyle ( utils => ( {
25
- maxWidth : '40 %' ,
30
+ maxWidth : '45 %' ,
26
31
flexShrink : 0 ,
27
32
alignItems : 'flex-end' ,
28
33
paddingLeft : utils . spacings . sp8 ,
29
34
} ) ) ;
30
35
31
- const getCardAlertProps = ( isStakeConfirming : boolean , isStakePending : boolean ) => {
36
+ const isSolana = ( symbol : NetworkSymbol ) => [ 'sol' , 'dsol' ] . includes ( symbol ) ;
37
+
38
+ const getCardAlertProps = (
39
+ symbol : NetworkSymbol | null ,
40
+ isStakeConfirming : boolean ,
41
+ isStakePending : boolean ,
42
+ ) => {
43
+ if ( ! symbol ) {
44
+ return { alertTitle : undefined , alertVariant : undefined } as const ;
45
+ }
46
+
32
47
if ( isStakeConfirming && ! isStakePending ) {
33
48
return {
34
49
alertTitle : < Translation id = "staking.stakePendingCard.transactionPending" /> ,
@@ -37,7 +52,11 @@ const getCardAlertProps = (isStakeConfirming: boolean, isStakePending: boolean)
37
52
}
38
53
if ( ! isStakeConfirming && isStakePending ) {
39
54
return {
40
- alertTitle : < Translation id = "staking.stakePendingCard.addingToStakingPool" /> ,
55
+ alertTitle : isSolana ( symbol ) ? (
56
+ < Translation id = "staking.stakePendingCard.activatingStake" />
57
+ ) : (
58
+ < Translation id = "staking.stakePendingCard.addingToStakingPool" />
59
+ ) ,
41
60
alertVariant : 'loading' ,
42
61
} as const ;
43
62
}
@@ -48,10 +67,12 @@ const getCardAlertProps = (isStakeConfirming: boolean, isStakePending: boolean)
48
67
} as const ;
49
68
} ;
50
69
51
- type StakePendingCardProps = {
52
- accountKey : string ;
53
- handleToggleBottomSheet : ( value : boolean ) => void ;
54
- } ;
70
+ const getTitle = ( symbol : NetworkSymbol ) =>
71
+ isSolana ( symbol ) ? (
72
+ < Translation id = "staking.stakePendingCard.totalStakeActivating" />
73
+ ) : (
74
+ < Translation id = "staking.stakePendingCard.totalStakePending" />
75
+ ) ;
55
76
56
77
export const StakePendingCard = ( {
57
78
accountKey,
@@ -75,20 +96,20 @@ export const StakePendingCard = ({
75
96
) ;
76
97
77
98
const cardAlertProps = useMemo (
78
- ( ) => getCardAlertProps ( isStakeConfirming , isStakePending ) ,
79
- [ isStakeConfirming , isStakePending ] ,
99
+ ( ) => getCardAlertProps ( symbol , isStakeConfirming , isStakePending ) ,
100
+ [ symbol , isStakeConfirming , isStakePending ] ,
80
101
) ;
81
102
82
103
if ( ! symbol || ! cardAlertProps . alertVariant ) return null ;
83
104
105
+ const title = getTitle ( symbol ) ;
106
+
84
107
return (
85
108
< TouchableOpacity onPress = { ( ) => handleToggleBottomSheet ( true ) } >
86
109
< Card { ...cardAlertProps } >
87
110
< Box style = { applyStyle ( stakingItemStyle ) } >
88
111
< Box flex = { 1 } flexDirection = "row" alignItems = "center" >
89
- < Text >
90
- < Translation id = "staking.stakePendingCard.totalStakePending" />
91
- </ Text >
112
+ < Text > { title } </ Text >
92
113
</ Box >
93
114
< Box style = { applyStyle ( valuesContainerStyle ) } >
94
115
< CryptoAmountFormatter
0 commit comments