Files
supabase/apps/studio/components/interfaces/Auth/AuthProvidersForm/AuthAlert.tsx
T
Danny White 476d4a5851 refactor(ui): drop redundant Button variant="default" props (#50161)
## 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
2026-09-11 17:05:26 +10:00

60 lines
1.8 KiB
TypeScript

import { useParams } from 'common'
import { ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { Alert, AlertDescription, AlertTitle, Button, WarningIcon } from 'ui'
import { DOCS_URL } from '@/lib/constants'
export const AuthAlert = ({
title,
isHookSendSMSEnabled,
}: {
title: string
isHookSendSMSEnabled: boolean
}) => {
const { ref } = useParams()
switch (title) {
// TODO (KM): Remove after 10th October 2024 when we disable the provider
case 'Slack (Deprecated)':
return (
<Alert variant="warning">
<WarningIcon />
<AlertTitle>Slack (Deprecated) Provider</AlertTitle>
<AlertDescription>
Recently, Slack has updated their OAuth API. Please use the new Slack (OIDC) provider
below. Developers using this provider should move over to the new provider. Please refer
to our{' '}
<a
href={`${DOCS_URL}/guides/auth/social-login/auth-slack`}
className="underline"
target="_blank"
>
documentation
</a>{' '}
for more details.
</AlertDescription>
</Alert>
)
case 'Phone':
return (
isHookSendSMSEnabled && (
<Alert>
<WarningIcon />
<AlertTitle>
SMS provider settings are disabled while the SMS hook is enabled.
</AlertTitle>
<AlertDescription className="flex flex-col gap-y-3">
<p>The SMS hook will be used in place of the SMS provider configured</p>
<Button asChild className="w-min" icon={<ExternalLink />}>
<Link href={`/project/${ref}/auth/hooks`}>View auth hooks</Link>
</Button>
</AlertDescription>
</Alert>
)
)
default:
return null
}
}