-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat: redesign send rpc transfer flow #6000
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.
Great work @alter-eggo, leaving some comments.
I'll merge my PR now, which has some of the changes to focusTab helper you can use here
titleLeft: capitalize(type), | ||
captionLeft: time, |
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.
Shouldn't these presentation/formatting concerns be directly in component?
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.
we will use it in other bitcoin flows as well, so prefer keep in this file, though took it out of fees hook
b4cd122
to
7489cae
Compare
src/app/pages/rpc-send-transfer/rpc-send-transfer-choose-fee.tsx
Outdated
Show resolved
Hide resolved
@@ -1,34 +1,245 @@ | |||
import { useMemo, useState } from 'react'; |
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.
Maybe you can use a .layout
file to help split this up between logic and presentation?
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.
don't understand how to split tbh and why need? what should be in .layout?
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 are components with many style props, can't they be in a layout component?
In getAddresses
the entire Approver component is in the layout, such that the root RPC compoent can be focused on business logic/event passing behaviours, and not layout and styles.
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.
looking at this file I believe main problem here is with huge approve logic. I will try to move this to sep file.
actually we'll need this in other bitcoin related flows as well
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.
same with selected fee
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.
and prob then will be way easier to move it to layout file. will try
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.
Great work here @alter-eggo 🚀 huge PR!
I added a few suggestions but looking good to me overall
0703d98
to
b1af26d
Compare
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.
Nice work @alter-eggo! I migrated some of the bitcoin fees code to the mono repo for mobile. I have an issue open to install it back into the extension to make sure it is shared, but that can come later.
feeType: type, | ||
feeRate: feeRate ?? 0, | ||
baseUnitsValue: baseUnitsFeeValue ?? 0, | ||
titleLeft: capitalize(type), |
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.
Building on earlier comment, why don't we do the capitalize
in the view too? How we format/present data is a concern of the UI so better lives where it's set to a component.
My thinking is that if I as a dev need to go and make visual changes, they can be mostly scoped to a set of .layout
components. But in this file, we have a mix of mathematics and formatting, that I can't help but feel should live separately.
e.g. <style.span>{capitalize(type)}</styled.span>
Then, the utils file knows nothing about where (titleLeft
), or how (capitalised), the data needs to be displayed, focusing on accurate data only.
What's your thinking for putting it here, and are there reasons I'm missing why it's beneficial to group it here?
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.
I tried to do FeeItem
as dumb as possible, so general idea here was to gen and pass ready to use parts of the fee component, title/caption left/right
yeah, maybe better to capitalize
in component itself, and so remove titleLeft, I just thought it would be better to keep all these parts in one place.
so in stx I can do the same - get raw fee => then gen ready to use parts of fee component
Then, the utils file knows nothing about where (titleLeft), or how (capitalised), the data needs to be displayed, focusing on accurate data only.
if not utils so what's the best place to keep it? other way btw - create bitcoin fee wrapper for shared fee item and keep this logic there
Looking good! Some QA feedback:
|
b1af26d
to
699bf7d
Compare
Looking great, only some minor feedback:
|
This is looking great @alter-eggo! Really nice to see it coming together! Bravo 👏 |
Are we covering advanced details as well on this PR? And is this only for BTC or for STX as well? |
@fabric-8 @markmhendrickson Curious about what you think of the prompt, as it shouldn't show the icon of the application since we are already showing this on the request by. However, it is quite nice to have some reassuring of the app you are connecting to: Here is how it was intended to work and the respective designs |
@markmhendrickson @fabric-8 We might not have explicitly specified this in the approval documentation, but when connecting to a BTC account, the total balance should be calculated solely for BTC. Including other assets in the calculation could confuse users, especially if they meet the required balance but not in BTC. Thoughts? And if so, should this be in this PR or a later improvment? |
Yes for adding |
Agreed
I do like the idea of including the app icon, though it takes up a lot of space in the current prompt design. It seems perhaps best to just rely on this placement so we don't push the other content below the fold?
It seems best that we either 1) show just a fiat value (for the total account value including all assets, as here in the PR currently) or 2) show the fiat value for the specific asset in question (e.g. BTC value in USD here) and that asset's literal value (e.g. BTC balance itself here) right below it, as in your designs. By placing these two values together vertically, it'll presumably be clear to the user just which subset of value they're looking at it in this context. We could add this enhancement (2) later or tackle as part of this PR – both work for me. |
699bf7d
to
f2f8a70
Compare
@mica000 re: |
f2f8a70
to
1362849
Compare
Thanks @alter-eggo! |
@alter-eggo About the account picker cta, no worries! In relation to the component on the approval however, lets do the second option suggested by @markmhendrickson in this comment?
In add, @markmhendrickson I believe we can hide one of the address, depending on the network being used. |
1362849
to
92be09a
Compare
@mica000 done |
@alter-eggo thanks! Looking good! |
92be09a
to
f56dbcd
Compare
@alter-eggo it appears this change is still needed given my latest testing:
|
redesign rpc send transfer using approver ux