Skip to content

Commit 0399beb

Browse files
authored
chore(studio): use Admonition and deprecate AlertError (supabase#41095)
* use admonition and deprecate * spot fix * remove mb on admonition itself * smart layout handling based on actions count * fixes * remove class * fixes * remove mb-0 instances * remove redundant m-0 * remove single-use component * use props * reset leading * remove redundant clause
1 parent cf1f728 commit 0399beb

File tree

34 files changed

+115
-115
lines changed

34 files changed

+115
-115
lines changed

apps/studio/components/interfaces/Account/AccessTokens/NewAccessTokenDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export const NewAccessTokenDialog = ({
139139
{tokenScope === 'V0' ? (
140140
<Admonition
141141
type="warning"
142-
className="rounded-none border-t-0 border-x-0 mb-0"
142+
className="rounded-none border-t-0 border-x-0"
143143
title="The experimental API provides additional endpoints which allows you to manage your organizations and projects."
144144
description={
145145
<>
@@ -160,7 +160,7 @@ export const NewAccessTokenDialog = ({
160160
) : (
161161
<Admonition
162162
type="warning"
163-
className="rounded-none border-t-0 border-x-0 mb-0"
163+
className="rounded-none border-t-0 border-x-0"
164164
title="Access tokens can be used to control your whole account"
165165
description="Be careful when sharing your tokens"
166166
/>

apps/studio/components/interfaces/Auth/EmailRateLimitsAlert.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

apps/studio/components/interfaces/Auth/EmailTemplates/EmailTemplates.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
TooltipContent,
3131
TooltipTrigger,
3232
} from 'ui'
33-
import { Admonition } from 'ui-patterns'
33+
import { Admonition } from 'ui-patterns/admonition'
3434
import {
3535
PageSection,
3636
PageSectionContent,
@@ -39,7 +39,6 @@ import {
3939
PageSectionTitle,
4040
} from 'ui-patterns/PageSection'
4141
import { TEMPLATES_SCHEMAS } from '../AuthTemplatesValidation'
42-
import { EmailRateLimitsAlert } from '../EmailRateLimitsAlert'
4342
import { slugifyTitle } from './EmailTemplates.utils'
4443

4544
const notificationEnabledKeys = TEMPLATES_SCHEMAS.filter(
@@ -142,9 +141,26 @@ export const EmailTemplates = () => {
142141
{isSuccess && (
143142
<>
144143
{builtInSMTP && (
145-
<div className="mt-12">
146-
<EmailRateLimitsAlert />
147-
</div>
144+
<Admonition
145+
type="warning"
146+
title="Set up custom SMTP"
147+
description={
148+
<p>
149+
You’re using the built-in email service. This service has rate limits and is not
150+
meant to be used for production apps.{' '}
151+
<InlineLink href={`${DOCS_URL}/guides/platform/going-into-prod#auth-rate-limits`}>
152+
Learn more
153+
</InlineLink>{' '}
154+
</p>
155+
}
156+
layout="horizontal"
157+
className="mt-12 mb-10"
158+
actions={
159+
<Button asChild type="default" className="mt-2">
160+
<Link href={`/project/${projectRef}/auth/smtp`}>Set up SMTP</Link>
161+
</Button>
162+
}
163+
/>
148164
)}
149165
<PageSection className="!pt-0">
150166
<PageSectionMeta>

apps/studio/components/interfaces/Auth/Policies/PolicyTableRow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const PolicyTableRowComponent = ({
109109
<Admonition
110110
showIcon={false}
111111
type="warning"
112-
className="mb-0 border-0 border-y rounded-none [&>div]:text-foreground-light h-[50px] py-0 flex items-center"
112+
className="border-0 border-y rounded-none [&>div]:text-foreground-light h-[50px] py-0 flex items-center"
113113
>
114114
No data will be selectable via Supabase APIs as this schema is not exposed. You may
115115
configure this in your project's{' '}

apps/studio/components/interfaces/Auth/Users/UserOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export const UserOverview = ({ user, onDeleteSuccess }: UserOverviewProps) => {
182182
<Admonition
183183
type="warning"
184184
label={`User banned until ${dayjs(user.banned_until).format(DATE_FORMAT)}`}
185-
className="border-r-0 border-l-0 rounded-none -mt-px [&_svg]:ml-0.5 mb-0"
185+
className="border-r-0 border-l-0 rounded-none -mt-px [&_svg]:ml-0.5"
186186
/>
187187
) : (
188188
<Separator />

apps/studio/components/interfaces/Billing/Payment/PaymentMethods/PaymentMethods.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ const PaymentMethods = () => {
9797
<Admonition
9898
type="note"
9999
layout="horizontal"
100-
className="mb-0"
101100
title="Payment is currently by invoice"
102101
description="You get a monthly invoice and payment link via email. To change your payment
103102
method, please contact us via our support form."

apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ export const DatabaseConnectionString = () => {
529529
<Admonition
530530
type="warning"
531531
title="Highly recommended to not use Session Pooler"
532-
className="[&>div]:gap-0 px-8 [&>svg]:left-7 border-0 border-b rounded-none border-border-muted !py-4 mb-0"
532+
className="[&>div]:gap-0 px-8 [&>svg]:left-7 border-0 border-b rounded-none border-border-muted !py-4"
533533
>
534534
<p className="text-sm text-foreground-lighter !mb-0">
535535
If you are using Session Pooler, we recommend switching to Direct

apps/studio/components/interfaces/Database/Extensions/ExtensionRow.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ export const ExtensionRow = ({ extension }: ExtensionRowProps) => {
203203
Are you sure you want to turn OFF the "{extension.name}" extension?
204204
</p>
205205
{EXTENSION_DISABLE_WARNINGS[extension.name] && (
206-
<Admonition type="warning" className="m-0">
207-
{EXTENSION_DISABLE_WARNINGS[extension.name]}
208-
</Admonition>
206+
<Admonition type="warning">{EXTENSION_DISABLE_WARNINGS[extension.name]}</Admonition>
209207
)}
210208
</div>
211209
</ConfirmationModal>

apps/studio/components/interfaces/Database/Publications/PublicationsTables.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const PublicationsTables = () => {
7777
{!isLoadingPermissions && !canUpdatePublications && (
7878
<Admonition
7979
type="note"
80-
className="w-[500px] m-0"
80+
className="w-[500px]"
8181
title="You need additional permissions to update database replications"
8282
/>
8383
)}

apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ export const PublicationSelection = ({
7171
/>
7272
</FormControl_Shadcn_>
7373
{isSelectedPublicationMissing ? (
74-
<Admonition type="warning" className="mt-2 mb-0">
74+
<Admonition type="warning" className="mt-2">
7575
<p className="!leading-normal">
7676
The publication <strong className="text-foreground">{publicationName}</strong> was
7777
not found, it may have been renamed or deleted, please select another one.
7878
</p>
7979
</Admonition>
8080
) : hasTablesWithNoPrimaryKeys ? (
81-
<Admonition type="warning" className="mt-2 mb-0">
81+
<Admonition type="warning" className="mt-2">
8282
<p className="!leading-normal">
8383
Replication requires every table in the publication to have a primary key to work,
8484
which these tables are missing:

0 commit comments

Comments
 (0)