From bf24d8f86798c1ab008897c5cf045e0512e20749 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 11 Mar 2026 20:09:15 +0000 Subject: [PATCH] Switch to version 3: modified src/components/sections/testimonial/TestimonialCardTwo.tsx --- .../testimonial/TestimonialCardTwo.tsx | 256 ++++++++++++++---- 1 file changed, 210 insertions(+), 46 deletions(-) diff --git a/src/components/sections/testimonial/TestimonialCardTwo.tsx b/src/components/sections/testimonial/TestimonialCardTwo.tsx index 2f1d1d6..473823f 100644 --- a/src/components/sections/testimonial/TestimonialCardTwo.tsx +++ b/src/components/sections/testimonial/TestimonialCardTwo.tsx @@ -1,52 +1,216 @@ -import React from 'react'; -import { CardStack } from '@/components/cardStack/CardStack'; +"use client"; -interface TestimonialCardTwoProps { - testimonials: Array<{ +import { memo } from "react"; +import Image from "next/image"; +import CardStack from "@/components/cardStack/CardStack"; +import { cls, shouldUseInvertedText } from "@/lib/utils"; +import { useTheme } from "@/providers/themeProvider/ThemeProvider"; +import { Quote } from "lucide-react"; +import type { LucideIcon } from "lucide-react"; +import type { ButtonConfig, ButtonAnimationType, CardAnimationTypeWith3D, TitleSegment, TextboxLayout, InvertedBackground } from "@/components/cardStack/types"; + +type Testimonial = { id: string; name: string; - imageSrc: string; + role: string; + testimonial: string; + imageSrc?: string; imageAlt?: string; - }>; - title: string; - description: string; - gridVariant?: string; - animationType?: string; - textboxLayout?: string; - useInvertedBackground?: boolean; - [key: string]: any; -} - -const TestimonialCardTwo: React.FC = ({ - testimonials, - title, - description, - gridVariant = 'uniform-all-items-equal', - animationType = 'slide-up', - textboxLayout = 'default', - useInvertedBackground = false, - ...props -}) => { - const testimonialItems = testimonials.map((testimonial) => ( -
- {testimonial.imageAlt -

{testimonial.name}

-
- )); - - return ( - - {testimonialItems} - - ); + icon?: LucideIcon; }; -export default TestimonialCardTwo; \ No newline at end of file +interface TestimonialCardTwoProps { + testimonials: Testimonial[]; + carouselMode?: "auto" | "buttons"; + uniformGridCustomHeightClasses?: string; + animationType: CardAnimationTypeWith3D; + title: string; + titleSegments?: TitleSegment[]; + description: string; + tag?: string; + tagIcon?: LucideIcon; + tagAnimation?: ButtonAnimationType; + buttons?: ButtonConfig[]; + buttonAnimation?: ButtonAnimationType; + textboxLayout: TextboxLayout; + useInvertedBackground: InvertedBackground; + ariaLabel?: string; + className?: string; + containerClassName?: string; + cardClassName?: string; + textBoxTitleClassName?: string; + textBoxTitleImageWrapperClassName?: string; + textBoxTitleImageClassName?: string; + textBoxDescriptionClassName?: string; + imageWrapperClassName?: string; + imageClassName?: string; + iconClassName?: string; + nameClassName?: string; + roleClassName?: string; + testimonialClassName?: string; + gridClassName?: string; + carouselClassName?: string; + controlsClassName?: string; + textBoxClassName?: string; + textBoxTagClassName?: string; + textBoxButtonContainerClassName?: string; + textBoxButtonClassName?: string; + textBoxButtonTextClassName?: string; +} + +interface TestimonialCardProps { + testimonial: Testimonial; + shouldUseLightText: boolean; + cardClassName?: string; + imageWrapperClassName?: string; + imageClassName?: string; + iconClassName?: string; + nameClassName?: string; + roleClassName?: string; + testimonialClassName?: string; +} + +const TestimonialCard = memo(({ + testimonial, + shouldUseLightText, + cardClassName = "", + imageWrapperClassName = "", + imageClassName = "", + iconClassName = "", + nameClassName = "", + roleClassName = "", + testimonialClassName = "", +}: TestimonialCardProps) => { + const Icon = testimonial.icon || Quote; + + return ( +
+
+ {testimonial.imageSrc ? ( + {testimonial.imageAlt + ) : ( + + )} +
+ +
+

+ {testimonial.name} +

+

+ {testimonial.role} +

+
+ +

+ {testimonial.testimonial} +

+
+ ); +}); + +TestimonialCard.displayName = "TestimonialCard"; + +const TestimonialCardTwo = ({ + testimonials, + carouselMode = "buttons", + uniformGridCustomHeightClasses = "min-h-none", + animationType, + title, + titleSegments, + description, + tag, + tagIcon, + tagAnimation, + buttons, + buttonAnimation, + textboxLayout, + useInvertedBackground, + ariaLabel = "Testimonials section", + className = "", + containerClassName = "", + cardClassName = "", + textBoxTitleClassName = "", + textBoxTitleImageWrapperClassName = "", + textBoxTitleImageClassName = "", + textBoxDescriptionClassName = "", + imageWrapperClassName = "", + imageClassName = "", + iconClassName = "", + nameClassName = "", + roleClassName = "", + testimonialClassName = "", + gridClassName = "", + carouselClassName = "", + controlsClassName = "", + textBoxClassName = "", + textBoxTagClassName = "", + textBoxButtonContainerClassName = "", + textBoxButtonClassName = "", + textBoxButtonTextClassName = "", +}: TestimonialCardTwoProps) => { + const theme = useTheme(); + const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); + return ( + + {testimonials.map((testimonial, index) => ( + + ))} + + ); +}; + +TestimonialCardTwo.displayName = "TestimonialCardTwo"; + +export default TestimonialCardTwo;