You’ll now enhance GalleryView to render images of artworks from the selected gallery using a new component called ArtImageTile. These images will be clickable and lead to detailed artwork views in Phase 6.
ArtImageTile component inside a new folderGalleryView, find gallery.objects and loop through itArtImageTile and pass art as a propArtImageTile, find and render the first image using an <img> tag inside a LinkLink should direct users to /galleries/:galleryId/art/:artId// src/components/ArtImageTile/ArtImageTile.jsx
import { Link } from 'react-router-dom';
function ArtImageTile({ art }) {
const imageUrl = art.images?.[0]?.baseimageurl;
return (
<Link to={`art/${art.id}`}>
<img src={imageUrl} alt={art.title} />
</Link>
);
}
export default ArtImageTile;
import ArtImageTile from '../ArtImageTile';
...
return (
<>
<h2>{gallery.name}</h2>
<div className="art-grid">
{gallery.objects.map(art => (
<ArtImageTile key={art.id} art={art} />
))}
</div>
</>
);
The GalleryView is now a rich visual component, showing clickable art images using composition and props. You've also prepared your route pattern for Phase 6.
This feels like walking into a real gallery room and seeing rows of art. Each image serves as a doorway to a more detailed view — like peeking into a magnifying glass.