fix(artists): exclude profile and non-public images from Featured Work/gallery filters
This commit is contained in:
parent
cee64dd9b2
commit
5d7dfa33e2
@ -113,14 +113,16 @@ export function ArtistPortfolio({ artistId }: ArtistPortfolioProps) {
|
|||||||
|
|
||||||
// Derived lists (safe when `artist` is undefined during initial renders)
|
// Derived lists (safe when `artist` is undefined during initial renders)
|
||||||
const portfolioImages = artist?.portfolioImages || []
|
const portfolioImages = artist?.portfolioImages || []
|
||||||
|
// Exclude profile/non-public images from the displayed gallery
|
||||||
|
const galleryImages = portfolioImages.filter((img) => img.isPublic !== false && !img.tags.includes('profile'))
|
||||||
|
|
||||||
// Get unique categories from tags
|
// Get unique categories from tags (use gallery images only)
|
||||||
const allTags = portfolioImages.flatMap(img => img.tags)
|
const allTags = galleryImages.flatMap(img => img.tags)
|
||||||
const categories = ["All", ...Array.from(new Set(allTags))]
|
const categories = ["All", ...Array.from(new Set(allTags))]
|
||||||
|
|
||||||
const filteredPortfolio = selectedCategory === "All"
|
const filteredPortfolio = selectedCategory === "All"
|
||||||
? portfolioImages
|
? galleryImages
|
||||||
: portfolioImages.filter(img => img.tags.includes(selectedCategory))
|
: galleryImages.filter(img => img.tags.includes(selectedCategory))
|
||||||
|
|
||||||
// keyboard navigation for modal (kept as hooks so they run in same order every render)
|
// keyboard navigation for modal (kept as hooks so they run in same order every render)
|
||||||
const goToIndex = useCallback(
|
const goToIndex = useCallback(
|
||||||
@ -516,8 +518,8 @@ export function ArtistPortfolio({ artistId }: ArtistPortfolioProps) {
|
|||||||
))}
|
))}
|
||||||
</CarouselContent>
|
</CarouselContent>
|
||||||
{/* Minimal nav controls */}
|
{/* Minimal nav controls */}
|
||||||
<CarouselPrevious className="left-2 top-1/2 -translate-y-1/2 bg-white/10 text-white border-white/20 hover:bg-white/20" aria-label="Previous flash" />
|
<CarouselPrevious className="left-4 top-1/2 -translate-y-1/2 size-12 md:size-14 z-10 bg-black/85 text-white shadow-xl border border-white/30 hover:bg-black rounded-full" aria-label="Previous flash" />
|
||||||
<CarouselNext className="right-2 top-1/2 -translate-y-1/2 bg-white/10 text-white border-white/20 hover:bg-white/20" aria-label="Next flash" />
|
<CarouselNext className="right-4 top-1/2 -translate-y-1/2 size-12 md:size-14 z-10 bg-black/85 text-white shadow-xl border border-white/30 hover:bg-black rounded-full" aria-label="Next flash" />
|
||||||
</Carousel>
|
</Carousel>
|
||||||
{/* Edge fade gradients (desktop) */}
|
{/* Edge fade gradients (desktop) */}
|
||||||
<div className="pointer-events-none hidden md:block absolute inset-y-0 left-0 w-24 bg-gradient-to-r from-black to-transparent" />
|
<div className="pointer-events-none hidden md:block absolute inset-y-0 left-0 w-24 bg-gradient-to-r from-black to-transparent" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user