diff --git a/src/components/sections/testimonial/TestimonialCardOne.tsx b/src/components/sections/testimonial/TestimonialCardOne.tsx index 7e8bc98..6b22930 100644 --- a/src/components/sections/testimonial/TestimonialCardOne.tsx +++ b/src/components/sections/testimonial/TestimonialCardOne.tsx @@ -1,6 +1,6 @@ "use client"; -import { memo } from "react"; +import { memo, useState } from "react"; import CardStack from "@/components/cardStack/CardStack"; import MediaContent from "@/components/shared/MediaContent"; import { cls } from "@/lib/utils"; @@ -18,6 +18,7 @@ type Testimonial = { videoSrc?: string; imageAlt?: string; videoAriaLabel?: string; + backText?: string; }; interface TestimonialCardOneProps { @@ -69,6 +70,7 @@ interface TestimonialCardProps { nameClassName?: string; roleClassName?: string; companyClassName?: string; + backTextClassName?: string; } const TestimonialCard = memo(({ @@ -80,41 +82,84 @@ const TestimonialCard = memo(({ nameClassName = "", roleClassName = "", companyClassName = "", + backTextClassName = "", }: TestimonialCardProps) => { - return ( -
- + const [isFlipped, setIsFlipped] = useState(false); -
-
- {Array.from({ length: 5 }).map((_, index) => ( - - ))} + return ( +
setIsFlipped(true)} + onMouseLeave={() => setIsFlipped(false)} + > +
+ {/* Front side */} +
+ + +
+
+ {Array.from({ length: 5 }).map((_, index) => ( + + ))} +
+ +

+ {testimonial.name} +

+ +
+

+ {testimonial.role} +

+

+ {testimonial.company} +

+
+
-

- {testimonial.name} -

- -
-

- {testimonial.role} -

-

- {testimonial.company} + {/* Back side */} +

+

+ {testimonial.backText || "Hover to see more"}

@@ -223,6 +268,7 @@ const TestimonialCardOne = ({ nameClassName={nameClassName} roleClassName={roleClassName} companyClassName={companyClassName} + backTextClassName="" /> ))}