Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As part of implementing the Stake drawer, I made some small refactors changes and moved files for better re-usage (as they will be re-used in the next PR). I'm splitting those changes into this PR so it is easier to review.
Description commit by commit
Drawer's "gray" section
SubmitWhenConnectedToChain
to thecomponents
folder/get-started
page. This is no longer used (Recaptcha is no longer part of our app), so this can be safely removedDrawer
component into its own folder, insidecomponents
. This is because I expect to split it into different files, so they can all go into this new folderTokenInput
from the tunnel into thecomponents
folder. aebcc8d does the same for theSetMaxBalance
file. These two will be used for the stake drawer, and the components are from the tunnel (See accordion image). I also did some renaming of the props, as they now belong to a more generic context, and are not that coupled into the tunnel form alone.The biggest change of this CSS class in comparison to the current implementation is that it defines the padding-x for all its children, except those with the class
skip-parent-padding-x
. This is because all drawer elements have padding... except for some particular components, such as the Token Preview (when adding a custom token), or the Gray Drawer section (See above). These components ignore the padding and extend to the whole drawer's width. This also requires some components to add an extradiv
to absorb the padding, so it is not defined in the component definition (Like theWarningBox
component)The token list also required some custom styles, as it works as a drawer on mobile, but as a modal on larger screens
Input section
drawer-content
CSS class, unifying some of the styles from the different drawers across the app. Why not a component, you may ask? The thing is that in some cases I need adiv
, but in others, I need aform
. So instead of using aprop
stating which one I need, I think it has better readability if I directly compose the tag I need (div
orform
, depending on the case) with the CSS class. This also allows custom styles, as theheight
is not standard across all drawers (This is something we discussed with Nahuel, and we preferred to leave the height dynamic for some scenarios, and static for some others, in particular, in mobile).Screenshots
No visible changes for the users
Related issue(s)
Related to #754
Related to #754
Checklist