diff --git a/components/artist-portfolio.tsx b/components/artist-portfolio.tsx index 16a18abf0..e79b3cfba 100644 --- a/components/artist-portfolio.tsx +++ b/components/artist-portfolio.tsx @@ -8,7 +8,6 @@ import Link from "next/link" import { Instagram, ExternalLink, Loader2, DollarSign } from "lucide-react" import { useArtist } from "@/hooks/use-artist-data" import { useIsMobile } from "@/hooks/use-mobile" -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { type CarouselApi, Carousel, CarouselContent, CarouselItem } from "@/components/ui/carousel" import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area" @@ -20,12 +19,13 @@ export function ArtistPortfolio({ artistId }: ArtistPortfolioProps) { const [selectedCategory, setSelectedCategory] = useState("All") const [selectedImage, setSelectedImage] = useState(null) const [scrollY, setScrollY] = useState(0) - const [mobileView, setMobileView] = useState<"grid" | "carousel">("carousel") const isMobile = useIsMobile() // carousel indicator state (mobile) const [carouselApi, setCarouselApi] = useState(null) const [carouselCount, setCarouselCount] = useState(0) const [carouselCurrent, setCarouselCurrent] = useState(0) + const [showSwipeHint, setShowSwipeHint] = useState(true) + const [showFullBio, setShowFullBio] = useState(false) // Fetch artist data from API const { data: artist, isLoading, error } = useArtist(artistId) @@ -43,6 +43,12 @@ export function ArtistPortfolio({ artistId }: ArtistPortfolioProps) { return () => window.removeEventListener("scroll", handleScroll) }, [isMobile]) + // Fade swipe hint after a short delay + useEffect(() => { + const t = setTimeout(() => setShowSwipeHint(false), 2500) + return () => clearTimeout(t) + }, []) + // Preserve scroll position when modal opens/closes useEffect(() => { if (!selectedImage) return @@ -177,6 +183,7 @@ export function ArtistPortfolio({ artistId }: ArtistPortfolioProps) { const profileImage = portfolioImages.find(img => img.tags.includes('profile'))?.url || portfolioImages[0]?.url || "/placeholder.svg" + const bioText = artist.bio || "" return (
@@ -303,8 +310,15 @@ export function ArtistPortfolio({ artistId }: ArtistPortfolioProps) { )}

{artist.name}

-

{artist.specialties.join(", ")}

-

{artist.bio}

+

{artist.specialties.join(", ")}

+

+ {showFullBio ? bioText : bioText.slice(0, 180)}{bioText.length > 180 && !showFullBio ? "…" : ""} +

+ {bioText.length > 180 && ( + + )}
- {/* Mobile Portfolio: Tabs + Filters */} + {/* Mobile Portfolio: Carousel + Filters (simplified) */}
{/* Category Filter - horizontal pills */} @@ -466,103 +480,54 @@ export function ArtistPortfolio({ artistId }: ArtistPortfolioProps) { )}
- {/* Tabs: Grid | Carousel */} + {/* Carousel only */}
- setMobileView(v as any)} className="w-full"> - - Grid - Carousel - - - - {filteredPortfolio.length === 0 ? ( -
-

No portfolio images available

-
- ) : ( -
+ {filteredPortfolio.length === 0 ? ( +
+

No portfolio images available

+
+ ) : ( +
+ + {filteredPortfolio.map((item) => ( -
{ - openImageFromElement(item.id, (e.currentTarget as HTMLElement) || null) - }} - onKeyDown={(e) => { - if (e.key === "Enter" || e.key === " ") { - e.preventDefault() - openImageFromElement(item.id, e.currentTarget as HTMLElement) - } - }} - > -
+ +
{item.caption
-
- ))} + ) + )} + + +
+ {filteredPortfolio.length} pieces +
+ {/* Swipe hint */} + {showSwipeHint && ( +
+ Swipe left or right
)} - - - - {filteredPortfolio.length === 0 ? ( -
-

No portfolio images available

-
- ) : ( -
- - - {filteredPortfolio.map((item) => ( - -
- {item.caption -
-
) - )} -
-
-
- {filteredPortfolio.length} pieces -
- {/* Swipe hint */} -
- Swipe left or right -
- {/* Dots indicators */} -
- {Array.from({ length: carouselCount }).map((_, i) => ( -
-
- )} -
- + {/* Dots indicators */} +
+ {Array.from({ length: carouselCount }).map((_, i) => ( +
+
+ )}