Is it possible to implement a Filter? #101
-
Hey! Something like this: My goal is it to filter(via checkboxes) the showing images with some "tags"/key property from the created photo(array) with these dynamic changes (isotope) like the examples above. Do you think there is a way to combine it with the "react-photo-album"? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi there! First of all, thank you for your patronage, and if you enjoy using my libraries, please consider showing your support by giving them a star here on GitHub. I don't believe it's currently possible to integrate Implementing tags and filters is pretty straightforward. You can add a const photos = allPhotos.filter((photo) => Boolean((photo.tags || []).find((tag) => tags.includes(tag))));
// ...
<PhotoAlbum
photos={photos}
// ...
/> As to isotope-like animations, the implementation is doable but very much non-trivial. I put together a demo of what, I'm assuming, you are trying to build. https://codesandbox.io/s/react-photo-album-101-f6npyj?file=/src/App.js Please let me know if you have any other questions. P.S. The above demo is a proof-of-concept and hasn't been thoroughly tested. |
Beta Was this translation helpful? Give feedback.
Hi there!
First of all, thank you for your patronage, and if you enjoy using my libraries, please consider showing your support by giving them a star here on GitHub.
I don't believe it's currently possible to integrate
react-isotope
withreact-photo-album
since both libraries use their own unique layout rendering approaches.Implementing tags and filters is pretty straightforward. You can add a
tags
prop to your photo objects and then filter them before passings thephotos
array to thePhotoAlbum
.As to isotope-like animations, the…