Skip to content

Commit

Permalink
fix: hides withdraw button for restricted users (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
EstherSeyi authored Jan 12, 2022
1 parent 9628e51 commit 01b4d4f
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/frontend/pages/vault/[vid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -564,16 +564,20 @@ const Component: React.FC = () => {
<div className={classes.overviewItem}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<Typography className={classes.overviewValue}>{vault?.collateralAmount.toFixed(4)}</Typography>
{vault?.shortAmount.isZero() && vault.collateralAmount.gt(0) ? (
<button
className={clsx(classes.withdrawBtn)}
onClick={() => {
updateCollateral(vault!.collateralAmount.negated().toString())
removeCollat(vault!.collateralAmount)
}}
>
WITHDRAW
</button>
{!isRestricted ? (
<>
{vault?.shortAmount.isZero() && vault.collateralAmount.gt(0) ? (
<button
className={clsx(classes.withdrawBtn)}
onClick={() => {
updateCollateral(vault!.collateralAmount.negated().toString())
removeCollat(vault!.collateralAmount)
}}
>
WITHDRAW
</button>
) : null}
</>
) : null}
</div>
<Typography className={classes.overviewTitle}>Collateral (ETH)</Typography>
Expand Down

1 comment on commit 01b4d4f

@vercel
Copy link

@vercel vercel bot commented on 01b4d4f Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.