Skip to content

Commit

Permalink
Fix/account overflow (#377)
Browse files Browse the repository at this point in the history
* Removed total values when the token price is unknown in send flow confirmation. Disabled currency swapping on send flow for tokens without a known price

* Fixed issue where right padding was not added on contacts presence

Co-authored-by: rocky-fleek <[email protected]>
  • Loading branch information
tomiir and rocky-fleek authored Feb 15, 2022
1 parent 577f078 commit 11f2fb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions source/components/IDInput/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ const IDInput = ({
() => [principalId, accountId].includes(value), [principalId, accountId, value],
);

const notInContacts = useMemo(() => !contacts
const inContacts = useMemo(() => contacts
.flatMap((c) => c.contacts)
.map((c) => c.id)
.includes(value), [contacts, value]);

const shouldDisplayContacts = value !== null && isValid && notInContacts && !isUserAddress;
const shouldDisplayAddToContacts = value !== null && isValid && !inContacts && !isUserAddress;

const handleSelectedContact = (contact) => setSelectedContact(contact);

Expand Down Expand Up @@ -93,7 +93,7 @@ const IDInput = ({
input: clsx(
classes.input,
isValid === false && classes.inputInvalid,
shouldDisplayContacts && classes.paddingRight,
!!contacts.length && classes.paddingRight,
),
}}
fullWidth
Expand Down Expand Up @@ -127,7 +127,7 @@ const IDInput = ({
</>
)}
</div>
{shouldDisplayContacts && (
{shouldDisplayAddToContacts && (
<Grid item xs={12}>
<div className={clsx(classes.newAddress, classes.appearAnimation)}>
<span className={classes.newAddressTitle}>
Expand Down
4 changes: 0 additions & 4 deletions source/components/IDInput/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default makeStyles((theme) => ({
backgroundClip: 'padding-box, border-box',
},
'&:focus': {
padding: '0px 11px',
border: 'double 2px transparent',
backgroundImage:
'linear-gradient(white, white), radial-gradient(circle at top left,#FFE701,#FA51D3,#10D9ED,#53FF54)',
Expand All @@ -50,15 +49,12 @@ export default makeStyles((theme) => ({
},
},
inputInvalid: {
padding: '0px 11px',
border: `2px solid ${theme.palette.danger.main}`,

'&:hover': {
padding: '0px 11px',
border: `2px solid ${theme.palette.danger.main}`,
},
'&:focus': {
padding: '0px 11px',
border: `2px solid ${theme.palette.danger.main}`,
},
},
Expand Down

0 comments on commit 11f2fb7

Please sign in to comment.