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 SwapSettings #1051

Closed
wants to merge 9 commits into from
Closed

feat: Add SwapSettings #1051

wants to merge 9 commits into from

Conversation

0xAlec
Copy link
Contributor

@0xAlec 0xAlec commented Aug 14, 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
    • SwapSettingsSlippageToggle
    • 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:
https://www.loom.com/share/cd6e0e4954f648118ad90ef140f6b836

Notes to reviewers
see design in Slack

Fast follow PRs

  • Add SwapSettingsBottomSheet for smaller screens
  • Dynamically update max slippage percent using the custom input

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

@github-actions github-actions bot added documentation Improvements or additions to documentation pkg: swap labels Aug 14, 2024
Copy link

vercel bot commented Aug 14, 2024

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

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ❌ Failed (Inspect) Aug 28, 2024 5:09am
onchainkit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 5:09am
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 5:09am

Copy link

vercel bot commented Aug 16, 2024

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this project.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

src/swap/types.ts Outdated Show resolved Hide resolved
@cpcramer
Copy link
Contributor

opened PR under my account #1176

@cpcramer cpcramer deleted the alec/slippage-component branch October 14, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation pkg: swap pkg: wallet root
Development

Successfully merging this pull request may close these issues.

4 participants