Files
supabase/apps/www/components/Sections/HighlightCards.tsx
a2831e2e69 feat: lw13d4 (#30908)
* lw13:d4

* www queues page (#30907)

* new products menu

* set up cron page

* set up cron page

* placeholder sections

* set up queues page

* update meta

* update Supabase Queues landing page content

* Updated the text to exclude queue creation/management from the API management section

* queues www page

---------

Co-authored-by: Wen Bo Xie <wenbo.xie3@gmail.com>
Co-authored-by: Greg Papas <gregpapas@Gregs-MacBook-Pro.local>

* feat: add queue module (#30853)

* feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
docs homepage layout

feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
docs homepage layout

feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
docs homepage layout

* fix: add pg_cron back to extensions sidebar

* update Supabase Cron docs

* feat: add queues module


feat: add queues module

* remove staging url from screenshots

* remove outdated cron files

* typo

* queues description update

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Wen Bo Xie <wenbo.xie3@gmail.com>
Co-authored-by: Oliver Rice <github@oliverrice.com>

* visibility timeout to window

* queues landing page sql example

* capitalize Dashboard

* cron blog post citus data callout update

* added draft of queues feature

* updated features bulleting

* pluralize queues

* fix Queues features page

* Inital bp

* queues docs updates

* format queues docs

* queues blog post updates

* edits

* Update the images for role in the docs quickstart for queues.

* updated images

* update images

* update more images

* Update 2024-12-05-supabase-queues.mdx

* fix breaks

* punchier title

* better ul

* clean up

* Retake screenshots

* grammar

* whitelines

* video + images

* update docs

* blog updates

* blog update

* api snippet

* api snippet fix

* queues features yt video

* api snippet fix

* update docs

* blog update

* api snippet fix and vale

* format

* vale off

* vale off

* blog update

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Greg Papas <gregpapas@Gregs-MacBook-Pro.local>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Co-authored-by: Oliver Rice <github@oliverrice.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-12-05 15:05:47 +00:00

82 lines
2.5 KiB
TypeScript

import React, { useRef, useState } from 'react'
import { LazyMotion, domAnimation, m, useInView } from 'framer-motion'
import { INITIAL_BOTTOM, getAnimation } from '~/lib/animations'
import Panel from '~/components/Panel'
import SectionContainer from '~/components/Layouts/SectionContainer'
interface Highlight {
image?: React.ReactNode
svg?: React.ReactNode
title: string
paragraph: string | React.ReactNode
}
const HighlightCards = ({
highlights,
className,
}: {
highlights: Highlight[]
className?: string
cols?: number
}) => {
return (
<SectionContainer className={className}>
<LazyMotion features={domAnimation}>
<div className="highlights-grid grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4">
{highlights.map((highlight, i) => (
<HighlightCard highlight={highlight} index={i} key={highlight.title} />
))}
</div>
</LazyMotion>
</SectionContainer>
)
}
const HighlightCard = ({ highlight, index }: { highlight: Highlight; index: number }) => {
const ref = useRef(null)
const [isHovered, setIsHovered] = useState(false)
const isInView = useInView(ref, { once: true })
const initial = INITIAL_BOTTOM
const animate = getAnimation({})
const Img: any = highlight.image
return (
<m.div
ref={ref}
initial={initial}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
animate={isInView ? animate : initial}
className="will-change-transform h-full highlight-card"
>
<Panel innerClassName="flex flex-col !bg-alternative" outerClassName="h-full">
{highlight.image && (
<div className="relative w-full aspect-[1.35/1] mb-4">
<div
className="absolute inset-0 w-full h-full z-10"
style={{
background: `radial-gradient(100% 50% at 50% 50%, transparent, hsl(var(--background-alternative-default)))`,
}}
/>
{highlight.image && <Img isHovered={isHovered} />}
</div>
)}
<div className="p-4 md:p-8">
{highlight.svg && (
<div className="relative w-6 aspect-square mb-2 md:mb-4 text-foreground-light">
{highlight.svg}
</div>
)}
<h3 className="text-lg text-foreground md:mb-2">{highlight.title}</h3>
<p className="text-foreground-lighter text-sm">{highlight.paragraph}</p>
</div>
</Panel>
</m.div>
)
}
export default HighlightCards