Update src/pages/HomePage/sections/Testimonials.tsx

This commit is contained in:
2026-06-13 14:56:39 +00:00
parent 9686bd8553
commit 5f8a0905d0

View File

@@ -1,204 +1,17 @@
/* eslint-disable */
// @ts-nocheck — generated by catalog-eject; runtime-correct but TS strict-mode false-positives on inlined catalog body
import { useState } from "react";
import { ArrowLeft, ArrowRight } from "lucide-react";
import Button from "@/components/ui/Button";
import TextAnimation from "@/components/ui/TextAnimation";
import ImageOrVideo from "@/components/ui/ImageOrVideo";
import Transition from "@/components/ui/Transition";
import ScrollReveal from "@/components/ui/ScrollReveal";
import LoopCarousel from "@/components/ui/LoopCarousel";
import Card from "@/components/ui/Card";
// Created by add_section_from_catalog (TestimonialMarqueeCards).
const testimonials = [
{
title: "Game-changer for our email strategy",
quote: "We switched to Flashly six months ago and our open rates have nearly tripled. The AI suggestions are incredibly accurate and save us hours every week.",
name: "Sarah Chen",
role: "Head of Marketing, Lumino",
imageSrc: "https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-1.webp?_wi=1"
},
{
title: "Best ROI on any tool we use",
quote: "The automation workflows alone paid for the subscription in the first month. Our team can now focus on strategy instead of manual sends.",
name: "Marcus Rivera",
role: "Growth Lead, NovaBrand",
imageSrc: "https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-2.webp"
},
{
title: "Finally, email that just works",
quote: "Setup took 15 minutes. Within a week we had our first automated campaign running. The deliverability is the best we've ever seen.",
name: "Erik Lindqvist",
role: "Founder, Canopy",
imageSrc: "https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-3.webp"
},
{
title: "Incredible support and product",
quote: "Every time we've had a question, the team responds within minutes. The product keeps getting better with every update. Truly world-class.",
name: "James Park",
role: "CTO, AdScale",
imageSrc: "https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-1.webp?_wi=2"
}
];
import React from 'react';
import TestimonialMarqueeCards from '@/components/sections/testimonial/TestimonialMarqueeCards';
type Testimonial = {
title: string;
quote: string;
name: string;
role: string;
} & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never });
const TestimonialsInline = () => {
return (
<section aria-label="Testimonials section" className="py-20 overflow-hidden">
<div className="flex flex-col gap-8 md:gap-10 w-content-width mx-auto mb-12">
<div className="flex flex-col items-center gap-2">
<div className="px-3 py-1 mb-1 text-sm card rounded w-fit">
<p>{"Testimonials"}</p>
</div>
<TextAnimation
text={"Loved by Marketing Teams"}
variant="slide-up"
gradientText={true}
tag="h2"
className="md:max-w-8/10 text-6xl 2xl:text-7xl leading-[1.15] font-semibold text-center text-balance"
/>
<TextAnimation
text={"See what our customers have to say about Flashly."}
variant="slide-up"
gradientText={false}
tag="p"
className="md:max-w-7/10 text-lg md:text-xl leading-snug text-center text-balance"
/>
</div>
</div>
<div className="w-full">
<LoopCarousel>
<div className="flex gap-6 py-4 px-3">
{testimonials.map((testimonial, idx) => (
<Card key={idx} className="w-[350px] md:w-[400px] flex-shrink-0 p-8 flex flex-col gap-6">
<div className="flex-grow">
<p className="text-lg text-foreground font-medium mb-4">"{testimonial.title}"</p>
<p className="text-muted-foreground">"{testimonial.quote}"</p>
</div>
<div className="flex items-center gap-4 mt-auto">
<div className="w-12 h-12 rounded-full overflow-hidden flex-shrink-0">
<ImageOrVideo imageSrc={testimonial.imageSrc} className="w-full h-full object-cover" />
</div>
<div>
<p className="font-semibold text-foreground">{testimonial.name}</p>
<p className="text-sm text-muted-foreground">{testimonial.role}</p>
</div>
</div>
</Card>
))}
</div>
</LoopCarousel>
</div>
</section>
);
};
const TestimonialsInlineOld = () => {
const [activeIndex, setActiveIndex] = useState(0);
const handlePrev = () => {
setActiveIndex((prev) => (prev === 0 ? testimonials.length - 1 : prev - 1));
};
const handleNext = () => {
setActiveIndex((prev) => (prev === testimonials.length - 1 ? 0 : prev + 1));
};
const activeTestimonial = testimonials[activeIndex];
return (
<section aria-label="Testimonials section" className="py-20">
<div className="flex flex-col gap-8 md:gap-10 w-content-width mx-auto">
<div className="flex flex-col items-center gap-2">
<div className="px-3 py-1 mb-1 text-sm card rounded w-fit">
<p>{"Testimonials"}</p>
</div>
<TextAnimation
text={"Loved by Marketing Teams"}
variant="slide-up"
gradientText={true}
tag="h2"
className="md:max-w-8/10 text-6xl 2xl:text-7xl leading-[1.15] font-semibold text-center text-balance"
/>
<TextAnimation
text={"See what our customers have to say about Flashly."}
variant="slide-up"
gradientText={false}
tag="p"
className="md:max-w-7/10 text-lg md:text-xl leading-snug text-center text-balance"
/>
{(undefined || undefined) && (
<div className="flex flex-wrap justify-center gap-3 mt-2 md:mt-3">
{undefined && <Button text={undefined.text} href={undefined.href} variant="primary"/>}
{undefined && <Button text={undefined.text} href={undefined.href} variant="secondary"animationDelay={0.1} />}
</div>
)}
</div>
<ScrollReveal variant="slide-up" className="grid grid-cols-1 gap-5 md:grid-cols-2">
<div className="flex flex-col justify-between gap-6 p-6 md:p-10 rounded card">
<Transition key={activeIndex} transitionType="fade" whileInView={false} className="flex flex-col gap-2">
<h3 className="text-3xl md:text-4xl font-semibold leading-[1.15] text-balance">
{activeTestimonial.title}
</h3>
<p className="text-base md:text-lg leading-snug text-balance">
&ldquo;{activeTestimonial.quote}&rdquo;
</p>
</Transition>
<div className="h-px w-full md:hidden bg-foreground/50" />
<div className="flex items-center justify-between gap-5">
<Transition key={activeIndex} transitionType="fade" whileInView={false} className="flex flex-col min-w-0">
<span className="text-base text-foreground font-semibold leading-snug truncate">{activeTestimonial.name}</span>
<span className="text-base text-foreground/75 leading-snug truncate">{activeTestimonial.role}</span>
</Transition>
<div className="flex gap-3">
<button
onClick={handlePrev}
aria-label="Previous testimonial"
className="flex items-center justify-center size-9 cursor-pointer rounded primary-button"
>
<ArrowLeft className="size-4 text-primary-cta-text" strokeWidth={1.5} />
</button>
<button
onClick={handleNext}
aria-label="Next testimonial"
className="flex items-center justify-center size-9 cursor-pointer rounded primary-button"
>
<ArrowRight className="size-4 text-primary-cta-text" strokeWidth={1.5} />
</button>
</div>
</div>
</div>
<Transition key={activeIndex} transitionType="fade" whileInView={false} className="relative min-h-80 h-full md:aspect-square rounded overflow-hidden">
<ImageOrVideo imageSrc={activeTestimonial.imageSrc} videoSrc={activeTestimonial.videoSrc} />
</Transition>
</ScrollReveal>
</div>
</section>
);
};
export default function TestimonialsSection() {
export default function TestimonialsSection(): React.JSX.Element {
return (
<div data-webild-section="testimonials" id="testimonials">
<TestimonialsInline />
<TestimonialMarqueeCards
tag="Testimonials"
title="Loved by Marketing Teams"
description="See what our customers have to say about Flashly."
testimonials={[{"role":"Head of Marketing, Lumino","imageSrc":"https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-1.webp","name":"Sarah Chen","quote":"We switched to Flashly six months ago and our open rates have nearly tripled. The AI suggestions are incredibly accurate and save us hours every week."},{"role":"Growth Lead, NovaBrand","imageSrc":"https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-2.webp","name":"Marcus Rivera","quote":"The automation workflows alone paid for the subscription in the first month. Our team can now focus on strategy instead of manual sends."},{"name":"Erik Lindqvist","quote":"Setup took 15 minutes. Within a week we had our first automated campaign running. The deliverability is the best we've ever seen.","imageSrc":"https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-3.webp","role":"Founder, Canopy"},{"imageSrc":"https://storage.googleapis.com/webild/default/templates/ai-email-platform/testimonial-1.webp","role":"CTO, AdScale","quote":"Every time we've had a question, the team responds within minutes. The product keeps getting better with every update. Truly world-class.","name":"James Park"}]}
/>
</div>
);
}