@@ -9,7 +9,9 @@ import SwapButton, {
9
9
ButtonText ,
10
10
SwapButtonContainer ,
11
11
} from '../../components/swap-button/SwapButton' ;
12
- import VirtualKeyboard from '../../components/virtual-keyboard/VirtualKeyboard' ;
12
+ import VirtualKeyboard , {
13
+ PIXEL_DENSITY_LIMIT ,
14
+ } from '../../components/virtual-keyboard/VirtualKeyboard' ;
13
15
import { getAvailableFiatCurrencies } from '../../navigation/services/buy-crypto/utils/buy-crypto-utils' ;
14
16
import { getAvailableSellCryptoFiatCurrencies } from '../../navigation/services/sell-crypto/utils/sell-crypto-utils' ;
15
17
import { ParseAmount } from '../../store/wallet/effects/amount/amount' ;
@@ -25,22 +27,24 @@ import CurrencySymbol from '../icons/currency-symbol/CurrencySymbol';
25
27
import { useLogger } from '../../utils/hooks/useLogger' ;
26
28
import { getBuyCryptoFiatLimits } from '../../store/buy-crypto/buy-crypto.effects' ;
27
29
import KeyEvent from 'react-native-keyevent' ;
30
+ import ArchaxFooter from '../archax/archax-footer' ;
31
+ import { PixelRatio , View } from 'react-native' ;
28
32
29
33
const AmountContainer = styled . SafeAreaView `
30
34
flex: 1;
31
35
` ;
32
36
33
- const CtaContainer = styled . View `
37
+ const CtaContainer = styled . View < { isSmallScreen ?: boolean } > `
34
38
width: 100%;
35
- margin-top: 20px;
39
+ margin-top: ${ ( { isSmallScreen } ) => ( isSmallScreen ? 0 : ' 20px' ) } ;
36
40
flex-direction: row;
37
41
justify-content: space-between;
38
42
` ;
39
43
40
- export const AmountHeroContainer = styled . View `
44
+ export const AmountHeroContainer = styled . View < { isSmallScreen : boolean } > `
41
45
flex-direction: column;
42
46
align-items: center;
43
- margin-top: 20px;
47
+ margin-top: ${ ( { isSmallScreen } ) => ( isSmallScreen ? 0 : ' 20px' ) } ;
44
48
padding: 0 ${ ScreenGutter } ;
45
49
` ;
46
50
@@ -95,9 +99,8 @@ const CurrencySuperScript = styled.View`
95
99
top: 10px;
96
100
right: -20px;
97
101
` ;
98
-
99
- const CurrencyText = styled ( BaseText ) `
100
- font-size: 20px;
102
+ const CurrencyText = styled ( BaseText ) < { bigAmount ?: boolean } > `
103
+ font-size: ${ ( { bigAmount} ) => ( bigAmount ? '12px' : '20px' ) } ;
101
104
color: ${ ( { theme} ) => theme . colors . text } ;
102
105
position: absolute;
103
106
` ;
@@ -150,6 +153,10 @@ const Amount: React.FC<AmountProps> = ({
150
153
const defaultAltCurrency = useAppSelector ( ( { APP } ) => APP . defaultAltCurrency ) ;
151
154
const allRates = useAppSelector ( ( { RATE } ) => RATE . rates ) ;
152
155
const curValRef = useRef ( '' ) ;
156
+ const showArchaxBanner = useAppSelector ( ( { APP } ) => APP . showArchaxBanner ) ;
157
+ const _isSmallScreen = showArchaxBanner
158
+ ? true
159
+ : PixelRatio . get ( ) < PIXEL_DENSITY_LIMIT ;
153
160
154
161
const fiatCurrency = useMemo ( ( ) => {
155
162
if ( fiatCurrencyAbbreviation ) {
@@ -440,16 +447,17 @@ const Amount: React.FC<AmountProps> = ({
440
447
return (
441
448
< AmountContainer >
442
449
< ViewContainer >
443
- < AmountHeroContainer >
450
+ < AmountHeroContainer isSmallScreen = { _isSmallScreen } >
444
451
< Row >
445
452
< AmountText
446
453
numberOfLines = { 1 }
447
454
ellipsizeMode = { 'tail' }
448
- bigAmount = { displayAmount ?. length > 8 } >
455
+ bigAmount = { _isSmallScreen ? true : displayAmount ?. length > 8 } >
449
456
{ displayAmount || 0 }
450
457
</ AmountText >
451
458
< CurrencySuperScript >
452
- < CurrencyText >
459
+ < CurrencyText
460
+ bigAmount = { _isSmallScreen ? true : displayAmount ?. length > 8 } >
453
461
{ formatCurrencyAbbreviation ( currency ) || 'USD' }
454
462
</ CurrencyText >
455
463
</ CurrencySuperScript >
@@ -465,14 +473,18 @@ const Amount: React.FC<AmountProps> = ({
465
473
</ AmountEquivText >
466
474
</ Row >
467
475
) : null }
468
- < Row > { getWarnMsg } </ Row >
469
- < CtaContainer >
476
+ < View style = { { position : 'absolute' , top : _isSmallScreen ? 70 : 100 } } >
477
+ { getWarnMsg }
478
+ </ View >
479
+ < CtaContainer isSmallScreen = { _isSmallScreen } >
470
480
{ context &&
471
481
[ 'sellCrypto' , 'swapCrypto' ] . includes ( context ) &&
472
482
limitsOpts ?. maxWalletAmount ? (
473
- < SwapButtonContainer onPress = { ( ) => swapCryptoSendMax ( ) } >
483
+ < SwapButtonContainer
484
+ isSmallScreen = { _isSmallScreen }
485
+ onPress = { ( ) => swapCryptoSendMax ( ) } >
474
486
< CurrencySymbol />
475
- < ButtonText > MAX</ ButtonText >
487
+ < ButtonText isSmallScreen = { _isSmallScreen } > MAX</ ButtonText >
476
488
</ SwapButtonContainer >
477
489
) : (
478
490
< Row />
@@ -519,6 +531,7 @@ const Amount: React.FC<AmountProps> = ({
519
531
{ t ( 'Continue' ) }
520
532
</ Button >
521
533
</ ButtonContainer >
534
+ { showArchaxBanner && < ArchaxFooter /> }
522
535
</ ActionContainer >
523
536
</ ViewContainer >
524
537
</ AmountContainer >
0 commit comments