-
Notifications
You must be signed in to change notification settings - Fork 54
Create and implement a Stepper component. #2246
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.
@biocom , great changes!
A small question: will we change name 'Approve tokens' button to the 'Next' (or so) here or in a separate PR?
@elena-zh Ah yes I recall the discussion. Changed it to 'Continue'. WDYT? |
@biocom , sounds great! |
This has been committed to this PR. Thank you. |
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.
Looks great, its a big difference in UX ! 🔥
Approved with minor comments.
One suggestion for another PR is to change this to:
With some text like:
You have chosen to exercise some investment opportunities. Investing will give you the chance to get vCOW token at at fixed price.
This process will consist in two steps. The first one will be to define the investment amounts and set the required allowances. This means, that you will need to approve the investment for the investing tokens.
The last step is to execute all the claiming opportunities on-chain. This step will send the vCOW tokens for both Airdrop and the selected investment opportunities. Additionally, this step will take the invested tokens.
For more details on this, please read [BLOG POST]
@anxolin Thank for the suggestions. As for the text I updated it to this: What do you think? As for the |
const completedStep = activeStep > id | ||
const isActiveStep = activeStep === id | ||
return ( | ||
<Step key={id} totalSteps={steps.length} isActiveStep={isActiveStep} completedStep={completedStep}> |
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.
bit overkill as there are only 3 steps but cool anyhow
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.
Just keeping in mind, this was setup as a re-usable component (outside Claim
purposes).
title: 'Start', | ||
}, | ||
{ | ||
id: 1, |
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.
why do you need an id if the index/order is deterministic? it's an array
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.
@W3stside My thinking was that this would be a more fool proof approach. Order of an Array
in the context of this small Array of objects const
indeed is deterministic.
In context of a general purpose Stepper
component, my understanding is that in scenarios where you might have missing (object) values in the Array or externally imported data, one could argue setting explicit step numbers might be a defensive way of setting it up, given the order/index number might be affected in those scenarios. But correct me if I'm wrong.
Happy to do it another way, but just to highlight.
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.
Feel free to review post merge. For now I reverted logic back to use index
for key.
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.
Then make id optional as a prop and use the index as a fallback
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.
Sure Michel, makes sense if you plan to feed this with dynamic data which doesn't have order guarantees.
My thinking was, it's just using a static deterministic array, and in practical terms it will always be the case. I don't see the stepper consuming a dynamic list from an untrusted REST API :P
Anyways, it's all good, i consider the comment a ubernit :)
Fine to leave it, fine to remove it, fine to make it optional
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 see, could also be an option. A bit messy potentially in the end where index
and id
are thrown together and mixed up? I think I leave it as per your first suggestion and use only index
for now. Feel free to modify post merge otherwise.
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.
@anxolin Yeah, probably I'm over thinking it at this moment :)
&::before { | ||
left: 0; | ||
right: 50%; | ||
margin-right: ${({ circleSize }) => (circleSize ? `${circleSize}px` : '42px')}; |
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.
could be useful to cache 42px
here as you're clearly setting it in several places. would make tweaking this a breeze later and prevent 1 change from skewing the others
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.
Agreed. Will set up CSS vars in the parent.
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.
@W3stside Updated to reflect this now.
The first step allows you to define the investment amounts and set the required allowances for the tokens you | ||
will use to invest with. <br /> | ||
<br /> | ||
The last step executes all claiming opportunities on-chain. In addition it sends the tokens you will use to |
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 last step executes all claiming opportunities on-chain. In addition it sends the tokens you will use to | |
The last step executes all claiming opportunities on-chain. Additionally, it sends the tokens you will use to |
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.
Preference (both are correct). Will update otherwise.
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.
Nah not really, "In addition" is awkward like that
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.
check comments and address first please
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 changes, i really like this new component
Updated text with a wording suggestion by @W3stside but also the latest text provided by @avsavsavs |
@biocom , could you please remove this exceeding period? Or move it to the end of the previous sentence.. |
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.
Co-authored-by: Leandro Boscariol <[email protected]>
Yeah... I see your point. At the end, it is still accurate in a way (1 step done, 2 more to go? 😆 ). Open to address it, maybe in a next PR to keep this one going. |
Summary
Screen.Recording.2022-01-21.at.12.38.08.mov
Screen.Recording.2022-01-21.at.12.37.40.mov
Note