The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore(studio): improve light mode images on featured integrations (#48179)
Francesco Sansalvadorea10ebd9097a8
diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsxindex 2ae515958f8..5c8c8b097bd 100644--- a/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsx+++ b/apps/studio/components/interfaces/Integrations/Marketplace/Marketplace.constants.tsx@@ -12,7 +12,13 @@ export { getCategoryIcon, CATEGORY_ICONS } from 'common/marketplace-categories'export type { MarketplaceSource } from '@/components/interfaces/Integrations/Landing/Integrations.constants'// Defines featured integrations and their order in the featured hero-export const FEATURED_INTEGRATION_IDS = ['grafana', 'cron', 'queues', 'data_api'] as const+export const FEATURED_INTEGRATION_IDS = [+ 'grafana',+ 'cron',+ 'queues',+ 'stripe_sync_engine',+ 'data_api',+] as constexport type MarketplaceIntegrationType = 'oauth' | 'postgres_extension' | 'template' | 'wrapper'diff --git a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHeroGrid.tsx b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHeroGrid.tsxindex 9722c979052..05d5dcaf01a 100644--- a/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHeroGrid.tsx+++ b/apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHeroGrid.tsx@@ -1,30 +1,83 @@import { useParams } from 'common'import Image from 'next/image'import Link from 'next/link'-import { Badge, Card } from 'ui'+import { Badge, Card, cn } from 'ui'import { IntegrationLogo } from '../Integration/IntegrationLogo'import { getMarketplaceSource, MarketplaceSourceBadge } from './Marketplace.constants'import type { IntegrationDefinition } from '@/components/interfaces/Integrations/Landing/Integrations.constants'import { BASE_PATH } from '@/lib/constants'-const FEATURED_INTEGRATION_IMAGES: Record<string, string> = {- cron: `${BASE_PATH}/img/integrations/covers/cron-cover.webp`,- queues: `${BASE_PATH}/img/integrations/covers/queues-cover.png`,- stripe_wrapper: `${BASE_PATH}/img/integrations/covers/stripe-cover.png`,- stripe_sync_engine: `${BASE_PATH}/img/integrations/covers/stripe-cover.png`,- grafana: `${BASE_PATH}/img/integrations/covers/grafana-cover.png`,+const FEATURED_INTEGRATION_IMAGES: Record<string, { dark: string; light?: string }> = {+ cron: {+ dark: `${BASE_PATH}/img/integrations/covers/cron-cover.webp`,+ light: `${BASE_PATH}/img/integrations/covers/cron-cover-light.webp`,+ },+ queues: {+ dark: `${BASE_PATH}/img/integrations/covers/queues-cover.png`,+ light: `${BASE_PATH}/img/integrations/covers/queues-cover-light.webp`,+ },+ stripe_sync_engine: {+ dark: `${BASE_PATH}/img/integrations/covers/stripe-cover.png`,+ light: `${BASE_PATH}/img/integrations/covers/stripe-cover-light.webp`,+ },+ grafana: {+ dark: `${BASE_PATH}/img/integrations/covers/grafana-cover.png`,+ light: `${BASE_PATH}/img/integrations/covers/grafana-cover-light.webp`,+ },}-function getIntegrationImage(integration: IntegrationDefinition) {+interface ThemedImage {+ dark: string+ light?: string+}++// Resolves a cover image. `dark` is required; `light` is optional and only set when a distinct+// light-mode asset exists. Fallback (marketplace/partner) images are a single asset (dark only).+function getIntegrationImage(integration: IntegrationDefinition): ThemedImage | undefined {const featuredImage = FEATURED_INTEGRATION_IMAGES[integration.id]- if (featuredImage) return featuredImage+ if (featuredImage) {+ return { dark: featuredImage.dark, light: featuredImage.light }+ }if (integration.files?.length) {const heroImage = integration.files[0]- return typeof heroImage === 'string' ? heroImage : (heroImage?.src ?? undefined)+ const src = typeof heroImage === 'string' ? heroImage : heroImage?.src+ if (src) return { dark: src }}+ return undefined}+const CoverImage = ({+ image,+ alt,+ sizes,+ className,+}: {+ image: ThemedImage+ alt: string+ sizes?: string+ className?: string+}) => (+ <>+ <Image+ fill+ src={image.dark}+ alt={alt}+ sizes={sizes}+ className={cn('object-cover', image.light ? 'hidden dark:block' : '', className)}+ />+ {image.light && (+ <Image+ fill+ src={image.light}+ alt={alt}+ sizes={sizes}+ className={cn('object-cover dark:hidden', className)}+ />+ )}+ </>+)+interface MarketplaceFeaturedHeroGridProps {integrations: IntegrationDefinition[]installedIds: string[]@@ -56,8 +109,8 @@ export const MarketplaceFeaturedHeroGrid = ({<div className="mb-2"><h2 className="text-sm">Featured integrations</h2></div>- <div className="grid grid-cols-1 @lg:grid-cols-2 @3xl:grid-cols-4 gap-3 items-stretch">- <div className="col-span-1 @lg:col-span-2">+ <div className="grid grid-cols-1 @xl:grid-cols-2 @3xl:grid-cols-4 gap-3 items-stretch">+ <div className="col-span-1 @xl:col-span-2"><Linkhref={`/project/${ref}/integrations/${primaryIntegration.id}/overview`}className="block h-full rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-foreground-lighter focus-visible:ring-offset-1 focus-visible:ring-offset-background"@@ -68,7 +121,7 @@ export const MarketplaceFeaturedHeroGrid = ({<IntegrationLogo integration={primaryIntegration} />{primaryInstalled && <Badge variant="success">Installed</Badge>}</div>- <div className="@lg:max-w-2/3">+ <div className="@xl:max-w-2/3"><div className="mb-1 text-sm font-medium text-pretty">{primaryIntegration.name}</div>@@ -92,20 +145,17 @@ export const MarketplaceFeaturedHeroGrid = ({</div></div></div>- <div className="absolute inset-0 left-auto w-2/5 @lg:w-3/5 shrink-0 bg-surface-400">- {primaryImage ? (- <Image- fill- src={primaryImage}- alt={`${primaryIntegration.name} integration`}- className="object-cover"- />- ) : (- <div className="flex h-full items-center justify-center">- {primaryIntegration.icon({ className: 'w-10 h-10 text-foreground' })}- </div>+ <div className="absolute inset-0 left-auto w-2/5 @xl:w-3/5 shrink-0">+ {primaryImage && (+ <>+ <CoverImage+ image={primaryImage}+ alt={`${primaryIntegration.name} integration`}+ />+ <div className="absolute inset-0 bg-linear-to-r from-surface-100 via-transparent to-transparent" />+ <div className="absolute inset-0 bg-radial-[ellipse_50%_100%_at_top_left] from-surface-100 to-transparent" />+ </>)}- <div className="absolute inset-0 bg-linear-to-r from-surface-100 to-transparent" /></div></Card></Link>@@ -123,17 +173,14 @@ export const MarketplaceFeaturedHeroGrid = ({className="block h-full rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-foreground-lighter focus-visible:ring-offset-1 focus-visible:ring-offset-background"><Card className="flex flex-col overflow-hidden h-full hover:border-stronger">- <div className="hidden @lg:block relative w-full h-28 bg-alternative shrink-0">+ <div className="hidden @xl:block relative w-full h-28 bg-black/90 dark:bg-black/50 shrink-0">{image ? (- <Image- fill- src={image}- alt={`${integration.name} integration`}- className="object-cover"- />+ <CoverImage image={image} alt={`${integration.name} integration`} />) : (- <div className="flex h-full items-center justify-center">- {integration.icon({ className: 'w-8 h-8 text-foreground' })}+ <div className="flex h-full items-center p-6 justify-center">+ {integration.icon({+ className: 'w-8 h-8 object-contain aspect-square text-white',+ })}</div>)}</div>diff --git a/apps/studio/public/img/integrations/covers/cron-cover-light.webp b/apps/studio/public/img/integrations/covers/cron-cover-light.webpnew file mode 100644index 00000000000..41e31bb44a7Binary files /dev/null and b/apps/studio/public/img/integrations/covers/cron-cover-light.webp differdiff --git a/apps/studio/public/img/integrations/covers/grafana-cover-light.webp b/apps/studio/public/img/integrations/covers/grafana-cover-light.webpnew file mode 100644index 00000000000..8911e2befb2Binary files /dev/null and b/apps/studio/public/img/integrations/covers/grafana-cover-light.webp differdiff --git a/apps/studio/public/img/integrations/covers/queues-cover-light.webp b/apps/studio/public/img/integrations/covers/queues-cover-light.webpnew file mode 100644index 00000000000..fb562f62bc9Binary files /dev/null and b/apps/studio/public/img/integrations/covers/queues-cover-light.webp differdiff --git a/apps/studio/public/img/integrations/covers/stripe-cover-light.webp b/apps/studio/public/img/integrations/covers/stripe-cover-light.webpnew file mode 100644index 00000000000..d4600c799a2Binary files /dev/null and b/apps/studio/public/img/integrations/covers/stripe-cover-light.webp differ