-
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
base: dev
Are you sure you want to change the base?
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:
|
redesign rpc send transfer using approver ux