Files
supabase/apps/www/components/Solutions/PlatformSection.tsx
Ivan VasilovandJordi Enric 56de26fe22 chore: Migrate the monorepo to use Tailwind v4 (#45318)
This PR migrates the whole monorepo to use Tailwind v4:
- Removed `@tailwindcss/container-queries` plugin since it's included by
default in v4,
- Bump all instances of Tailwind to v4. Made minimal changes to the
shared config to remove non-supported features (`alpha` mentions),
- Migrate all apps to be compatible with v4 configs,
- Fix the `typography.css` import in 3 apps,
- Add missing rules which were included by default in v3,
- Run `pnpm dlx @tailwindcss/upgrade` on all apps, which renames a lot
of classes
- Rename all misnamed classes according to
https://tailwindcss.com/docs/upgrade-guide#renamed-utilities in all
apps.

---------

Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-04-30 10:53:24 +00:00

114 lines
3.5 KiB
TypeScript

import React from 'react'
import { cn } from 'ui'
import SectionContainer from '~/components/Layouts/SectionContainer'
interface Feature {
id?: string
title: string
subheading: string | React.ReactNode
highlights?: string | React.ReactNode
url?: string
icon?: string | React.ReactNode
image?: any
className?: string
onClick?: any
alignLeft?: boolean
isDatabase?: boolean
}
export interface PlatformSectionProps {
id?: string
title: string | React.ReactNode
subheading: string
features?: Feature[]
className?: string
}
const PlatformSection = ({ title, subheading, features, id, className }: PlatformSectionProps) => {
return (
<SectionContainer id={id} className={cn('flex flex-col gap-12 py-16 md:py-24', className)}>
<div className="flex flex-col gap-4 max-w-lg">
<h2 className="text-2xl md:text-3xl text-foreground-lighter font-normal">{title}</h2>
<p className="text-foreground-lighter text-base md:text-lg">{subheading}</p>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-0 sm:divide-x divide-y rounded-md border border-default overflow-hidden">
{features?.map((feature) => (
<FeatureCard key={feature.id} feature={feature} />
))}
</div>
</SectionContainer>
)
}
const FeatureCard = ({ feature }: { feature: Feature }) => {
const { alignLeft = true } = feature
return (
<div
className={cn(
'relative overflow-hidden',
'flex-1 flex flex-col',
'items-start sm:items-center lg:items-start justify-between',
'bg-default w-full h-full min-h-[350px] sm:min-h-[400px]',
'text-foreground-lighter [&_strong]:font-normal! [&_strong]:text-foreground!',
feature.className
)}
>
<div
className={cn(
'relative z-10',
'p-4 sm:p-6 2xl:p-8',
'w-full',
'mx-auto gap-2 sm:gap-4',
'flex flex-col items-start sm:items-center',
'text-left sm:text-center',
feature.isDatabase && 'lg:h-full',
alignLeft && !feature.isDatabase && 'lg:mx-0 lg:items-start lg:text-left',
alignLeft &&
feature.isDatabase &&
'ml-0 md:justify-start md:text-left md:items-start lg:max-w-[47%]'
)}
>
<div className="flex items-center gap-2">
{feature.icon &&
(typeof feature.icon === 'string' ? (
<svg
width="18"
height="18"
viewBox="0 0 25 25"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d={feature.icon}
stroke="currentColor"
strokeMiterlimit="10"
strokeLinejoin="round"
strokeLinecap="round"
strokeWidth="1.5"
/>
</svg>
) : (
feature.icon
))}
<h3 className="">{feature.title}</h3>
</div>
<div className="flex-1 flex flex-col justify-between gap-2">
<p className="text-sm 2xl:text-base [&_strong]:text-foreground!">{feature.subheading}</p>
{feature.highlights && (
<span
className={cn('hidden lg:block text-foreground', feature.isDatabase && 'md:block')}
>
{feature.highlights}
</span>
)}
</div>
</div>
{feature.image && feature.image}
</div>
)
}
export default PlatformSection