mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
## Problem Launch Week 16 is promoted on www but needs the same promotion in hosted Studio. ## Solution Add a low-priority card to the existing bottom-right Banner Stack across project, organisation, and account pages. It uses the shared dot artwork from #54511, links to the Launch Week site, saves dismissal, and expires after December 11 in San Francisco. Signed-out and self-hosted Studio do not show it. | After | | --- | | <img width="995" height="584" alt="1211" src="https://github.com/user-attachments/assets/ff1a60a3-6a4e-4b32-a3df-7fdfe74f4afb" /> | | <img width="995" height="584" alt="68318" src="https://github.com/user-attachments/assets/3a41c56a-fe59-4800-ae14-82ec42c6f260" /> | ## Review instructions 1. Open a hosted project, organisation, or account page on the Studio preview. If another notice is in front, expand the Banner Stack to find **Launch Week 16**. 2. Check the artwork, copy, and **Claim your ticket** button in light and dark mode. The button opens the Launch Week site in a new tab and dismisses the card. 3. Close the card and reload. It should stay dismissed.
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import { XIcon } from 'lucide-react'
|
|
import { Button, Card, CardContent, cn } from 'ui'
|
|
|
|
import { BASE_PATH } from '@/lib/constants'
|
|
|
|
interface BannerCardProps {
|
|
onDismiss?: () => void
|
|
children: React.ReactNode
|
|
className?: string
|
|
background?: React.ReactNode
|
|
dismissButtonClassName?: string
|
|
}
|
|
|
|
export const BannerCard = ({
|
|
onDismiss,
|
|
children,
|
|
className,
|
|
background,
|
|
dismissButtonClassName,
|
|
}: BannerCardProps) => {
|
|
return (
|
|
<Card className={cn('relative overflow-hidden shadow-lg rounded-2xl', className)}>
|
|
{background ?? (
|
|
<div className="absolute -inset-16 z-0 opacity-100 pointer-events-none">
|
|
<img
|
|
src={`${BASE_PATH}/img/reports/bg-grafana-dark.svg`}
|
|
alt=""
|
|
aria-hidden="true"
|
|
className="w-full h-full object-cover object-right hidden dark:block"
|
|
/>
|
|
<img
|
|
src={`${BASE_PATH}/img/reports/bg-grafana-light.svg`}
|
|
alt=""
|
|
aria-hidden="true"
|
|
className="w-full h-full object-cover object-right dark:hidden"
|
|
/>
|
|
<div className="absolute inset-0 bg-linear-to-r from-background-alternative to-transparent" />
|
|
</div>
|
|
)}
|
|
|
|
<CardContent className="relative z-10 p-6">
|
|
{onDismiss && (
|
|
<div className="absolute top-4 right-4 z-20">
|
|
<Button
|
|
variant="text"
|
|
size="tiny"
|
|
type="button"
|
|
icon={<XIcon size={16} strokeWidth={1.5} />}
|
|
onClick={(e) => {
|
|
e.preventDefault()
|
|
onDismiss()
|
|
}}
|
|
className={cn('opacity-75 hover:opacity-100 px-1', dismissButtonClassName)}
|
|
aria-label="Close banner"
|
|
/>
|
|
</div>
|
|
)}
|
|
{children}
|
|
</CardContent>
|
|
</Card>
|
|
)
|
|
}
|