Skip to content

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

Small styling fixes

Joshen Lim8fdb41e58563
diff --git a/studio/components/grid/components/header/RLSBannerWarning.tsx b/studio/components/grid/components/header/RLSBannerWarning.tsx
index df23ed50c7c..9d5e16f422f 100644
--- a/studio/components/grid/components/header/RLSBannerWarning.tsx
+++ b/studio/components/grid/components/header/RLSBannerWarning.tsx
@@ -1,5 +1,5 @@
-import React, { useState } from 'react'
-import { Button, IconAlertCircle, IconBookOpen, Modal } from 'ui'
+import { useState } from 'react'
+import { Button, IconAlertCircle, IconExternalLink, Modal } from 'ui'
import Link from 'next/link'
import { useParams, useStore } from 'hooks'
import ConfirmationModal from 'components/ui/ConfirmationModal'
@@ -29,16 +29,18 @@ export default function RLSBannerWarning() {
<>
{!isAcknowledged && !rlsEnabled && isPublicTable ? (
<div>
- <div className="text-center bg-red-900 text-white text-xs py-2 flex items-center justify-center">
- <IconAlertCircle />
- <span className="uppercase font-bold ml-2">Warning</span>: this table is publicly
+ <div className="text-center bg-amber-500 text-amber-900 text-xs py-2.5 flex items-center justify-center relative">
+ <IconAlertCircle size={16} strokeWidth={2} />
+ <span className="uppercase font-bold ml-2">Warning</span>: This table is publicly
readable and writable.{' '}
- <Link href={`/project/${projectRef}/auth/policies#${tableID}`}>
- <a className="underline ml-2">Enable Row Level Security</a>
+ <Link href={`/project/${projectRef}/auth/policies?search=${tableID}`}>
+ <a className="underline ml-2 opacity-80 hover:opacity-100 transition">
+ Enable Row Level Security
+ </a>
</Link>
- <div className="ml-20">
+ <div className="ml-20 absolute right-2">
<Button
- type="text"
+ type="outline"
className="text-white hover:text-scale-1200"
onClick={() => setIsOpen(true)}
>
@@ -48,34 +50,28 @@ export default function RLSBannerWarning() {
</div>
<ConfirmationModal
+ danger
visible={isOpen}
- danger={true}
- header="Confirm"
+ header="Warning: Your data is public"
buttonLabel="I understand, dismiss this warning"
onSelectCancel={() => setIsOpen(false)}
onSelectConfirm={handleDismissWarning}
children={
<Modal.Content>
- <div className="grid gap-3 mt-4 mb-6">
- <h4 className="text-base">Warning: your data is public</h4>
+ <div className="mt-4 mb-6 space-y-4">
<p className="text-sm text-scale-1100">
Data in this table is publicly <u>readable and writable</u> by anyone with the
anon key. We strongly recommend creating RLS (Row-Level Security) policies to
allow access to this table.
</p>
- <div className="grid gap-3 pt-4">
- <p className="text-sm text-scale-1100">
- Read more about setting up RLS Policies:
- </p>
- <p>
- <Link href="https://supabase.com/docs/guides/auth/row-level-security">
- <a target="_blank">
- <Button type="default" icon={<IconBookOpen strokeWidth={1.5} />}>
- Documentation
- </Button>
- </a>
- </Link>
- </p>
+ <div>
+ <Link href="https://supabase.com/docs/guides/auth/row-level-security">
+ <a target="_blank">
+ <Button type="default" icon={<IconExternalLink strokeWidth={1.5} />}>
+ About RLS Policies
+ </Button>
+ </a>
+ </Link>
</div>
</div>
</Modal.Content>
diff --git a/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx b/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
index 9996fc88488..86a11b08cbd 100644
--- a/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
+++ b/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx
@@ -73,7 +73,7 @@ const GridHeaderActions: FC<Props> = ({
<div className="mt-[1px]">
<RenderAPIPreviewToggle />
</div>
- <Link href={`/project/${projectRef}/auth/policies#${table.id}`}>
+ <Link href={`/project/${projectRef}/auth/policies?search=${table.id}`}>
<a>
<Button
type={table.rls_enabled ? 'link' : 'warning'}