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

Pinterest Style Modals #3851

Closed
ChrisCinelli opened this issue Sep 14, 2016 · 5 comments
Closed

Pinterest Style Modals #3851

ChrisCinelli opened this issue Sep 14, 2016 · 5 comments

Comments

@ChrisCinelli
Copy link

ChrisCinelli commented Sep 14, 2016

Pinterest has an interesting pattern for navigation (used by other sites too). From a list of items, you click on a item, this open a modal and the route change. When the modal is closed, you go back to the list of items and the route revert back.
Great for quick navigation. Great for user if they copy and paste the URL.

If you reload the page when the modal is open, the item is not in a modal. The context where you come from is not obviously available. And it is great for SEO.

See this video:

pinterest modal 1

What would it be the best way to build this in react-router?

I saw this: #2335 - I can put the modal in the list item page component but I am not sure if it is the best way to do it.

@timdorr
Copy link
Member

timdorr commented Sep 14, 2016

There is literally an example exactly for this kind of thing 😄 https://github.com/ReactTraining/react-router/tree/master/examples/pinterest

@timdorr timdorr closed this as completed Sep 14, 2016
@kastsiushkin
Copy link

@timdorr did this example move?

@pshrmn
Copy link
Contributor

pshrmn commented Mar 24, 2017

@kastsiushkin The link above is for v3, so its in the v3 branch now https://github.com/ReactTraining/react-router/tree/v3/examples/pinterest

Alternatively, there is a "modal gallery" example that does the same thing for v4 https://github.com/ReactTraining/react-router/blob/master/packages/react-router-website/modules/examples/ModalGallery.js

@kastsiushkin
Copy link

Thank you, for now we are on V3.

@remix-run remix-run deleted a comment from kongakong Oct 25, 2017
@nakulthebuilder
Copy link

nakulthebuilder commented Oct 30, 2017

newest v4 working link: https://github.com/ReactTraining/react-router/blob/master/website/modules/examples/ModalGallery.js

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants