Skip to content

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

Small improvements

Joshen Lim4b15f4596327
diff --git a/packages/ui/src/components/Command/SearchButton.tsx b/packages/ui/src/components/Command/SearchButton.tsx
index 4e902ec1ebb..d5f1bcef345 100644
--- a/packages/ui/src/components/Command/SearchButton.tsx
+++ b/packages/ui/src/components/Command/SearchButton.tsx
@@ -3,6 +3,7 @@ import { useCommandMenu } from './CommandMenuProvider'
const SearchButton = ({
children,
+ className,
...props
}: PropsWithChildren<
DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
@@ -15,12 +16,8 @@ const SearchButton = ({
type="button"
ref={searchButtonRef}
onClick={() => setIsOpen(true)}
+ className={className}
{...props}
- className={
- site === 'studio'
- ? 'flex border-none rounded bg-transparent p-0 outline-none outline-offset-1 transition-all focus:outline-4 focus:outline-scale-600'
- : ''
- }
>
{children}
</button>
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx
index fae2c4d5ede..f6eaad649a7 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/LayoutHeader.tsx
@@ -1,9 +1,8 @@
-import clsx from 'clsx'
import Link from 'next/link'
import { observer } from 'mobx-react-lite'
import * as Tooltip from '@radix-ui/react-tooltip'
import { useParams } from 'common'
-import { Badge, IconCommand, IconSearch, SearchButton } from 'ui'
+import { Badge, Button, IconCommand, IconSearch, useCommandMenu } from 'ui'
import { detectOS } from 'lib/helpers'
import { IS_PLATFORM, PRICING_TIER_PRODUCT_IDS } from 'lib/constants'
@@ -24,6 +23,7 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =
const { selectedOrganization, selectedProject } = ui
const os = detectOS()
+ const { setIsOpen } = useCommandMenu()
const showCmdkHelper = useFlag('dashboardCmdk')
const { ref: projectRef } = useParams()
@@ -122,17 +122,13 @@ const LayoutHeader = ({ customHeaderComponents, breadcrumbs = [], headerBorder =
{IS_PLATFORM && showCmdkHelper && (
<Tooltip.Root delayDuration={0}>
<Tooltip.Trigger>
- <SearchButton>
- <span
- className={clsx(
- 'cursor-pointer text-center ease-out duration-200 rounded outline-none transition-all outline-0 focus-visible:outline-4 focus-visible:outline-offset-1',
- 'text-scale-1200 bg-scale-100 hover:bg-scale-300 bordershadow-scale-600 hover:bordershadow-scale-700 dark:bordershadow-scale-700',
- 'hover:dark:bordershadow-scale-800 dark:bg-scale-500 dark:hover:bg-scale-600 focus-visible:outline-brand-600 shadow-sm text-xs px-2 py-1'
- )}
- >
- <IconSearch className="text-scale-1100" size={16} strokeWidth={2} />
- </span>
- </SearchButton>
+ <div className="flex">
+ <Button
+ type="default"
+ icon={<IconSearch size={16} strokeWidth={1.5} className="text-scale-1200" />}
+ onClick={() => setIsOpen(true)}
+ />
+ </div>
</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content side="bottom">
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
index 0aa4afd87a2..685af80c371 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/NotificationsPopover/index.tsx
@@ -2,6 +2,7 @@ import dayjs from 'dayjs'
import { FC, Fragment, useState } from 'react'
import { useRouter } from 'next/router'
import { Alert, Button, IconBell, Popover, IconArrowRight } from 'ui'
+import * as Tooltip from '@radix-ui/react-tooltip'
import {
Notification,
NotificationStatus,
@@ -221,20 +222,37 @@ const NotificationsPopover: FC<Props> = () => {
</div>
}
>
- <div className="relative flex">
- <Button
- as="span"
- id="notification-button"
- type="default"
- icon={<IconBell size={16} strokeWidth={1.5} className="text-scale-1200" />}
- />
- {hasNewNotifications && (
- <div className="absolute -top-1 -right-1 z-50 flex h-3 w-3 items-center justify-center">
- <div className="h-full w-full animate-ping rounded-full bg-green-800 opacity-60"></div>
- <div className="z-60 absolute top-0 right-0 h-full w-full rounded-full bg-green-900 opacity-80"></div>
+ <Tooltip.Root delayDuration={0}>
+ <Tooltip.Trigger>
+ <div className="relative flex">
+ <Button
+ as="span"
+ id="notification-button"
+ type="default"
+ icon={<IconBell size={16} strokeWidth={1.5} className="text-scale-1200" />}
+ />
+ {hasNewNotifications && (
+ <div className="absolute -top-1 -right-1 z-50 flex h-3 w-3 items-center justify-center">
+ <div className="h-full w-full animate-ping rounded-full bg-green-800 opacity-60"></div>
+ <div className="z-60 absolute top-0 right-0 h-full w-full rounded-full bg-green-900 opacity-80"></div>
+ </div>
+ )}
</div>
- )}
- </div>
+ </Tooltip.Trigger>
+ <Tooltip.Portal>
+ <Tooltip.Content side="bottom">
+ <Tooltip.Arrow className="radix-tooltip-arrow" />
+ <div
+ className={[
+ 'rounded bg-scale-100 py-1 px-2 leading-none shadow',
+ 'border border-scale-200 flex items-center space-x-1',
+ ].join(' ')}
+ >
+ <span className="text-xs text-scale-1200">Notifications</span>
+ </div>
+ </Tooltip.Content>
+ </Tooltip.Portal>
+ </Tooltip.Root>
</Popover>
<ConfirmModal