danielma / unsplash-react

React Unsplash Components
22 stars 16 forks source link

Request for 'onSelectPhoto' prop #6

Open calummonro opened 5 years ago

calummonro commented 5 years ago

Hey danielma,

I was wondering if you had plans to provide an onSelectPhoto prop to the <UnsplashReact /> component.

I'm mounting <UnsplashReact /> inside a Modal and would like to close the Modal as soon as a <Photo /> is clicked.

I can create a PR if you're happy to add this prop, let me know.

oyeanuj commented 4 years ago

@calummonro Also, came here for the same. Do you have a workaround for this?

calummonro commented 4 years ago

Hey @oyeanuj, I ended up forking this repo and implementing the changes in this PR: https://github.com/danielma/unsplash-react/pull/8

There are some suggestions in the PR from the author on how to replicate this functionality with the existing API, but I couldn't figure out how to make it work for what I needed.

danielma commented 4 years ago

:wave: just letting you both know I see this issue.

Reading through that issue again, we left it at "waiting for a demo" — if you can provide that, I'm happy to look and keep that issue moving forward 🙂

calummonro commented 4 years ago

Hey @danielma,

I'll try to throw together a demo over the next couple of nights. It would be nice to tie all that up.