diff --git a/apps/www/components/Sections/CustomerQuotesSection.tsx b/apps/www/components/Sections/CustomerQuotesSection.tsx index 266275de8de..9b2ca35947f 100644 --- a/apps/www/components/Sections/CustomerQuotesSection.tsx +++ b/apps/www/components/Sections/CustomerQuotesSection.tsx @@ -3,11 +3,14 @@ import Link from 'next/link' import { useRouter } from 'next/router' import { useTheme } from 'common/Providers' import { IconArrowUpRight } from 'ui' +import { LazyMotion, domAnimation, m, useInView } from 'framer-motion' import SectionContainer from '~/components/Layouts/SectionContainer' import CustomersVisual from '~/components/products/vector/CustomersVisual' +import { useRef } from 'react' +import { INITIAL_BOTTOM, getAnimation } from '~/lib/animations' -interface CardInterface { +interface Customer { type?: string avatar?: string author?: string @@ -20,27 +23,41 @@ interface CardInterface { customer?: string } +interface Card { + customer: any + index: number +} + interface Props { title: string | React.ReactNode - customers: CardInterface[] - secondaryLinks: CardInterface[] + customers: Customer[] + secondaryLinks: Customer[] } const CustomerQuotesSection = (props: Props) => { const { basePath } = useRouter() + const ref = useRef(null) + const isInView = useInView(ref, { margin: '-25%', once: true }) - const Card = (card: CardInterface) => { + const Card = ({ customer, index }: Card) => { const { isDarkMode } = useTheme() - const logo = `/images/customers/logos/${!isDarkMode ? '' : 'light/'}${card.customer}.png` + const logo = `/images/customers/logos/${!isDarkMode ? '' : 'light/'}${customer.customer}.png` + + const initial = INITIAL_BOTTOM + const animate = getAnimation({ delay: index * 0.1 }) return ( -
{card.quote}
-{card.author}
-{card.role}+
{customer.quote}
+{customer.author}
+{customer.role}