mirror of
https://github.com/supabase/supabase.git
synced 2026-10-18 15:49:09 +03:00
* content structure * remove component * reorder sections * eagle new path * nav * meetups * update lw11-og function with service key * add ticket button in sticky nav * disable and exit game when not in view * enable light mode * add placeholders * highlights * update * typo * fix mainDays import * update og image * update sections * add hackathon link * add video id * add spaces and update ga * remove highlights * enterprise section * highlights * Adds the bootstrap post * Updates the desc * fixing tags * fixing authors * fix the admonition * Adds the AWS post * fixing categories * Adds LW number * Adds the branching post * fix description * chore: minor typos in blog post * swift scaffold * fix dates on all posts * adds chris as the author * Adds the branching tagline * Adds oriole post * updates oriole * Fix caption * Adds the YT video * update GA page * adds branching publicly available post * bootstrap image update * updated AWS images * first section in GA * update CLI bg * Updates community * fix build * Adds scale section * Adds all the sections * updated images * chore: adds partners and integrations * padds out the swift post * chore: whats new * chore: whats next * add chart * updates AWS page * chore: ai names * section numbering * Adds some stats for the community * Adds humat * edits * edits * update announcements * add star growth * update videoid * Adds edits * Update ga.tsx * build stage svg color * remove meetups link * remove backticks * update chart * Add PWC * add community stats * Adds full URLs * fix charts * fix whats new * fix broken HTML * Fix orderign * Fix swift video * fix list * spelling * Update ga.tsx * merge * update community stats from Ants feedback * chore: links and small changes * Change the category for Oriole * add bg support * Update ga.tsx * fixes formatting on the quote * update cta * fixes * add vercel partner --------- Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com> Co-authored-by: Francesco Sansalvadore <francescosansalvadore@MacBook-Pro-2.local> Co-authored-by: Francesco Sansalvadore <francescosansalvadore@mac.wind3.hub> Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com> Co-authored-by: Han Qiao <sweatybridge@gmail.com> Co-authored-by: Alaister Young <a@alaisteryoung.com> Co-authored-by: awalias <antwilson@hotmail.co.uk>
125 lines
3.5 KiB
TypeScript
125 lines
3.5 KiB
TypeScript
import Link from 'next/link'
|
|
import React, { useRef, ReactNode } from 'react'
|
|
import { LazyMotion, domAnimation, m, useInView } from 'framer-motion'
|
|
import SectionContainer from '~/components/Layouts/SectionContainer'
|
|
import { INITIAL_BOTTOM, getAnimation } from '~/lib/animations'
|
|
import { ReactMarkdown } from 'react-markdown/lib/react-markdown'
|
|
import { Button, IconArrowUpRight, cn } from 'ui'
|
|
|
|
interface Feature {
|
|
icon: string
|
|
title: string
|
|
text: string
|
|
}
|
|
interface Props {
|
|
id?: string
|
|
title: string | ReactNode
|
|
paragraph: string
|
|
cta?: {
|
|
label?: string
|
|
link: string
|
|
}
|
|
features?: Feature[]
|
|
className?: string
|
|
hasStickyTitle?: boolean
|
|
}
|
|
|
|
const FeaturesSection = ({
|
|
id,
|
|
title,
|
|
paragraph,
|
|
cta,
|
|
features,
|
|
className,
|
|
hasStickyTitle,
|
|
}: Props) => {
|
|
const ref = useRef(null)
|
|
const isInView = useInView(ref, { margin: '-5%', once: true })
|
|
|
|
return (
|
|
<LazyMotion features={domAnimation}>
|
|
<SectionContainer id={id} className={className}>
|
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4 md:gap-8 xl:gap-10 justify-between">
|
|
<div className="col-span-full h-full lg:col-span-4">
|
|
<div
|
|
className={cn('gap-2 flex flex-col items-start', hasStickyTitle && 'sticky top-24')}
|
|
>
|
|
<h2 className="text-2xl sm:text-3xl xl:text-4xl max-w-[280px] sm:max-w-xs xl:max-w-[360px] tracking-[-1px]">
|
|
{title}
|
|
</h2>
|
|
<p className="text-lighter mb-4">{paragraph}</p>
|
|
{cta && (
|
|
<Button asChild type="default" size="small" icon={<IconArrowUpRight />}>
|
|
<Link href={cta.link}>{cta.label ?? 'Explore documentation'}</Link>
|
|
</Button>
|
|
)}
|
|
</div>
|
|
</div>
|
|
{features && (
|
|
<div
|
|
ref={ref}
|
|
className="col-span-full lg:col-start-6 lg:col-span-7 space-y-10 lg:space-y-0 flex flex-col lg:grid lg:grid-cols-2 lg:gap-16"
|
|
>
|
|
{features.map((feature: Feature, i: number) => (
|
|
<Feature feature={feature} index={i} isInView={isInView} key={feature.title} />
|
|
))}
|
|
</div>
|
|
)}
|
|
</div>
|
|
</SectionContainer>
|
|
</LazyMotion>
|
|
)
|
|
}
|
|
|
|
const Feature = ({
|
|
feature,
|
|
index,
|
|
isInView,
|
|
}: {
|
|
feature: Feature
|
|
index: number
|
|
isInView: boolean
|
|
}) => {
|
|
const initial = INITIAL_BOTTOM
|
|
const animate = getAnimation({ delay: index * 0.1 })
|
|
|
|
return (
|
|
<m.div
|
|
className="h-full flex items-start space-x-3 w-full"
|
|
initial={initial}
|
|
animate={isInView ? animate : initial}
|
|
>
|
|
{feature.icon && (
|
|
<div className="flex items-center">
|
|
<div className="relative w-full h-6 flex items-center mx-auto">
|
|
<svg
|
|
width="25"
|
|
height="25"
|
|
viewBox="0 0 25 25"
|
|
fill="none"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path
|
|
d={feature.icon}
|
|
stroke="hsl(var(--foreground-default))"
|
|
strokeMiterlimit="10"
|
|
strokeLinejoin="round"
|
|
strokeLinecap="round"
|
|
strokeWidth="1.5"
|
|
/>
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
)}
|
|
<div className="text-sm lg:text-base">
|
|
<h2 className="text-base">{feature.title}</h2>
|
|
<ReactMarkdown className="prose pt-1 text-sm text-foreground-lighter">
|
|
{feature.text}
|
|
</ReactMarkdown>
|
|
</div>
|
|
</m.div>
|
|
)
|
|
}
|
|
|
|
export default FeaturesSection
|