mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
## What kind of change does this PR introduce? Mechanical cleanup on top of the Button default-variant change (#50160). ## What is the current behavior? Many callsites still pass `variant="default"` even though that is now the component default. ## What is the new behavior? Removes redundant static `variant="default"` from legacy `Button` and `ButtonTooltip` callsites. Keeps explicit defaults where they document the API: - `button-default.tsx` and `button-sizes.tsx` demos - `DocsButton`, which pins neutral styling at the wrapper boundary ## To test Studio: - [Auth → Rate Limits](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/auth/rate-limits): dirty the form so Cancel appears; Cancel stays neutral, Save stays green - [Project Settings → API Keys](https://studio-staging-2s957kwc4-supabase.vercel.app/dashboard/project/_/settings/api-keys): `DocsButton` in the header actions stays neutral Design system: - [Design system → Button](https://design-system-git-dnywh-dc924ac1-supabase.vercel.app/design-system/docs/components/button): `button-default` / `button-sizes` still show explicit default styling; Primary (green) is restricted to the Primary section (and `asChild`) WWW: - [www → Brand assets](https://zone-www-dot-com-git-dnywh-dc924ac1-supabase.vercel.app/brand-assets): Download logo kit / Download button kit stay neutral
103 lines
3.1 KiB
TypeScript
103 lines
3.1 KiB
TypeScript
import Link from 'next/link'
|
|
import {
|
|
Button,
|
|
Card,
|
|
Dialog,
|
|
DialogContent,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogSection,
|
|
DialogSectionSeparator,
|
|
DialogTitle,
|
|
Table,
|
|
TableBody,
|
|
TableCell,
|
|
TableHead,
|
|
TableHeader,
|
|
TableRow,
|
|
} from 'ui'
|
|
|
|
import { TIER_QUERY_LIMITS } from './Logs.constants'
|
|
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
|
|
|
|
interface Props {
|
|
show: boolean
|
|
setShowUpgradePrompt: (value: boolean) => void
|
|
title?: string
|
|
description?: string
|
|
source?: string
|
|
}
|
|
/**
|
|
* @param show - whether to show the modal
|
|
* @param setShowUpgradePrompt - function to set the show state
|
|
* @param title - title of the modal
|
|
* @param description - description of the modal
|
|
* @param source - source of the upgrade prompt used to track the source of the upgrade prompt in the billing page
|
|
* @returns
|
|
*/
|
|
const UpgradePrompt: React.FC<Props> = ({
|
|
show,
|
|
setShowUpgradePrompt,
|
|
title = 'Log retention',
|
|
description = 'Logs can be retained up to a duration of 3 months depending on the plan that your project is on.',
|
|
source = 'logsRetentionUpgradePrompt',
|
|
}) => {
|
|
const { data: organization } = useSelectedOrganizationQuery()
|
|
|
|
return (
|
|
<Dialog open={show} onOpenChange={() => setShowUpgradePrompt(false)}>
|
|
<DialogContent size="medium">
|
|
<DialogHeader>
|
|
<DialogTitle>{title}</DialogTitle>
|
|
</DialogHeader>
|
|
<DialogSectionSeparator />
|
|
<DialogSection>
|
|
<div className="space-y-4">
|
|
<p className="text-sm">{description}</p>
|
|
<Card>
|
|
<Table>
|
|
<TableHeader>
|
|
<TableRow>
|
|
<TableHead>Plan</TableHead>
|
|
<TableHead>Retention duration</TableHead>
|
|
</TableRow>
|
|
</TableHeader>
|
|
<TableBody>
|
|
<TableRow>
|
|
<TableCell>Free</TableCell>
|
|
<TableCell>{TIER_QUERY_LIMITS.FREE.text}</TableCell>
|
|
</TableRow>
|
|
<TableRow>
|
|
<TableCell>Pro</TableCell>
|
|
<TableCell>{TIER_QUERY_LIMITS.PRO.text}</TableCell>
|
|
</TableRow>
|
|
<TableRow>
|
|
<TableCell>Team</TableCell>
|
|
<TableCell>{TIER_QUERY_LIMITS.TEAM.text}</TableCell>
|
|
</TableRow>
|
|
<TableRow>
|
|
<TableCell>Enterprise</TableCell>
|
|
<TableCell>{TIER_QUERY_LIMITS.ENTERPRISE.text}</TableCell>
|
|
</TableRow>
|
|
</TableBody>
|
|
</Table>
|
|
</Card>
|
|
</div>
|
|
</DialogSection>
|
|
<DialogFooter className="flex justify-end gap-3">
|
|
<Button onClick={() => setShowUpgradePrompt(false)}>Close</Button>
|
|
<Button variant="primary" asChild size="tiny">
|
|
<Link
|
|
href={`/org/${organization?.slug}/billing?panel=subscriptionPlan&source=${source}`}
|
|
>
|
|
Upgrade
|
|
</Link>
|
|
</Button>
|
|
</DialogFooter>
|
|
</DialogContent>
|
|
</Dialog>
|
|
)
|
|
}
|
|
|
|
export default UpgradePrompt
|