Skip to content

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

Update notifications to have a common set of actions

Joshen Limb7724b117b2b
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlBugfixNotification.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlBugfixNotification.tsx
index 69ec1b77c2d..7decd8711eb 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlBugfixNotification.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlBugfixNotification.tsx
@@ -26,18 +26,6 @@ const PostgresqlBugfixNotification: FC<Props> = ({ notification }) => {
</p>
<p className="text-scale-1000 text-sm">{insertedAt}</p>
</div>
- <Dropdown
- side="bottom"
- align="end"
- size="small"
- overlay={[
- <Dropdown.Item icon={<IconCheck size={14} />}>Mark as read</Dropdown.Item>,
- <Dropdown.Item icon={<IconXSquare size={14} />}>Dismiss notification</Dropdown.Item>,
- <Dropdown.Item icon={<IconRefreshCw size={14} />}>Restart project now</Dropdown.Item>,
- ]}
- >
- <Button size="tiny" type="text" icon={<IconMoreVertical />} />
- </Dropdown>
</div>
)
}
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlInfoNotification.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlInfoNotification.tsx
index 7e53dd4048c..9bf744605ac 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlInfoNotification.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/PostgresqlInfoNotification.tsx
@@ -29,18 +29,6 @@ const PostgresqlInfoNotification: FC<Props> = ({ notification }) => {
</p>
<p className="text-scale-1000 text-sm">{insertedAt}</p>
</div>
- <Dropdown
- side="bottom"
- align="end"
- size="small"
- overlay={[
- <Dropdown.Item icon={<IconCheck size={14} />}>Mark as read</Dropdown.Item>,
- <Dropdown.Item icon={<IconXSquare size={14} />}>Dismiss notification</Dropdown.Item>,
- <Dropdown.Item icon={<IconRefreshCw size={14} />}>Restart project now</Dropdown.Item>,
- ]}
- >
- <Button size="tiny" type="text" icon={<IconMoreVertical />} />
- </Dropdown>
</div>
)
}
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/TierLimitExceededNotification.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/TierLimitExceededNotification.tsx
index 39e7c5566d9..844947a27bf 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/TierLimitExceededNotification.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/TierLimitExceededNotification.tsx
@@ -40,18 +40,6 @@ const TierLimitExceededNotification: FC<Props> = ({ notification }) => {
</p>
<p className="text-scale-1000 text-sm">{insertedAt}</p>
</div>
- <Dropdown
- side="bottom"
- align="end"
- size="small"
- overlay={[
- <Dropdown.Item icon={<IconCheck size={14} />}>Mark as read</Dropdown.Item>,
- <Dropdown.Item icon={<IconXSquare size={14} />}>Dismiss notification</Dropdown.Item>,
- <Dropdown.Item icon={<IconRefreshCw size={14} />}>Restart project now</Dropdown.Item>,
- ]}
- >
- <Button size="tiny" type="text" icon={<IconMoreVertical />} />
- </Dropdown>
</div>
)
}
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
index 977c5145536..52378039555 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
@@ -1,5 +1,13 @@
import { FC, Fragment } from 'react'
-import { Button, IconBell, Popover } from '@supabase/ui'
+import {
+ Button,
+ IconBell,
+ Popover,
+ Dropdown,
+ IconCheck,
+ IconMoreVertical,
+ IconXSquare,
+} from '@supabase/ui'
import {
Notification,
NotificationName,
@@ -44,17 +52,34 @@ const NotificationsPopover: FC<Props> = () => {
overlay={
<div className="my-2 w-[500px]">
{notifications?.map((notification, i: number) => (
- <>
+ <Fragment key={notification.id}>
<div className="grid grid-cols-12 py-2">
<div className="col-span-1 flex items-center justify-center">
{notification.notification_status !== NotificationStatus.Seen && (
<div className="h-2 w-2 rounded-full bg-green-900" />
)}
</div>
- <div className="col-span-11 mr-5">{renderNotification(notification)}</div>
+ <div className="col-span-9">{renderNotification(notification)}</div>
+ <div className="col-span-2 flex items-center justify-center">
+ <Dropdown
+ side="bottom"
+ align="end"
+ size="small"
+ overlay={[
+ <Dropdown.Item key="mark-read" icon={<IconCheck size={14} />}>
+ Mark as read
+ </Dropdown.Item>,
+ <Dropdown.Item key="dismiss" icon={<IconXSquare size={14} />}>
+ Dismiss notification
+ </Dropdown.Item>,
+ ]}
+ >
+ <IconMoreVertical size={16} />
+ </Dropdown>
+ </div>
</div>
{i !== notifications.length - 1 && <Popover.Seperator />}
- </>
+ </Fragment>
))}
</div>
}