Uniswap / interface

🦄 Open source interfaces for the Uniswap protocol
https://app.uniswap.org
GNU General Public License v3.0
4.96k stars 5.02k forks source link

Keep URL synced with swap interface #972

Open robertuniqid opened 4 years ago

robertuniqid commented 4 years ago

Is your feature request related to a problem? Please describe.

It seems that uniswap does not detect the hashtag change in the URL ( tough it would change when swapping between currencies, and would require to have an "ignore" functionality in that part if it's already set on the interface or still processing.

Describe the solution you'd like

I'd like for uniswap to detect the hashchange, and update the currencies accordingly, this seems very practical if using bookmarks, and in general it's a best practice on the web.

Additional context

Simple video showcasing the issue : https://d.pr/v/nlqFyh

moodysalem commented 3 years ago

In addition, the app should change the URL as you select parameters in the swapping interface

NoahZinsmeister commented 3 years ago

linking my solution for this on hypertext for consideration: https://github.com/NoahZinsmeister/hypertext/blob/79676225a680ce9bc5dc1010e434f5b398e3ed07/components/Settings.tsx#L149

i chose to populate initial UI from query params, then clear them. if at any point a user has modified any part of the ui that could be encoded as a query param, i show a share button. if possible, it triggers the native share ui via window.navigator.share, else falls back to copying