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: Add Swap Settings SwapProvider #1176

Merged
merged 10 commits into from
Sep 12, 2024
Merged

feat: Add Swap Settings SwapProvider #1176

merged 10 commits into from
Sep 12, 2024

Conversation

cpcramer
Copy link
Contributor

@cpcramer cpcramer commented Aug 28, 2024

What changed? Why?

Add SwapSettings Component

This PR introduces a new SwapSettings component, providing a dropdown interface for users to customize slippage settings during swaps. The component is composed of several subcomponents that manage different aspects of the slippage settings.

Key changes and additions:

  • Create SwapSettings component with subcomponents:
    • SwapSettingsSlippageDescription
    • SwapSettingsSlippageInput
    • SwapSettingsSlippageLayout
    • SwapSettingsSlippageLabel
    • SwapSettingsSlippageLayoutBottomSheet for mobile view
  • Add swapSettings SVG icon
  • Update Swap component to include and render SwapSettings
  • Implement click-outside functionality to close the dropdown
  • Add full test coverage for all new files and components

Functionality:

  • Display settings dropdown when the SVG icon is clicked
  • Allow users to toggle between Auto and Custom slippage modes
  • Enable custom slippage percentage input
  • Provide styling and text override options for various subcomponents

This enhancement gives users more control over their swap settings while maintaining a clean and intuitive interface.
Recording:

Screen.Recording.2024-08-28.at.12.25.46.PM.mov

Notes to reviewers
see design in Slack

Fast follow PRs

  • Polish styling

How has it been tested?
locally

Idle states

Screenshot 2024-08-25 at 10 02 05 PM Screenshot 2024-08-25 at 10 02 44 PM Screenshot 2024-08-26 at 12 25 43 PM Screenshot 2024-08-26 at 12 25 50 PM Screenshot 2024-08-27 at 9 55 25 PM

Hover states

Override state

image

Responsive

image

Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 10:23pm
onchainkit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 10:23pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 10:23pm

@cpcramer cpcramer changed the title Paul/add swap settings feat: Add Swap Settings Aug 28, 2024
@cpcramer cpcramer mentioned this pull request Aug 28, 2024
Copy link
Contributor

@Zizzamia Zizzamia left a comment

Choose a reason for hiding this comment

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

Amazing, and I left only one note that could be done as fast-follow.

@Zizzamia Zizzamia merged commit 87d128b into main Sep 12, 2024
16 checks passed
@Zizzamia Zizzamia deleted the paul/add-swap-settings branch September 12, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants