Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Chore/fix resource exhaustion banner (#29177)

Joshen Lim10f6433796d2
diff --git a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx
index 6ac5555724a..696004ad846 100644
--- a/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx
+++ b/apps/studio/components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner.tsx
@@ -1,12 +1,12 @@
-import { useParams } from 'common'
+import { AlertTriangle, ExternalLink } from 'lucide-react'
import Link from 'next/link'
import { useRouter } from 'next/router'
-import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui'
+import { useParams } from 'common'
import { useResourceWarningsQuery } from 'data/usage/resource-warnings-query'
+import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button, cn } from 'ui'
import { RESOURCE_WARNING_MESSAGES } from './ResourceExhaustionWarningBanner.constants'
import { getWarningContent } from './ResourceExhaustionWarningBanner.utils'
-import { AlertTriangle, ExternalLink } from 'lucide-react'
const ResourceExhaustionWarningBanner = () => {
const { ref } = useParams()
@@ -96,19 +96,24 @@ const ResourceExhaustionWarningBanner = () => {
!activeWarnings.includes('is_readonly_mode_enabled')) ||
(activeWarnings.includes('is_readonly_mode_enabled') &&
router.pathname.endsWith('settings/database'))
- )
+ ) {
return null
+ }
return (
<Alert_Shadcn_
variant={isCritical ? 'destructive' : 'warning'}
- className="border-0 border-r-0 rounded-none [&>svg]:left-6 px-6 [&>svg]:w-[26px]
-[&>svg]:h-[26px]"
+ className={cn(
+ 'flex items-center justify-between',
+ 'border-0 border-r-0 rounded-none [&>svg]:left-6 px-6 [&>svg]:w-[26px] [&>svg]:h-[26px]'
+ )}
>
<AlertTriangle />
- <AlertTitle_Shadcn_>{title}</AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_>{description}</AlertDescription_Shadcn_>
- <div className="absolute top-5 right-5 flex items-center space-x-2">
+ <div className="">
+ <AlertTitle_Shadcn_>{title}</AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_>{description}</AlertDescription_Shadcn_>
+ </div>
+ <div className="flex items-center gap-x-2">
{learnMoreUrl !== undefined && (
<Button asChild type="default" icon={<ExternalLink />}>
<a href={learnMoreUrl} target="_blank" rel="noreferrer">