-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: custom receive address overlay on long addies #8284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't find a way to make this look nice, so went with an alternative direction here of
418231d Additionally, also made the text area a teeny tiny larger 🚲 for regular sends, since I noticed it also crops thing a bit for EVM addies in develop, and I didn't want to change the 377147e Also pushed a final commit re: making the default fontSize for <=42 chars in the shared component being 0.5px smaller, ensuring no rugs in EVM sends: See before: |
// This is already a `useCallback()` | ||
// eslint-disable-next-line react-memo/require-usememo | ||
sx={{ | ||
fontSize: value && value.length > 42 ? '12px' : '13.5px', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that could be weird is when typing manually, but it should never happen, and if it happens it's weird anyway, so it looks acceptable to have a weird size changing when typing 👀
@@ -108,6 +108,7 @@ export const Address = () => { | |||
{translate('modals.send.sendForm.sendTo')} | |||
</FormLabel> | |||
<AddressInput | |||
pe={'9.5'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9.5 vs. the default 10 in <AddressInput />
to give this a lil less padding-end, meaning a lil bit more textarea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EVM Desktop
https://jam.dev/c/889f37b5-ca9a-4530-8de9-be2a51ec1406
Solana Desktop
https://jam.dev/c/e0362e5a-571e-4c74-8d86-c9b83672f7d3
Unforunately, on mobile it doesn't work, at least for the send input:
Improved for mobile in 6cc2932: Note, for I didn't feel like it was worth going lower than 9.8px for the sole purpose of handling bitcoincash: prefixed addies for send mobile as users can understand the prefix clearly anyway. Desktop regression test from last diff: Note @NeOMakinG as noted previously, react-device-detect doesn't react to viewport changes so make sure to refresh between mobile and desktop testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Does what it says on the box, see screenshots. No transparency, no problems.Actually does a bit more than it says on the box:
<AddressInput />
(i.e shared between custom receive address input, and regular sends inputs) for inputs larger than 42 chars (i.e your standard ETH addy) which is where we starting having problem from in custom receive address input. This allows user to see their full inputted receive address.We were missing
bitcoincash:
prefix addiesWhile making input shrinks starting from > 42 chars made things look better for the two latter, the former still missed a tiny bit of space
Fixed this by:
pe
a teeny tiny bit smaller (which effectively ensures a bit more textarea regardless of input)fontSize
in the shared component a teeny tiny bit smaller as well for the <= 42 chars caseIssue (if applicable)
closes #8276
Risk
None
Testing
Custom Receive address
Valid EVM addies display fully
Valid bitcoincash: addies display fully
Valid SOL addies display fully
Invalid EVM addies (replace last char with another) do not have buttons overlaying last chars
Invalid bitcoincash: addies (replace first char after
bitcoincash:
with another) do not have buttons overlaying last charsInvalid SOL addies (replace first char with another) do not have buttons overlaying last chars
Sends
Engineering
Operations
Screenshots (if applicable)
See this diff (left) vs. develop (right)
Custom Receive address
bitcoincash:
with another) do not have buttons overlaying last charsSends