Skip to content

Commit 4c4b7ab

Browse files
committed
Move ETH claim info to wallet action popup
1 parent 608030a commit 4c4b7ab

File tree

6 files changed

+31
-26
lines changed

6 files changed

+31
-26
lines changed

src/components/WalletActionPopup/WalletActionPopup.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react'
22
import PropTypes from 'prop-types'
33
import Modal from '@material-ui/core/Modal'
4+
import InfoIcon from '../../icons/info.svg'
45

56
import { Stepper, Step, StepLabel } from '@material-ui/core'
67

@@ -37,10 +38,9 @@ class WalletActionPopup extends Component {
3738
})}
3839
</Stepper> : <div className='WalletActionPopup_step'>{activeStep.label}</div> }
3940
<div className='WalletActionPopup_instructions'>
40-
<div className='WalletActionPopup_message'>
41-
<p>{activeStep.description}</p>
42-
{activeStep.image && <img src={activeStep.image} alt={activeStep.description} />}
43-
</div>
41+
<p className='WalletActionPopup_instructions_description'>{activeStep.description}</p>
42+
{activeStep.info && <p className='WalletActionPopup_instructions_info'><img src={InfoIcon} alt='info' /> {activeStep.info}</p>}
43+
{activeStep.image && <img className='WalletActionPopup_instructions_image' src={activeStep.image} alt={activeStep.description} />}
4444
</div>
4545
</div>
4646
</div>

src/components/WalletActionPopup/WalletActionPopup.scss

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,23 @@
5656
font-size: $font-size-sm;
5757

5858
p {
59-
height: 40px;
60-
padding: 0 20px 6px 32px;
59+
margin-bottom: 0;
6160
}
6261

63-
img {
62+
&_description {
63+
padding: 0 20px 0 32px;
64+
}
65+
66+
&_info {
67+
padding: 4px 20px 0 32px;
68+
font-size: 11px;
69+
img {
70+
width: 13px;
71+
margin-top: -2px;
72+
}
73+
}
74+
75+
&_image {
6476
display: block;
6577
margin: 20px auto;
6678
}

src/containers/SwapOfferSelection/SwapOfferSelection.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react'
2-
import _ from 'lodash'
32
import Button from '../../components/Button/Button'
43
import SwapPairPanel from '../../components/SwapPairPanel/SwapPairPanel'
54
import AssetSelector from '../../components/AssetSelector/AssetSelector'

src/containers/SwapRedemption/SwapRedemption.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ import React, { Component } from 'react'
22
import BrandCard from '../../components/BrandCard/BrandCard'
33
import Button from '../../components/Button/Button'
44
import cryptoassets from '@liquality/cryptoassets'
5-
import { isETHNetwork } from '../../utils/networks'
65
import { getClaimErrors } from '../../utils/validation'
76
import ExpirationDetails from '../../components/ExpirationDetails'
87

9-
import InfoIcon from '../../icons/info.svg'
108
import './SwapRedemption.css'
119

1210
class SwapRedemption extends Component {
@@ -25,8 +23,6 @@ class SwapRedemption extends Component {
2523
<div className='SwapRedemption_info'>
2624
<p>Before you claim <br />
2725
Connect the account that you provided as {claimCurrency.code} receiving address</p>
28-
{ isETHNetwork(this.props.assets.b.currency) &&
29-
<p className='SwapRedemption_info_eth'><img src={InfoIcon} alt='info' /> The zero balance when signing refers to the contract. After claiming you will receive the {claimCurrency.code} amount above.</p> }
3026
</div>
3127
<p>
3228
{!errors.claim && <Button wide primary loadingMessage={this.props.loadingMessage} onClick={this.props.redeemSwap}>Claim Your {claimCurrency.code}</Button>}

src/containers/SwapRedemption/SwapRedemption.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313
width: 600px;
1414
margin: 0 auto 30px auto;
1515
text-align: left;
16-
17-
&_eth {
18-
font-size: $font-size-sm;
19-
img {
20-
width: 13px;
21-
margin-top: -2px;
22-
}
23-
}
2416
}
2517

2618
&_errorMessage {

src/utils/walletActionPopups.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ function toRefundPopup (popup) {
7373
})}
7474
}
7575

76+
function toEthereumClaimPopup (popup) {
77+
return { steps: toClaimPopup(popup).steps.map(step => {
78+
return step.id === WALLET_ACTION_STEPS.CONFIRM ? {...step, info: 'The zero balance when signing refers to the contract. After claiming you will receive the correct amount.'} : step
79+
})}
80+
}
81+
7682
const initiatePopups = {
7783
ledger: {
7884
btc: bitcoinLedgerPopup,
@@ -93,17 +99,17 @@ const initiatePopups = {
9399
const claimPopups = {
94100
ledger: {
95101
btc: toClaimPopup(bitcoinLedgerPopup),
96-
eth: toClaimPopup(ethereumLedgerPopup),
97-
erc20: toClaimPopup(ethereumLedgerPopup)
102+
eth: toEthereumClaimPopup(ethereumLedgerPopup),
103+
erc20: toEthereumClaimPopup(ethereumLedgerPopup)
98104
},
99105
metamask: {
100-
eth: toClaimPopup(ethereumMetamaskPopup),
101-
erc20: toClaimPopup(ERC20MetamaskPopup)
106+
eth: toEthereumClaimPopup(ethereumMetamaskPopup),
107+
erc20: toEthereumClaimPopup(ERC20MetamaskPopup)
102108
},
103109
default: {
104110
btc: toClaimPopup(defaultPopup),
105-
eth: toClaimPopup(defaultPopup),
106-
erc20: toClaimPopup(defaultERC20Popup)
111+
eth: toEthereumClaimPopup(defaultPopup),
112+
erc20: toEthereumClaimPopup(defaultERC20Popup)
107113
}
108114
}
109115

0 commit comments

Comments
 (0)