Skip to content

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

Small refactor

Joshen Limeafa23d5f1b1
diff --git a/studio/components/interfaces/App/AppBannerWrapper.tsx b/studio/components/interfaces/App/AppBannerWrapper.tsx
index 3f3faa61251..581ca0c6669 100644
--- a/studio/components/interfaces/App/AppBannerWrapper.tsx
+++ b/studio/components/interfaces/App/AppBannerWrapper.tsx
@@ -1,26 +1,12 @@
-import { FC } from 'react'
-import Link from 'next/link'
+import IncidentBanner from 'components/layouts/AppLayout/IncidentBanner'
import { useFlag } from 'hooks'
-import { IconExternalLink } from 'ui'
+import { PropsWithChildren } from 'react'
-const AppBannerWrapper: FC = ({ children }) => {
+const AppBannerWrapper = ({ children }: PropsWithChildren<{}>) => {
const ongoingIncident = useFlag('ongoingIncident')
-
return (
<div className="min-h-full flex flex-col">
- {ongoingIncident && (
- <Link href="https://status.supabase.com">
- <a target="_blank" rel="noreferrer">
- <div className="flex cursor-pointer items-center justify-center space-x-2 bg-green-900 py-3 text-scale-400 transition hover:bg-green-1000 dark:text-scale-1200">
- <p className="text-sm font-medium">
- We are currently investigating a technical issue, follow status.supabase.com for
- updates
- </p>
- <IconExternalLink size={16} strokeWidth={2} />
- </div>
- </a>
- </Link>
- )}
+ {ongoingIncident && <IncidentBanner />}
{children}
</div>
diff --git a/studio/components/layouts/AppLayout/IncidentBanner.tsx b/studio/components/layouts/AppLayout/IncidentBanner.tsx
new file mode 100644
index 00000000000..4004c1922cb
--- /dev/null
+++ b/studio/components/layouts/AppLayout/IncidentBanner.tsx
@@ -0,0 +1,19 @@
+import Link from 'next/link'
+import { IconExternalLink } from 'ui'
+
+const IncidentBanner = () => {
+ return (
+ <Link href="https://status.supabase.com">
+ <a target="_blank" rel="noreferrer">
+ <div className="flex cursor-pointer items-center justify-center space-x-2 bg-green-900 py-3 text-scale-400 transition hover:bg-green-1000 dark:text-scale-1200">
+ <p className="text-sm font-medium">
+ We are currently investigating a technical issue, follow status.supabase.com for updates
+ </p>
+ <IconExternalLink size={16} strokeWidth={2} />
+ </div>
+ </a>
+ </Link>
+ )
+}
+
+export default IncidentBanner
diff --git a/studio/pages/_app.tsx b/studio/pages/_app.tsx
index 6051ab68387..b0652d80767 100644
--- a/studio/pages/_app.tsx
+++ b/studio/pages/_app.tsx
@@ -62,6 +62,11 @@ dayjs.extend(relativeTime)
dart(Prism)
+// [Joshen TODO] Once we settle on the new nav layout - we'll need a lot of clean up in terms of our layout components
+// a lot of them are unnecessary and introduce way too many cluttered CSS especially with the height styles that make
+// debugging way too difficult. Ideal scenario is we just have one AppLayout to control the height and scroll areas of
+// the dashboard, all other layout components should not be doing that
+
function CustomApp({ Component, pageProps }: AppPropsWithLayout) {
const queryClient = useRootQueryClient()
const [rootStore] = useState(() => new RootStore())