@@ -36,19 +36,15 @@ const MainAssets = observer(({ setStep }: MainAssets) => {
3636 const bcNetwork = FuelNetwork . getInstance ( ) ;
3737 const isShowDepositInfo = ! settingsStore ?. isShowDepositInfo . includes ( accountStore . address ?? "" ) ;
3838 const balanceList = swapStore . getFormatedContractBalance ( ) ;
39- const hasPositiveBalance = balanceList . some ( ( item ) => ! new BN ( item . contractBalance ) . isZero ( ) ) ;
39+ const hasPositiveBalance = balanceList . some ( ( item ) => ! new BN ( item . balance ) . isZero ( ) ) ;
4040 const accumulateBalanceContract = balanceList . reduce ( ( acc , account ) => {
4141 const price = BN . formatUnits ( oracleStore . getTokenIndexPrice ( account . asset . priceFeed ) , DEFAULT_DECIMALS ) ;
42- return acc . plus ( new BN ( account . contractBalance ) . multipliedBy ( price ) ) ;
42+ return acc . plus ( new BN ( account . balance ) . multipliedBy ( price ) ) ;
4343 } , BN . ZERO ) ;
4444
4545 const handleWithdraw = async ( ) => {
46- const assets = balanceList . map ( ( el ) => ( {
47- assetId : el . assetId ,
48- balance : BN . parseUnits ( el . contractBalance , el . asset . decimals ) . toString ( ) ,
49- } ) ) ;
5046 setIsLoading ( true ) ;
51- await balanceStore . withdrawBalanceAll ( assets ) ;
47+ await balanceStore . withdrawBalanceAll ( ) ;
5248 setIsLoading ( false ) ;
5349 } ;
5450 const closeAssets = ( ) => {
@@ -70,7 +66,7 @@ const MainAssets = observer(({ setStep }: MainAssets) => {
7066 < SmartFlex alignItems = "center" justifyContent = "space-between" column >
7167 < HeaderBlock alignItems = "center" gap = "10px" justifyContent = "space-between" >
7268 < TextTitle type = { TEXT_TYPES . TITLE_MODAL } primary >
73- Deposited Assets
69+ Assets
7470 </ TextTitle >
7571 < CloseButton alt = "icon close" src = { closeThin } onClick = { closeAssets } />
7672 </ HeaderBlock >
@@ -81,7 +77,7 @@ const MainAssets = observer(({ setStep }: MainAssets) => {
8177 < >
8278 { balanceList . map ( ( el ) => (
8379 < AssetItem key = { el . assetId } >
84- < AssetBlock options = { { showBalance : "contractBalance " } } token = { el } />
80+ < AssetBlock options = { { showBalance : "balance " } } token = { el } />
8581 </ AssetItem >
8682 ) ) }
8783 < OverallBlock justifyContent = "space-between" >
@@ -120,11 +116,21 @@ const MainAssets = observer(({ setStep }: MainAssets) => {
120116 { ! hasPositiveBalance && isConnected && (
121117 < DepositedAssets alignItems = "center" gap = "20px" justifyContent = "center" column >
122118 < DepositAssets />
123- < TextTitleDeposit > Trade fast to trade fast and cheap.</ TextTitleDeposit >
119+ < TextTitleDeposit >
120+ It looks like your wallet is empty. Tap the{ " " }
121+ < LinkStyled
122+ href = "/#/faucet"
123+ onClick = { ( ) => {
124+ quickAssetsStore . setQuickAssets ( false ) ;
125+ } }
126+ >
127+ faucet
128+ </ LinkStyled > { " " }
129+ to grab some tokens.
130+ </ TextTitleDeposit >
124131 </ DepositedAssets >
125132 ) }
126133 < BottomColumn justifyContent = "space-between" >
127- { isShowDepositInfo && isConnected && < InfoBlockAssets /> }
128134 { ! isConnected && (
129135 < SizedBoxStyled width = { 150 } >
130136 < Text type = { TEXT_TYPES . BUTTON } > Connect wallet to see your assets and trade</ Text >
@@ -137,7 +143,7 @@ const MainAssets = observer(({ setStep }: MainAssets) => {
137143 ) }
138144 { accumulateBalanceContract . gt ( 0 ) && (
139145 < SmartFlexBlock >
140- < ButtonConfirm fitContent onClick = { ( ) => setStep ( 2 ) } >
146+ < ButtonConfirm fitContent onClick = { ( ) => setStep ( 1 ) } >
141147 Withdraw
142148 </ ButtonConfirm >
143149 < ButtonConfirm disabled = { isLoading } fitContent onClick = { handleWithdraw } >
@@ -223,3 +229,11 @@ const CloseButton = styled.img`
223229 cursor: pointer;
224230 }
225231` ;
232+
233+ const LinkStyled = styled . a `
234+ color: ${ ( { theme } ) => theme . colors . greenLight } ;
235+ text-decoration: underline;
236+ &:hover {
237+ cursor: pointer;
238+ }
239+ ` ;
0 commit comments