Skip to content
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

Stake drawers pre-changes #789

Merged
merged 8 commits into from
Jan 27, 2025
Merged

Stake drawers pre-changes #789

merged 8 commits into from
Jan 27, 2025

Conversation

gndelia
Copy link
Contributor

@gndelia gndelia commented Jan 27, 2025

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

  • c87d1c0 Adds a new component for the "gray section" in the drawers (See image in spoilers)
Drawer's "gray" section image
  • 84d24dd Moves the SubmitWhenConnectedToChain to the components folder
  • d691411 Removes an old-css style for Recatpcha, that was used when we had the Claim capsule process in the /get-started page. This is no longer used (Recaptcha is no longer part of our app), so this can be safely removed
  • 35fe205 Moves the Drawer component into its own folder, inside components. This is because I expect to split it into different files, so they can all go into this new folder
  • fae5b25 moves the TokenInput from the tunnel into the components folder. aebcc8d does the same for the SetMaxBalance 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 extra div to absorb the padding, so it is not defined in the component definition (Like the WarningBox 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 image
  • 06e5cdb and cfcd994efd1504c16f168c5ce7a7d7733a6d5e9ecreates 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 a div, but in others, I need a form. So instead of using a prop stating which one I need, I think it has better readability if I directly compose the tag I need (div or form, depending on the case) with the CSS class. This also allows custom styles, as the height 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

  • Manual testing passed.
  • Automated tests added, or N/A.
  • Documentation updated, or N/A.
  • Environment variables set in CI, or N/A.

@gndelia gndelia requested a review from gabmontes January 27, 2025 17:42
Copy link
Contributor

@ArturDolzan ArturDolzan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uACK

@gndelia gndelia merged commit 0e52a4e into main Jan 27, 2025
6 checks passed
@gndelia gndelia deleted the stake-drawer-pre-changes branch January 27, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants