From 73356e0b657cdcd52a6db035e9d609bdcdc7ac3e Mon Sep 17 00:00:00 2001 From: bender Date: Sun, 8 Mar 2026 21:29:34 +0000 Subject: [PATCH] Update src/components/sections/team/TeamCardFive.tsx --- src/components/sections/team/TeamCardFive.tsx | 168 +++++------------- 1 file changed, 45 insertions(+), 123 deletions(-) diff --git a/src/components/sections/team/TeamCardFive.tsx b/src/components/sections/team/TeamCardFive.tsx index 23bdba2..e60e579 100644 --- a/src/components/sections/team/TeamCardFive.tsx +++ b/src/components/sections/team/TeamCardFive.tsx @@ -1,14 +1,12 @@ -"use client"; +'use client'; -import CardStackTextBox from "@/components/cardStack/CardStackTextBox"; -import MediaContent from "@/components/shared/MediaContent"; -import { useCardAnimation } from "@/components/cardStack/hooks/useCardAnimation"; -import { cls } from "@/lib/utils"; -import type { LucideIcon } from "lucide-react"; -import type { ButtonConfig, CardAnimationType, TitleSegment, ButtonAnimationType } from "@/components/cardStack/types"; -import type { TextboxLayout, InvertedBackground } from "@/providers/themeProvider/config/constants"; +import React, { useRef, useEffect } from 'react'; +import { useCardAnimation } from '@/hooks/useCardAnimation'; +import { cn } from '@/lib/utils'; -type TeamMember = { +export type CardAnimationType = 'none' | 'opacity' | 'slide-up' | 'scale-rotate' | 'blur-reveal'; + +export interface TeamMember { id: string; name: string; role: string; @@ -16,133 +14,57 @@ type TeamMember = { videoSrc?: string; imageAlt?: string; videoAriaLabel?: string; -}; +} interface TeamCardFiveProps { team: TeamMember[]; animationType: CardAnimationType; - title: string; - titleSegments?: TitleSegment[]; - description: string; - textboxLayout: TextboxLayout; - useInvertedBackground: InvertedBackground; - tag?: string; - tagIcon?: LucideIcon; - tagAnimation?: ButtonAnimationType; - buttons?: ButtonConfig[]; - buttonAnimation?: ButtonAnimationType; - ariaLabel?: string; + itemCount: number; className?: string; - containerClassName?: string; - textBoxTitleClassName?: string; - textBoxTitleImageWrapperClassName?: string; - textBoxTitleImageClassName?: string; - textBoxDescriptionClassName?: string; - textBoxClassName?: string; - textBoxTagClassName?: string; - textBoxButtonContainerClassName?: string; - textBoxButtonClassName?: string; - textBoxButtonTextClassName?: string; - gridClassName?: string; - cardClassName?: string; - mediaWrapperClassName?: string; - mediaClassName?: string; - nameClassName?: string; - roleClassName?: string; } -const TeamCardFive = ({ +export const TeamCardFive: React.FC = ({ team, animationType, - title, - titleSegments, - description, - textboxLayout, - useInvertedBackground, - tag, - tagIcon, - tagAnimation, - buttons, - buttonAnimation, - ariaLabel = "Team section", - className = "", - containerClassName = "", - textBoxTitleClassName = "", - textBoxTitleImageWrapperClassName = "", - textBoxTitleImageClassName = "", - textBoxDescriptionClassName = "", - textBoxClassName = "", - textBoxTagClassName = "", - textBoxButtonContainerClassName = "", - textBoxButtonClassName = "", - textBoxButtonTextClassName = "", - gridClassName = "", - cardClassName = "", - mediaWrapperClassName = "", - mediaClassName = "", - nameClassName = "", - roleClassName = "", -}: TeamCardFiveProps) => { - const { itemRefs } = useCardAnimation({ animationType, itemCount: team.length }); + itemCount, + className, +}) => { + const containerRef = useRef(null); + const itemRefs = useRef<(HTMLDivElement | null)[]>([]); + + const { itemRefs: animationItemRefs } = useCardAnimation({ + animationType, + itemCount, + }); + + useEffect(() => { + itemRefs.current = itemRefs.current.slice(0, itemCount); + }, [itemCount]); return ( -
-
- - -
- {team.map((member, index) => ( -
{ itemRefs.current[index] = el; }} - className={cls("relative flex flex-col items-center text-center w-[55%] md:w-[28%] -mx-[4%] md:-mx-[2%]", cardClassName)} - > -
- -
-

- {member.name} -

-

- {member.role} -

-
- ))} +
+ {team.map((member, index) => ( +
{ + if (el) itemRefs.current[index] = el; + if (animationItemRefs && animationItemRefs[index]) animationItemRefs[index].current = el; + }} + className="team-member" + > + {member.imageSrc && ( + {member.imageAlt + )} +

{member.name}

+

{member.role}

-
-
+ ))} + ); }; -TeamCardFive.displayName = "TeamCardFive"; - export default TeamCardFive;