Files
supabase/apps/docs/components/HomePageCover.tsx
Danny White 6a6b7c9085 fix(docs): remove redundant icons (#47002)
## What kind of change does this PR introduce?

UI fix. Resolves DOCS-1051.

## What is the current behavior?

Two unnecessary icons on docs homepage add more confusion than help.

## What is the new behavior?

Removed and tightened surrounding spacing + rhythm.

| Before | After |
| --- | --- |
| <img width="1339" height="703" alt="Supabase
Docs-5A137B99-AC36-4A59-85D9-B581307FFE6D"
src="https://github.com/user-attachments/assets/b1a1c2c7-3882-455d-93d6-799079bef209"
/> | <img width="1339" height="703" alt="Supabase
Docs-1220594B-29B1-48B0-B976-39CCFB009857"
src="https://github.com/user-attachments/assets/87a2501a-d6a4-4a1e-a73e-cf870c7170db"
/> |
| <img width="1339" height="703" alt="Supabase
Docs-23849B84-EE41-45EB-A585-BEE71AB8FFB2"
src="https://github.com/user-attachments/assets/517fe19a-8022-4276-822d-952f3c094005"
/> | <img width="1339" height="703" alt="Supabase
Docs-B5A3344F-32DD-4A49-B7DF-E5B10C8CDD13"
src="https://github.com/user-attachments/assets/045a46fe-6e8c-4268-8212-602b95868b66"
/> |

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Style**
* Simplified documentation page header and section visuals by removing
icon-accented wrappers and using cleaner text-based layouts.

* **Accessibility / Content**
* Updated section heading hierarchy for improved structure (e.g.,
“Additional resources” and “Self-Hosting”) by promoting headings while
keeping existing context and styling.
* Refreshed the “Getting Started” section to be text-focused without the
prior play icon treatment.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-16 18:59:37 +00:00

184 lines
5.8 KiB
TypeScript

'use client'
// End of third-party imports
import { isFeatureEnabled, useBreakpoint } from 'common'
import { ChevronRight, Sparkles } from 'lucide-react'
import { useTheme } from 'next-themes'
import Link from 'next/link'
import { cn } from 'ui'
import { IconPanel } from 'ui-patterns/IconPanel'
import { getCustomContent } from '../lib/custom-content/getCustomContent'
import DocsCoverLogo from './DocsCoverLogo'
const {
sdkDart: sdkDartEnabled,
sdkKotlin: sdkKotlinEnabled,
sdkSwift: sdkSwiftEnabled,
} = isFeatureEnabled(['sdk:dart', 'sdk:kotlin', 'sdk:swift'])
function AiPrompt({ className }: { className?: string }) {
return (
<Link
className={cn(
'group',
'w-fit rounded-full border px-3 py-1 flex gap-2 items-center text-foreground-light text-sm',
'hover:border-brand hover:text-brand-link focus-visible:text-brand-link',
'transition-colors',
className
)}
href="/guides/ai-tools/ai-prompts"
>
<Sparkles size={14} />
Start with Supabase AI prompts
<ChevronRight size={14} className="group-hover:translate-x-1 transition-transform" />
</Link>
)
}
const HomePageCover = (props) => {
const isXs = useBreakpoint(639)
const iconSize = isXs ? 'sm' : 'lg'
const { homepageHeading } = getCustomContent(['homepage:heading'])
const { resolvedTheme } = useTheme()
const isLightMode = !resolvedTheme?.includes('dark')
const frameworks = [
{
tooltip: 'ReactJS',
icon: '/docs/img/icons/react-icon',
href: '/guides/getting-started/quickstarts/reactjs',
hasLightIcon: false,
},
{
tooltip: 'Next.js',
icon: '/docs/img/icons/nextjs-icon',
href: '/guides/getting-started/quickstarts/nextjs',
hasLightIcon: false,
},
{
tooltip: 'TanStack Start',
icon: '/docs/img/icons/tanstack-icon',
href: '/guides/getting-started/quickstarts/tanstack',
hasLightIcon: true,
},
{
tooltip: 'Astro.js',
icon: '/docs/img/icons/astro-icon',
href: '/guides/getting-started/quickstarts/astrojs',
hasLightIcon: true,
},
{
tooltip: 'Vue',
icon: '/docs/img/icons/vuejs-icon',
href: '/guides/getting-started/quickstarts/vue',
hasLightIcon: false,
},
{
tooltip: 'Nuxt',
icon: '/docs/img/icons/nuxt-icon',
href: '/guides/getting-started/quickstarts/nuxtjs',
hasLightIcon: false,
},
{
tooltip: 'iOS Swift',
icon: '/docs/img/icons/swift-icon-orange',
href: '/guides/getting-started/quickstarts/ios-swiftui',
enabled: sdkSwiftEnabled,
hasLightIcon: false,
},
{
tooltip: 'Android Kotlin',
icon: '/docs/img/icons/kotlin-icon',
href: '/guides/getting-started/quickstarts/kotlin',
enabled: sdkKotlinEnabled,
hasLightIcon: false,
},
{
tooltip: 'Expo React Native',
icon: '/docs/img/icons/expo-icon',
href: '/guides/getting-started/quickstarts/expo-react-native',
hasLightIcon: true,
},
{
tooltip: 'Flutter',
icon: '/docs/img/icons/flutter-icon',
href: '/guides/getting-started/quickstarts/flutter',
enabled: sdkDartEnabled,
hasLightIcon: false,
},
{
tooltip: 'Python',
icon: '/docs/img/icons/python-icon',
href: '/guides/getting-started/quickstarts/flask',
hasLightIcon: false,
},
]
const GettingStarted = () => (
<div
className="
border bg-background
relative overflow-hidden
grid grid-cols-12
rounded-lg
p-5 md:p-8
"
>
<div className="col-span-full flex flex-col md:flex-row xl:flex-col justify-between gap-3">
<div className="md:max-w-xs shrink w-fit xl:max-w-none">
<div className="flex flex-col gap-1 mb-3">
<h2 className="text-2xl text-foreground">Getting Started</h2>
<p className="text-foreground-light text-sm">
Set up and connect a database in just a few minutes.
</p>
</div>
</div>
<div className="shrink-0">
<div className="flex flex-wrap md:grid md:grid-cols-5 gap-2 sm:gap-3">
{frameworks
.filter((framework) => framework.enabled !== false)
.map((framework, i) => {
const iconToUse =
framework.hasLightIcon && isLightMode ? `${framework.icon}-light` : framework.icon
return (
<Link key={i} href={framework.href} passHref className="no-underline">
<IconPanel iconSize={iconSize} tooltip={framework.tooltip} icon={iconToUse} />
</Link>
)
})}
</div>
<AiPrompt className="mt-6" />
</div>
</div>
</div>
)
return (
<div className="relative z-10 w-full bg-alternative border-b max-w-none mb-16 md:mb-12 xl:mb-0">
<div className="max-w-7xl px-5 mx-auto py-8 sm:pb-16 sm:pt-12 xl:pt-16 flex flex-col xl:flex-row justify-between gap-12 xl:gap-12">
<div className="flex flex-col sm:flex-row gap-4 sm:gap-8 items-start sm:items-center w-full max-w-xl xl:max-w-132">
<DocsCoverLogo aria-hidden="true" />
<div className="flex flex-col">
<h1 className="m-0 mb-3 text-2xl sm:text-3xl text-foreground">
{homepageHeading || props.title}
</h1>
<p className="m-0 text-foreground-light">
Learn how to get up and running with Supabase through tutorials, APIs and platform
resources.
</p>
</div>
</div>
{isFeatureEnabled('docs:full_getting_started') && (
<div className="w-full xl:max-w-[440px] -mb-40">
<GettingStarted />
</div>
)}
</div>
</div>
)
}
export default HomePageCover