fix: icons not updating on search

This commit is contained in:
Damien Ostler 2024-05-26 22:09:05 -04:00
parent 323ba05fda
commit 6af5a0ee5d
2 changed files with 3 additions and 2 deletions

View File

@ -121,7 +121,7 @@ function PageComponent() {
<div className="grid grid-cols-3 gap-y-36 gap-x-10 h-full overflow-y-auto no-scrollbar pt-20"> <div className="grid grid-cols-3 gap-y-36 gap-x-10 h-full overflow-y-auto no-scrollbar pt-20">
{galleries && galleries.map((gallery, index) => ( {galleries && galleries.map((gallery, index) => (
<GalleryThumbnail <GalleryThumbnail
key={index} key={gallery.id}
id={gallery.id} id={gallery.id}
title={gallery.name} title={gallery.name}
columns={gallery.columns} columns={gallery.columns}

View File

@ -32,7 +32,7 @@ const GalleryThumbnail = ({ id, columns, onSelect, title, subscription }: Galler
useEffect(() => { useEffect(() => {
getData(); getData();
}, []); }, [galleryId]);
return ( return (
<div className="py-3 sm:max-w-xl sm:mx-auto flex-3 animate-in"> <div className="py-3 sm:max-w-xl sm:mx-auto flex-3 animate-in">
@ -44,6 +44,7 @@ const GalleryThumbnail = ({ id, columns, onSelect, title, subscription }: Galler
src={thumbnailUrl} src={thumbnailUrl}
alt="" alt=""
onClick={openGallery} onClick={openGallery}
key={galleryId}
style={{ width: '20rem', height: '20rem', objectFit: 'cover' }} style={{ width: '20rem', height: '20rem', objectFit: 'cover' }}
/> />
<div className="absolute top-2 left-0 w-full h-10% bg-gray-900 bg-opacity-10 backdrop-blur-sm p-2 rounded-md shadow-lg flex flex-col justify-end"> <div className="absolute top-2 left-0 w-full h-10% bg-gray-900 bg-opacity-10 backdrop-blur-sm p-2 rounded-md shadow-lg flex flex-col justify-end">