-
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
Handling modal windows #70
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.
First pass
We should have one modal and change the content in it.
62ae591
to
bb9bb62
Compare
Actually, the ModalFlowContext should not know specific steps and should only return the current index.
This PR has been updated. Previously, each modal was opened separately. Currently, the modal is one and we only replace the content in it. |
d9cb254
to
94c2e9c
Compare
openSideBar() | ||
} else { | ||
closeSidebar() | ||
timeout = setTimeout(resetState, 100) |
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 we need to reset state in timeout?
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.
After closing the modal, we should reset the active step state. However, if we do this without timeout we will see the default state in the modal for one moment. See the video below.
Screen.Recording.2023-12-19.at.16.25.28.mov
- use the `aside` tag - delete unnecessary DocsDrawer component
isOpen: boolean | ||
onClose: () => void | ||
numberOfSteps: number | ||
// eslint-disable-next-line react/require-default-props |
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.
Minor comment.
Let's remove this comment after the merge #74. This rule is disabled there.
Lines 10 to 18 in 4d01503
// TypeScript allows us to declare props that are non-optional internally | |
// but are interpreted as optional externally if they have defaultProps | |
// defined; the following two adjustments disable eslint-plugin-react | |
// checks that predate this ability for TS and that no longer apply. | |
"react/default-props-match-prop-types": [ | |
2, | |
{ "allowRequiredDefaults": true } | |
], | |
"react/require-default-props": [0] |
openSideBar() | ||
} else { | ||
closeSidebar() | ||
timeout = setTimeout(resetState, 100) |
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.
After closing the modal, we should reset the active step state. However, if we do this without timeout we will see the default state in the modal for one moment. See the video below.
This PR inits the stake/ustake flow by handling modal windows. After opening the modal, the sidebar should also be visible. From the sidebar user can also open the docs drawer. This PR adds these components and sets the correct property
z-index
for elements. The stake and unstake action require several modal windows to be opened in sequence. Let's manage this state with the context. A minor note, let's use context at this point and if we decide to use redux add it in a separate PR.Screen.Recording.2023-12-14.at.13.02.57.mov