-
Notifications
You must be signed in to change notification settings - Fork 2
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
Initial implementation of stake form #93
Conversation
0062e68
to
1b1b9ab
Compare
dapp/src/utils/numbers.ts
Outdated
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.
A minor comment: would be helpful to organize the formatting/converting logic to make the functions consistent and readable with each other. Let's do this in a separate PR - #101
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.
Not sure about the name of this component because at first sight, it may indicate we can render any form but actually we are rendering stake/unstake 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.
Yes, it's true this name isn't perfect. But I don't have a better idea. You are right, but on the other hand, we are just displaying the form there. The type of action restricts us on the types of form. If you just have any better idea let me know.
|
||
function StakingSteps() { | ||
const { activeStep, goNext } = useModalFlowContext() | ||
|
||
switch (activeStep) { | ||
case 1: | ||
return <Overview goNext={goNext} /> | ||
return <ActionForm defaultForm="stake" goNext={goNext} /> |
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 need to figure out how to display the correct steps based on the form type. In this case, if a user changes tab to unstake
, fills a form, and goes to the next step this component will display the next step for staking not unstaking. Just flagging, we probably should address it in a separate PR during the unstaking flow work.
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 catch! Let's do it as you say in a separate PR. We will have to think about it so I will also create a task to not lose it. #127
dapp/src/components/shared/TokenAmountForm/TransactionDetails.tsx
Outdated
Show resolved
Hide resolved
dapp/src/components/shared/TokenAmountForm/TransactionDetails.tsx
Outdated
Show resolved
Hide resolved
dapp/src/components/shared/TokenAmountForm/TransactionDetails.tsx
Outdated
Show resolved
Hide resolved
e57929b
to
9eba84c
Compare
dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx
Outdated
Show resolved
Hide resolved
dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx
Outdated
Show resolved
Hide resolved
dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx
Outdated
Show resolved
Hide resolved
970f715
to
cf1eabb
Compare
dapp/src/components/shared/TokenAmountForm/TokenAmountFormBase.tsx
Outdated
Show resolved
Hide resolved
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.
Closes #95
This PR adds a stake form. The data after approving the form will be saved in the context to use the given amount in a later step. The form for ustake and stake are very similar, so let's create a form base component. It will allow us to use it for unstake flow later. Changes:
Tabs
componentScreen.Recording.2023-12-29.at.09.07.37.mov