Skip to content

Commit

Permalink
fix: Hide reset nonce button
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Jul 4, 2023
1 parent fc23c8b commit cf19917
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/components/tx-flow/common/TxNonce/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,21 @@ const TxNonceForm = ({ nonce, recommendedNonce }: { nonce: number; recommendedNo
InputProps={{
...params.InputProps,
name: field.name,
endAdornment: (
<InputAdornment position="end" className={css.adornment}>
<Tooltip title="Reset to recommended nonce">
<IconButton
onClick={resetNonce}
size="small"
color="primary"
disabled={readOnly || recommendedNonce.toString() === field.value}
>
<RotateLeftIcon fontSize="small" />
</IconButton>
</Tooltip>
</InputAdornment>
),
endAdornment:
!readOnly && recommendedNonce.toString() !== field.value ? (
<InputAdornment position="end" className={css.adornment}>
<Tooltip title="Reset to recommended nonce">
<IconButton onClick={resetNonce} size="small" color="primary">
<RotateLeftIcon fontSize="small" />
</IconButton>
</Tooltip>
</InputAdornment>
) : null,
readOnly,
}}
className={css.input}
sx={{ width: `${field.value.length}em`, minWidth: '5em', maxWidth: '200px' }}
title={field.value}
sx={{ maxWidth: '200px' }}
/>
</Tooltip>
)
Expand Down
1 change: 1 addition & 0 deletions src/components/tx-flow/common/TxNonce/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.input input {
font-weight: bold;
padding-right: 6px !important;
text-overflow: inherit !important;
}

.adornment {
Expand Down

0 comments on commit cf19917

Please sign in to comment.