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

feat(frontend): add WithdrawAll component and route #409

Merged
merged 10 commits into from
Dec 21, 2024

Conversation

1nonlypiece
Copy link
Contributor

@1nonlypiece 1nonlypiece commented Dec 19, 2024

Feature: Withdraw-All Page Implementation

Overview

This PR introduces the implementation of the Withdraw All page, enabling users to close all positions and withdraw all tokens to their wallet. The page includes integration with the backend API and aligns the UI with the provided Figma design.

Closes #405


Key Changes

  1. WithdrawAll Component

    • Added a new WithdrawAll component located at pages/spotnet/dashboard/withdraw-all/WithdrawAll.jsx.
    • Integrated the Withdraw All button with the backend endpoint GET /api/withdraw-all using the wallet_id parameter.
    • Implemented loading and error states to improve user experience during API interaction.
  2. Routing

    • Added a route for the Withdraw All page in App.jsx:
      <Route path="/dashboard/withdraw-all" element={<WithdrawAll />} />
  3. UI Enhancements

    • Updated withdraw_all.css to align the design with the Figma specifications.
    • Added error message styling for better feedback when the API request fails.
  4. Global Changes

    • Modified globals.css for consistent UI styling across the application.
    • Updated form.css to address mismatches between the existing UI and the Figma design.
  5. Error Messaging

    • Included an error alert with an icon (AlertHexagon) to display user-friendly error messages.

Testing

  • Ensure the Withdraw All button successfully interacts with the API and processes the response.
  • Verify that the UI matches the Figma design.
  • Test error handling by simulating API failures.

Screenshots/Video

Attached is a video showcasing the new Withdraw All page UI and functionality.
https://www.loom.com/share/ec97640df87c4d1e854e62e28fcab8b0?sid=852e6f8b-48e5-481d-a963-c27e730dfff9


@whateverfw whateverfw self-requested a review December 19, 2024 12:31
@1nonlypiece 1nonlypiece marked this pull request as ready for review December 19, 2024 13:45
@djeck1432 djeck1432 self-requested a review December 19, 2024 20:09
@1nonlypiece
Copy link
Contributor Author

@whateverfw your review comments were addressed!

Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

@1nonlypiece In general everything if fine, almost everything is fixed, thanks.

Please fix small issues in unresolved threads

@djeck1432
Copy link
Owner

@1nonlypiece Any updates?
Please, fix all issues today, we will merge everything today, in case you finish your task partially, you will be rewarded partially

@1nonlypiece
Copy link
Contributor Author

1nonlypiece commented Dec 21, 2024

@djeck1432 will address it soon

@whateverfw
Copy link
Collaborator

@1nonlypiece please sync with main

@1nonlypiece
Copy link
Contributor Author

Done @whateverfw

Copy link
Collaborator

@whateverfw whateverfw left a comment

Choose a reason for hiding this comment

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

Copy link
Owner

@djeck1432 djeck1432 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@djeck1432 djeck1432 merged commit a27935c into djeck1432:main Dec 21, 2024
4 checks passed
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.

[FRONTEND] Add new subpage withdraw_all
3 participants