Skip to content

Commit

Permalink
Merge pull request #13 from OriginProtocol/franck/fix_card
Browse files Browse the repository at this point in the history
Fix bug in withdrawal card
  • Loading branch information
franckc committed Dec 29, 2022
2 parents 205cf05 + 11de65d commit dfa1fb0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 27 deletions.
6 changes: 4 additions & 2 deletions token-transfer-client/src/components/BonusCard.js
Expand Up @@ -42,7 +42,7 @@ const BonusCard = ({ onDisplayBonusModal }) => {
<div className="col-12 col-md-6">
<h2>Bonus Tokens</h2>
{Object.keys(data.totals.granted).map(currency => {
<>
;<>
<div className="mt-3 mb-2">
<div>Earned</div>
<strong style={{ fontSize: '24px' }}>
Expand All @@ -54,7 +54,9 @@ const BonusCard = ({ onDisplayBonusModal }) => {
<div>Locked Up</div>
<strong style={{ fontSize: '24px' }}>
{Number(
data.totals.locked[currency].plus(data.totals.nextVestLocked[currency])
data.totals.locked[currency].plus(
data.totals.nextVestLocked[currency]
)
).toLocaleString()}
</strong>{' '}
<span className="ml-1 ogn">{currency}</span>
Expand Down
12 changes: 7 additions & 5 deletions token-transfer-client/src/components/WithdrawModal.js
Expand Up @@ -377,14 +377,16 @@ class WithdrawModal extends Component {
<form onSubmit={this.handleFormSubmit}>
<div className="row">
<div
className={`col-12${this.context.config.otcRequestEnabled ? ' col-sm-6' : ''
}`}
className={`col-12${
this.context.config.otcRequestEnabled ? ' col-sm-6' : ''
}`}
>
<div className="form-group">
<label htmlFor="amount">Amount of Tokens</label>
<div
className={`input-group ${this.state.amountError ? 'is-invalid' : ''
}`}
className={`input-group ${
this.state.amountError ? 'is-invalid' : ''
}`}
>
<input {...input('amount')} type="number" />
<div className="input-group-append">
Expand All @@ -400,7 +402,7 @@ class WithdrawModal extends Component {
</div>
</div>
{this.context.accounts.length > 0 &&
!this.state.modalAddAccount ? (
!this.state.modalAddAccount ? (
<>
<div className="form-group">
<label htmlFor="address">Destination Account</label>
Expand Down
8 changes: 4 additions & 4 deletions token-transfer-client/src/components/WithdrawalHistoryCard.js
Expand Up @@ -18,10 +18,10 @@ const WithdrawalHistoryCard = () => {
{data.config.isLocked
? 0
: Number(
data.totals.vested[currency].minus(
data.totals.withdrawn[currency]
)
).toLocaleString()}
data.totals.vested[currency].minus(
data.totals.withdrawn[currency]
)
).toLocaleString()}
</strong>{' '}
<span
className="ogn"
Expand Down
17 changes: 11 additions & 6 deletions token-transfer-client/src/components/WithdrawalSummaryCard.js
Expand Up @@ -35,7 +35,11 @@ const WithdrawalSummaryCard = ({ onDisplayWithdrawModal }) => {
<div className="col text-muted">Vested To Date</div>
<div className="col text-right">
<strong>
{Number(data.totals.vested[currency]).toLocaleString()}{' '}
{Number(
data.totals.vested[currency].plus(
data.totals.unlockedEarnings[currency]
)
).toLocaleString()}{' '}
</strong>
<span className="ogn">{currency}</span>
</div>
Expand All @@ -59,9 +63,9 @@ const WithdrawalSummaryCard = ({ onDisplayWithdrawModal }) => {
<div className="col text-right">
<strong>
{Number(
data.totals.vested[currency].minus(
data.totals.withdrawn[currency]
)
data.totals.vested[currency]
.plus(data.totals.unlockedEarnings[currency])
.minus(data.totals.withdrawn[currency])
).toLocaleString()}{' '}
</strong>
<span className="ogn">{currency}</span>
Expand All @@ -83,8 +87,9 @@ const WithdrawalSummaryCard = ({ onDisplayWithdrawModal }) => {
<div className="row mt-5 mb-2">
<div className="col text-center">
<button
className={`btn btn-lg btn-outline-${theme === 'dark' ? 'light' : 'primary'
}`}
className={`btn btn-lg btn-outline-${
theme === 'dark' ? 'light' : 'primary'
}`}
onClick={() => onDisplayWithdrawModal(currency)}
>
Withdraw {currency}
Expand Down
20 changes: 10 additions & 10 deletions token-transfer-client/src/components/pages/WithdrawalHistory.js
Expand Up @@ -134,11 +134,11 @@ const WithdrawalHistory = ({ history }) => {
enums.TransferStatuses.WaitingConfirmation,
enums.TransferStatuses.Processing
].includes(transfer.status) && (
<>
<div className="status-circle bg-orange mr-2"></div>
Processing
</>
)}
<>
<div className="status-circle bg-orange mr-2"></div>
Processing
</>
)}
{transfer.status === enums.TransferStatuses.Paused && (
<>
<div className="status-circle bg-red mr-2"></div>
Expand All @@ -161,11 +161,11 @@ const WithdrawalHistory = ({ history }) => {
enums.TransferStatuses.Expired,
enums.TransferStatuses.Cancelled
].includes(transfer.status) && (
<>
<div className="status-circle bg-red mr-2"></div>
{transfer.status}
</>
)}
<>
<div className="status-circle bg-red mr-2"></div>
{transfer.status}
</>
)}
</td>
</tr>
))
Expand Down

0 comments on commit dfa1fb0

Please sign in to comment.