mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 03:15:06 +03:00
Bring the Vercel project connect layout up to date with other connect screens. Follows up from https://github.com/supabase/supabase/pull/47550 which is required. | Before | After | | --- | --- | | <img width="2368" height="1680" alt="image" src="https://github.com/user-attachments/assets/f5c0b8ef-8fb5-4176-b0cf-98e33958dcc8" /> | <img width="848" height="808" alt="image" src="https://github.com/user-attachments/assets/e64c289f-0b73-4605-ad38-4552d3d6f934" /> | <img width="883" height="733" alt="image" src="https://github.com/user-attachments/assets/7ccd9b72-de6a-4c21-ac8e-abe773bb8116" /> ## Testing - Open the deploy preview or staging URL for `/dashboard/integrations/vercel/acme-production/marketplace/choose-project` with callback params from a real Vercel Marketplace install redirect (see _Vercel_ subheading below). ### Vercel - Run through the [install flow](https://github.com/supabase/supabase/pull/47550) on a real project until you get to the project connection screen, copy the url and paste into staging preview <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Introduced interstitial-style Vercel integration experiences for both install and choose-project flows, with improved page titles and clearer environment-variable guidance (including tooltip details). * **Bug Fixes** * Improved Vercel integration matching by configuration id and strengthened loading/error handling with more specific “not found” messaging. * **Refactor** * Enhanced the Vercel/GitHub project chooser with a dedicated interstitial mode. * Updated partner logo rendering to support optional styling customization. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com> Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
98 lines
2.8 KiB
TypeScript
98 lines
2.8 KiB
TypeScript
import Link from 'next/link'
|
|
import { Button, HoverCard, HoverCardContent, HoverCardTrigger } from 'ui'
|
|
import { Admonition } from 'ui-patterns/admonition'
|
|
|
|
import { ENV_VAR_RAW_KEYS } from './Integrations-Vercel.constants'
|
|
import { LogoPair, PartnerLogo, SupabaseLogo } from '@/components/layouts/InterstitialLayout'
|
|
import { BASE_PATH } from '@/lib/constants'
|
|
|
|
const VERCEL_ENV_VAR_COUNT = ENV_VAR_RAW_KEYS.length
|
|
const VERCEL_ICON_SRC = `${BASE_PATH}/img/icons/vercel-icon.svg`
|
|
|
|
export const VERCEL_INTEGRATION_ICON = <img src={VERCEL_ICON_SRC} alt="Vercel" className="w-4" />
|
|
|
|
export function VercelIntegrationLogo() {
|
|
return (
|
|
<LogoPair
|
|
left={
|
|
<PartnerLogo
|
|
src={VERCEL_ICON_SRC}
|
|
alt="Vercel"
|
|
className="bg-surface-75"
|
|
imageClassName="size-7 object-contain dark:invert"
|
|
/>
|
|
}
|
|
right={<SupabaseLogo />}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export function VercelIntegrationFooter() {
|
|
return (
|
|
<p className="text-xs text-foreground-lighter">
|
|
You can remove this integration at any time from Vercel or the Supabase dashboard.
|
|
</p>
|
|
)
|
|
}
|
|
|
|
export function VercelEnvVarsSyncDescription() {
|
|
return (
|
|
<>
|
|
<HoverCard openDelay={200}>
|
|
<HoverCardTrigger asChild>
|
|
<Button
|
|
type="button"
|
|
variant="link"
|
|
className="h-auto p-0 text-sm font-normal text-foreground-lighter underline decoration-dotted underline-offset-2"
|
|
>
|
|
{VERCEL_ENV_VAR_COUNT} environment variables
|
|
</Button>
|
|
</HoverCardTrigger>
|
|
<HoverCardContent align="center" className="w-80">
|
|
<div className="space-y-2">
|
|
<h4 className="text-sm font-medium text-foreground">Environment variables</h4>
|
|
<ul className="max-h-52 space-y-1 overflow-y-auto">
|
|
{ENV_VAR_RAW_KEYS.map((key) => (
|
|
<li key={key} className="font-mono text-xs text-foreground-lighter">
|
|
{key}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
</HoverCardContent>
|
|
</HoverCard>{' '}
|
|
will be synced to your Vercel project.
|
|
</>
|
|
)
|
|
}
|
|
|
|
interface VercelIntegrationInterstitialErrorStateProps {
|
|
title: string
|
|
errorMessage?: string | null
|
|
}
|
|
|
|
export function VercelIntegrationInterstitialErrorState({
|
|
title,
|
|
errorMessage,
|
|
}: VercelIntegrationInterstitialErrorStateProps) {
|
|
return (
|
|
<div className="flex flex-col gap-3">
|
|
<Admonition
|
|
type="warning"
|
|
title={title}
|
|
description={
|
|
<>
|
|
Retry the installation request from Vercel.
|
|
{errorMessage && (
|
|
<span className="mt-1 block text-foreground-lighter">Error: {errorMessage}</span>
|
|
)}
|
|
</>
|
|
}
|
|
/>
|
|
<Button variant="default" block asChild>
|
|
<Link href="/">Back to dashboard</Link>
|
|
</Button>
|
|
</div>
|
|
)
|
|
}
|