-
Notifications
You must be signed in to change notification settings - Fork 164
Feat/new-address-modal #661
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/new-address-modal #661
Conversation
Oh man I think I messed up the rebase, might want to hold off. Just to clarify, I should rebase this branch onto feat/add-taro correct? |
Yes, that is correct. You should drop any commits that are already in that branch. |
c357c51
to
9f569db
Compare
9f569db
to
6b9bdb9
Compare
Fixed error displays on new address modal
This has been a very good learning experience. I think I've fixed the rebasing. |
Thanks for the updates. I'll do an initial UX review by tomorrow. Thanks for continuing to work on these updates. |
You're welcome. Thanks for taking the time to work with me on this. |
Overall it works good on the UX side. I do have some suggestions for improvement.
|
-Address is generated on submission and displayed on a result modal like create invoice. -Renamed collapsible "Import from Taro Node" to "Choose asset from Taro node" -Copied address message displays at top after explicit copy. -Actions tab: New Address and Mint Asset buttons now take up 100% width.
Excellent feedback, this is working way better. If you are happy with this, I will do a final pass on the code to attempt to bring it up to the standard of your previous reviews. |
Just tested 77f2756. This feels much better. Just a couple more comments about the latest updates.
On a side note, as I've been playing more with generating addresses, I've noticed a pain point. When minting a token I keep forgetting to change the amount. I realize it when I go to create an address. Then I need to go back and create a new asset. I think we should increase the default amount in the Mint Asset modal to Let me know when you are ready for a code review. |
Removed footer on new address modal once taro address is generated. Mint asset modal amount defaults to 1000 Amount to send has a new defualt of 10 or the lower balance amount. Amount is disabled if balance is a collecitble.
This is really shaping up. Thanks for the feedback. |
Did a pass over the code to get it in line with previous feedback.
This is ready for review. |
Cool. I'll go through the code tomorrow. Regarding the data, I honestly think its better if Polar is lenient when it comes to validation. If we get too strict and tightly coupled to the implementations, it increases the chances of breaking changes with future node releases. I prefer to minimize the need to ship a new Polar release just to support a new version of a node. I am fine with not validating the data user's enter. We just need to display the error that the nodes will respond with. It also gives devs more flexibility for testing without Polar getting in the way. |
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.
Took a first pass on the code. It's mostly all good. Just some suggestions to simplify the components.
Also, be sure to run yarn lint
to catch the couple linter warnings.
Removed debug statement from tarodProxyServer. Added comment to NewAddressModal syncChart call. Refactored Collapse and TaroAssetSelect to TaroDataSelect. NewAddressButton label texts is no consistent with prior buttons. NewAddressModal sets better defaults. getNewAddress removed redudant string cast. Cleaned up tests and linting.
I ended up doing a pretty big refactor. The collapse panel is gone, I thought it was a bit redundant and TaroNodeSelect and TaroAssetSelect are collapsed into a single component. , but if you think it's a good idea to hide the select balance functionality behind it, I'll put it back. |
Optimization of the loop that builds the options data of the select form.
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.
This is definitely a step in the right direction. The NewAddressModal
component looks much better. I have more follow-up comments based on your latest changes.
<InputNumber | ||
onChange={v => setSelectedAmount(v?.valueOf()?.toString() as string)} | ||
min={'1'} | ||
disabled={selectedBalance?.type === PTARO.TARO_ASSET_TYPE.COLLECTIBLE} | ||
/> |
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's a few things that could be improved here. Take a look at how <InputNumber>
is used throughout the code base and try to mirror those.
For example, here's how it's implemented in the OpenChannelModal
component:
<InputNumber<number>
disabled={openChanAsync.loading}
formatter={v => `${v}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
parser={v => parseInt(`${v}`.replace(/(undefined|,*)/g, ''))}
style={{ width: '100%' }}
onChange={v => setSelectedSats(v as number)}
/>
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.
Done
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 seem to be using this in everything that I have done so far. What do you think of me moving this out to its own component in a refactor? I'm thinking something like components/common/form/AmountInput.tsx?
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.
Alright. This looks good to go now. Thanks for iterating on this and getting the feature complete. 👌
Hey Jamal,
This is new-address-modal for your to review the inital work flow.
I still have to do tests and some polish on the code to bring it into line with what I learned on the last pr, but it's functional and ready for critique.