The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: implement getLayout in Reports, DocsLayout, SettingsLayout and BillingLayout
Alaister Young608a14ccd5b9
diff --git a/studio/components/layouts/BillingLayout.tsx b/studio/components/layouts/BillingLayout.tsxindex d4b2825eccf..932a064315d 100644--- a/studio/components/layouts/BillingLayout.tsx+++ b/studio/components/layouts/BillingLayout.tsx@@ -1,6 +1,6 @@import Link from 'next/link'import { FC, ReactNode } from 'react'-import { useStore } from 'hooks'+import { useStore, withAuth } from 'hooks'import { Button, IconX } from '@supabase/ui'import { headWithTimeout } from 'lib/common/fetch'@@ -15,19 +15,19 @@ const BillingLayout: FC<Props> = ({ children }) => {return (<BaseLayout hideHeader hideIconBar>- <div className="flex flex-col h-full w-full">+ <div className="flex h-full w-full flex-col">{/* Header */}- <div className="py-4 border-b dark:border-dark flex items-center space-x-3 px-5">+ <div className="dark:border-dark flex items-center space-x-3 border-b py-4 px-5"><Link href={`/project/${ui.selectedProject?.ref}/settings/billing`} passHref>- <a className="transition-colors text-scale-900 hover:text-scale-1200">+ <a className="text-scale-900 hover:text-scale-1200 transition-colors"><IconX size={16} strokeWidth={1.5} /></a></Link><div className="flex items-center space-x-6">- <h1 className="text-base text-scale-1200">Customize your plan</h1>- <div className="h-6 w-px bg-scale-600"></div>- <div className="flex space-x-3 items-center">- <p className="text-sm text-scale-1100">{ui.selectedOrganization?.name}</p>+ <h1 className="text-scale-1200 text-base">Customize your plan</h1>+ <div className="bg-scale-600 h-6 w-px"></div>+ <div className="flex items-center space-x-3">+ <p className="text-scale-1100 text-sm">{ui.selectedOrganization?.name}</p><span className="text-scale-800"><svgviewBox="0 0 24 24"@@ -43,7 +43,7 @@ const BillingLayout: FC<Props> = ({ children }) => {<path d="M16 3.549L7.12 20.600"></path></svg></span>- <p className="text-sm text-scale-1100">{ui.selectedProject?.name}</p>+ <p className="text-scale-1100 text-sm">{ui.selectedProject?.name}</p></div></div></div>@@ -55,4 +55,4 @@ const BillingLayout: FC<Props> = ({ children }) => {)}-export default BillingLayout+export default withAuth(BillingLayout)diff --git a/studio/components/layouts/DocsLayout/DocsLayout.tsx b/studio/components/layouts/DocsLayout/DocsLayout.tsxindex 39952e0c84e..3f13f60fde1 100644--- a/studio/components/layouts/DocsLayout/DocsLayout.tsx+++ b/studio/components/layouts/DocsLayout/DocsLayout.tsx@@ -2,7 +2,7 @@ import { ReactElement, useEffect } from 'react'import { observer } from 'mobx-react-lite'import { useRouter } from 'next/router'-import { useStore } from 'hooks'+import { useStore, withAuth } from 'hooks'import Error from 'components/ui/Error'import ProductMenu from 'components/ui/ProductMenu'import ProjectLayout from 'components/layouts/ProjectLayout/ProjectLayout'@@ -54,4 +54,4 @@ function DocsLayout({ title, children }: { title: string; children: ReactElement)}-export default observer(DocsLayout)+export default withAuth(observer(DocsLayout))diff --git a/studio/components/layouts/SettingsLayout/SettingsLayout.tsx b/studio/components/layouts/SettingsLayout/SettingsLayout.tsxindex e3c17bb2ccb..016a52967d7 100644--- a/studio/components/layouts/SettingsLayout/SettingsLayout.tsx+++ b/studio/components/layouts/SettingsLayout/SettingsLayout.tsx@@ -1,7 +1,7 @@import { FC, ReactNode } from 'react'import { observer } from 'mobx-react-lite'import { useRouter } from 'next/router'-import { useStore } from 'hooks'+import { useStore, withAuth } from 'hooks'import { generateSettingsMenu } from './SettingsMenu.utils'import BaseLayout from '../'@@ -34,4 +34,4 @@ const SettingsLayout: FC<Props> = ({ title, children }) => {)}-export default observer(SettingsLayout)+export default withAuth(observer(SettingsLayout))diff --git a/studio/pages/project/[ref]/api/index.tsx b/studio/pages/project/[ref]/api/index.tsxindex 6ae2714af8c..d6b9480a285 100644--- a/studio/pages/project/[ref]/api/index.tsx+++ b/studio/pages/project/[ref]/api/index.tsx@@ -5,7 +5,7 @@ import { FC, createContext, useContext, useEffect, useState } from 'react'import { observer, useLocalObservable } from 'mobx-react-lite'import { API_URL, IS_PLATFORM } from 'lib/constants'-import { useStore, withAuth } from 'hooks'+import { useStore } from 'hooks'import { get } from 'lib/common/fetch'import { snakeToCamel } from 'lib/helpers'import { DocsLayout } from 'components/layouts'@@ -18,10 +18,11 @@ import TablesIntroduction from 'components/to-be-cleaned/Docs/Pages/Tables/Introimport UserManagement from 'components/to-be-cleaned/Docs/Pages/UserManagement'import RpcIntroduction from 'components/to-be-cleaned/Docs/Pages/Rpc/Introduction'import Description from 'components/to-be-cleaned/Docs/Description'+import { NextPageWithLayout } from 'types'const PageContext = createContext(null)-const PageConfig = () => {+const PageConfig: NextPageWithLayout = () => {const PageState: any = useLocalObservable(() => ({projectRef: '',jsonSchema: {},@@ -59,13 +60,14 @@ const PageConfig = () => {return (<PageContext.Provider value={PageState}>- <DocsLayout title="API">- <DocView project={project} />- </DocsLayout>+ <DocView project={project} /></PageContext.Provider>)}-export default withAuth(observer(PageConfig))++PageConfig.getLayout = (page) => <DocsLayout title="API">{page}</DocsLayout>++export default observer(PageConfig)const DEFAULT_KEY = { name: 'hide', key: 'SUPABASE_KEY' }@@ -99,7 +101,7 @@ const DocView: FC<any> = observer(({}) => {if (error || jsonSchemaError)return (- <div className="p-6 mx-auto sm:w-full md:w-3/4 text-center">+ <div className="mx-auto p-6 text-center sm:w-full md:w-3/4"><Typography.Text type="danger"><p>Error connecting to API</p><p>{`${error || jsonSchemaError}`}</p>@@ -108,7 +110,7 @@ const DocView: FC<any> = observer(({}) => {)if (!data || !jsonSchema || !PageState.jsonSchema)return (- <div className="p-6 mx-auto sm:w-full md:w-3/4 text-center">+ <div className="mx-auto p-6 text-center sm:w-full md:w-3/4"><Typography.Title level={3}>Building docs ...</Typography.Title></div>)@@ -130,7 +132,7 @@ const DocView: FC<any> = observer(({}) => {return (<div className="Docs h-full w-full overflow-y-auto" key={PAGE_KEY}><div className="Docs--inner-wrapper">- <div className="sticky top-0 w-full flex flex-row-reverse z-40 ">+ <div className="sticky top-0 z-40 flex w-full flex-row-reverse "><div className="bg-scale-100 dark:bg-scale-300" style={{ width: '50%' }}><div className="z-0 flex "><button@@ -138,9 +140,9 @@ const DocView: FC<any> = observer(({}) => {onClick={() => setSelectedLang('js')}className={`${selectedLang == 'js'- ? 'text-scale-1200 font-medium bg-scale-300 dark:bg-scale-200'+ ? 'text-scale-1200 bg-scale-300 dark:bg-scale-200 font-medium': 'text-scale-900 bg-scale-100 dark:bg-scale-100'- } relative inline-flex items-center p-1 px-2 border-r border-scale-200 text-sm hover:text-scale-1200 focus:outline-none transition`}+ } border-scale-200 hover:text-scale-1200 relative inline-flex items-center border-r p-1 px-2 text-sm transition focus:outline-none`}>JavaScript</button>@@ -149,22 +151,22 @@ const DocView: FC<any> = observer(({}) => {onClick={() => setSelectedLang('bash')}className={`${selectedLang == 'bash'- ? 'text-scale-1200 font-medium bg-scale-300 dark:bg-scale-200'+ ? 'text-scale-1200 bg-scale-300 dark:bg-scale-200 font-medium': 'text-scale-900 bg-scale-100 dark:bg-scale-100'- } relative inline-flex items-center p-1 px-2 border-r border-scale-200 text-sm hover:text-scale-1200 focus:outline-none transition`}+ } border-scale-200 hover:text-scale-1200 relative inline-flex items-center border-r p-1 px-2 text-sm transition focus:outline-none`}>Bash</button>{selectedLang == 'bash' && (<div className="flex">- <div className="flex items-center gap-2 text-xs text-scale-900 p-1 pl-2">+ <div className="text-scale-900 flex items-center gap-2 p-1 pl-2 text-xs"><IconKey size={12} strokeWidth={1.5} /><span>Project API key :</span></div><Dropdownalign="end"side="bottom"- className="text-sm text-scale-900 border-none cursor-pointer p-0 pl-2 pr-8 bg-transparent"+ className="text-scale-900 cursor-pointer border-none bg-transparent p-0 pl-2 pr-8 text-sm"overlay={<><Dropdown.Item onClick={() => setShowApiKey(DEFAULT_KEY)}>@@ -295,7 +297,7 @@ const RpcContent = ({return (<><h2 className="text-scale-1200 mt-0">- <span className="text-2xl px-6">{meta.id}</span>+ <span className="px-6 text-2xl">{meta.id}</span></h2><div className="doc-section">@@ -322,7 +324,7 @@ const RpcContent = ({</div>{rpcParams.length > 0 && (<div>- <h3 className="text-scale-1200 capitalize mt-0 px-6">Function Arguments</h3>+ <h3 className="text-scale-1200 mt-0 px-6 capitalize">Function Arguments</h3>{rpcParams.map((x) => {return (<div className="doc-section">@@ -373,7 +375,7 @@ const ResourceContent = ({return (<><h2 className="text-scale-1200mt-0">- <span className="text-2xl px-6 py-2">{resourceId}</span>+ <span className="px-6 py-2 text-2xl">{resourceId}</span></h2><div className="doc-section">@@ -424,7 +426,7 @@ const ResourceContent = ({)}{methods.includes('GET') && (<>- <h3 className="text-scale-1200 px-6 mt-4">Read rows</h3>+ <h3 className="text-scale-1200 mt-4 px-6">Read rows</h3><div className="doc-section"><article className="text "><p>@@ -461,7 +463,7 @@ const ResourceContent = ({</div><div className="doc-section"><article className="text ">- <h4 className="text-white mt-0">Filtering</h4>+ <h4 className="mt-0 text-white">Filtering</h4><p>Supabase provides a wide range of filters.</p><p><a href="https://supabase.com/docs/client/using-filters" target="_blank">@@ -480,7 +482,7 @@ const ResourceContent = ({)}{methods.includes('POST') && (<>- <h3 className="text-scale-1200 px-6 mt-4">Insert rows</h3>+ <h3 className="text-scale-1200 mt-4 px-6">Insert rows</h3><div className="doc-section"><article className="text "><p>@@ -515,7 +517,7 @@ const ResourceContent = ({)}{methods.includes('PATCH') && (<>- <h3 className="text-scale-1200 px-6 mt-4">Update rows</h3>+ <h3 className="text-scale-1200 mt-4 px-6">Update rows</h3><div className="doc-section"><article className="text "><p>@@ -543,7 +545,7 @@ const ResourceContent = ({)}{methods.includes('DELETE') && (<>- <h3 className="text-scale-1200 px-6 mt-4">Delete rows</h3>+ <h3 className="text-scale-1200 mt-4 px-6">Delete rows</h3><div className="doc-section"><article className="text "><p>@@ -566,7 +568,7 @@ const ResourceContent = ({</>)}<>- <h3 className="text-scale-1200 px-6 mt-4">Subscribe to changes</h3>+ <h3 className="text-scale-1200 mt-4 px-6">Subscribe to changes</h3><div className="doc-section"><article className="text "><p>@@ -609,7 +611,7 @@ const ResourceContent = ({</div></><>- <h3 className="text-scale-1200 px-6 mt-4">Much more</h3>+ <h3 className="text-scale-1200 mt-4 px-6">Much more</h3><div className="doc-section py-4"><article className="text "><p>diff --git a/studio/pages/project/[ref]/reports/[id].tsx b/studio/pages/project/[ref]/reports/[id].tsxindex 4cd951c04ac..9881271b182 100644--- a/studio/pages/project/[ref]/reports/[id].tsx+++ b/studio/pages/project/[ref]/reports/[id].tsx@@ -17,15 +17,15 @@ import {IconPlus,} from '@supabase/ui'-import { withAuth } from 'hooks'import { uuidv4 } from 'lib/helpers'import { METRICS, METRIC_CATEGORIES, TIME_PERIODS_REPORTS } from 'lib/constants'import { useProjectContentStore } from 'stores/projectContentStore'-import BaseLayout from 'components/layouts'+import { ProjectLayoutWithAuth } from 'components/layouts'import Loading from 'components/ui/Loading'import EditReportModal from 'components/to-be-cleaned/Reports/EditReportModal'import ChartHandler from 'components/to-be-cleaned/Charts/ChartHandler'import DateRangePicker from 'components/to-be-cleaned/DateRangePicker'+import { NextPageWithLayout } from 'types'const ReactGridLayout = WidthProvider(RGL)@@ -36,18 +36,20 @@ const DEFAULT_CHART_ROW_COUNT = 4/** PageLayout is used to setup layout - as usual it will requires inject global store*/-const PageLayout = () => {+const PageLayout: NextPageWithLayout = () => {return (- <BaseLayout>- <div className="max-w-7xl mx-auto w-full my-8">+ <>+ <div className="mx-auto my-8 w-full max-w-7xl"><Reports /></div><EditReportModal />- </BaseLayout>+ </>)}-export default withAuth(observer(PageLayout))+PageLayout.getLayout = (page) => <ProjectLayoutWithAuth>{page}</ProjectLayoutWithAuth>++export default observer(PageLayout)const Reports = () => {const router = useRouter()@@ -319,10 +321,10 @@ const Reports = () => {return (<div className="mx-6 flex flex-col space-y-4" style={{ maxHeight: '100%' }}>- <h1 className="text-xl text-scale-1200">Reports</h1>+ <h1 className="text-scale-1200 text-xl">Reports</h1>- <div className="flex mb-4 items-center space-x-3 justify-between">- <div className="flex space-x-3 items-center">+ <div className="mb-4 flex items-center justify-between space-x-3">+ <div className="flex items-center space-x-3">{/* @ts-ignore */}<DateRangePickeronChange={handleDateRangePicker}@@ -332,21 +334,21 @@ const Reports = () => {/>{startDate && endDate && (- <div className="hidden lg:flex space-x-1 items-center ">- <span className="text-sm text-scale-1100">+ <div className="hidden items-center space-x-1 lg:flex ">+ <span className="text-scale-1100 text-sm">{dayjs(startDate).format('MMM D, YYYY')}</span><span className="text-scale-900"><IconArrowRight size={12} /></span>- <span className="text-sm text-scale-1100">+ <span className="text-scale-1100 text-sm">{dayjs(endDate).format('MMM D, YYYY')}</span></div>)}</div>- <div className="flex space-x-2 items-center">+ <div className="flex items-center space-x-2">{hasEdits && (<div className="hidden xl:inline-block"><Badge color="green">There are unsaved changes</Badge>@@ -376,7 +378,7 @@ const Reports = () => {</div>{config.layout.length <= 0 ? (- <div className="border-2 dark:border-dark border-dashed p-16 rounded flex items-center justify-center min-h-full">+ <div className="dark:border-dark flex min-h-full items-center justify-center rounded border-2 border-dashed p-16"><Dropdown side="bottom" align="center" overlay={<MetricOptions />}><Button as="span" type="default" iconRight={<IconPlus />}>{config.layout.length <= 0 ? 'Add your first chart' : 'Add another chart'}@@ -384,7 +386,7 @@ const Reports = () => {</Dropdown></div>) : (- <div className="relative flex-grow max-w-7xl mb-16">+ <div className="relative mb-16 max-w-7xl flex-grow">{config && startDate && endDate && (// @ts-ignore<GridResize@@ -416,7 +418,7 @@ const GridResize = ({ startDate, endDate, interval, editableReport, setEditableR<divkey={x.id}data-grid={{ ...x, minH: 4, maxH: 4, minW: 8 }}- className="relative react-grid-layout__report-item bg-panel-body-light dark:bg-panel-body-dark border border-panel-border-light dark:border-panel-border-dark shadow-sm rounded px-6 py-4 hover:border-green-900 dark:hover:border-green-900 group"+ className="react-grid-layout__report-item bg-panel-body-light dark:bg-panel-body-dark border-panel-border-light dark:border-panel-border-dark group relative rounded border px-6 py-4 shadow-sm hover:border-green-900 dark:hover:border-green-900"><ChartHandlerstartDate={startDate}@@ -427,10 +429,10 @@ const GridResize = ({ startDate, endDate, interval, editableReport, setEditableRlabel={x.label}customDateFormat={'MMM D, YYYY'}/>- <div className="absolute top-3 inset-x-0 ">+ <div className="absolute inset-x-0 top-3 "><div className="flex justify-around">- <div className="w-24 h-3 space-y-2 flex flex-col cursor-move">- <div className="transition-all border-4 border-dotted border-green-900 h-3 w-full hidden opacity-50 group-hover:block hover:opacity-100"></div>+ <div className="flex h-3 w-24 cursor-move flex-col space-y-2">+ <div className="hidden h-3 w-full border-4 border-dotted border-green-900 opacity-50 transition-all hover:opacity-100 group-hover:block"></div></div></div></div>diff --git a/studio/pages/project/[ref]/reports/index.tsx b/studio/pages/project/[ref]/reports/index.tsxindex b14e23a9314..2e7599bc335 100644--- a/studio/pages/project/[ref]/reports/index.tsx+++ b/studio/pages/project/[ref]/reports/index.tsx@@ -6,14 +6,15 @@ import { API_URL } from 'lib/constants'import { useStore, withAuth } from 'hooks'import { post } from 'lib/common/fetch'import { PROJECT_STATUS } from 'lib/constants'-import BaseLayout from 'components/layouts'+import { ProjectLayoutWithAuth } from 'components/layouts'import Loading from 'components/ui/Loading'import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'import { useProjectContentStore } from 'stores/projectContentStore'import { createReport } from 'components/to-be-cleaned/Reports/Reports.utils'+import { NextPageWithLayout } from 'types'-const PageLayout = () => {+const PageLayout: NextPageWithLayout = () => {const [loading, setLoading] = useState(true)const router = useRouter()@@ -46,37 +47,37 @@ const PageLayout = () => {}, [ref])return (- <BaseLayout>- <div className="flex-grow max-w-7xl mx-auto w-full my-16 space-y-16">- {loading ? (- <Loading />- ) : (- <ProductEmptyState- title="Reports"- ctaButtonLabel="Create report"- // infoButtonLabel="About reports"- // infoButtonUrl="https://supabase.com/docs/guides/storage"- onClickCta={() => {- try {- createReport({ router })- } catch (error: any) {- ui.setNotification({- category: 'error',- message: `Failed to create report: ${error.message}`,- })- }- }}- >- <p className="text-sm text-scale-1100">Create custom reports for your projects.</p>- <p className="text-sm text-scale-1100">- Get a high level overview of your network traffic, user actions, and infrastructure- health.- </p>- </ProductEmptyState>- )}- </div>- </BaseLayout>+ <div className="mx-auto my-16 w-full max-w-7xl flex-grow space-y-16">+ {loading ? (+ <Loading />+ ) : (+ <ProductEmptyState+ title="Reports"+ ctaButtonLabel="Create report"+ // infoButtonLabel="About reports"+ // infoButtonUrl="https://supabase.com/docs/guides/storage"+ onClickCta={() => {+ try {+ createReport({ router })+ } catch (error: any) {+ ui.setNotification({+ category: 'error',+ message: `Failed to create report: ${error.message}`,+ })+ }+ }}+ >+ <p className="text-scale-1100 text-sm">Create custom reports for your projects.</p>+ <p className="text-scale-1100 text-sm">+ Get a high level overview of your network traffic, user actions, and infrastructure+ health.+ </p>+ </ProductEmptyState>+ )}+ </div>)}-export default withAuth(observer(PageLayout))+PageLayout.getLayout = (page) => <ProjectLayoutWithAuth>{page}</ProjectLayoutWithAuth>++export default observer(PageLayout)diff --git a/studio/pages/project/[ref]/settings/api.tsx b/studio/pages/project/[ref]/settings/api.tsxindex 9ddfa532ba8..8e150e926b0 100644--- a/studio/pages/project/[ref]/settings/api.tsx+++ b/studio/pages/project/[ref]/settings/api.tsx@@ -36,7 +36,7 @@ import {import { API_URL } from 'lib/constants'import { uuidv4 } from 'lib/helpers'import { patch, get } from 'lib/common/fetch'-import { useStore, useJwtSecretUpdateStatus, withAuth } from 'hooks'+import { useStore, useJwtSecretUpdateStatus } from 'hooks'import { SettingsLayout } from 'components/layouts'import Flag from 'components/ui/Flag/Flag'@@ -46,6 +46,7 @@ import Panel from 'components/to-be-cleaned/Panel'import MultiSelectUI from 'components/to-be-cleaned/MultiSelect'import SchemaFormPanel from 'components/to-be-cleaned/forms/SchemaFormPanel'import { DisplayApiSettings } from 'components/ui/ProjectSettings'+import { NextPageWithLayout } from 'types'const JWT_SECRET_UPDATE_ERROR_MESSAGES = {[JwtSecretUpdateError.APIServicesConfigurationUpdateFailed]:@@ -71,7 +72,7 @@ const JWT_SECRET_UPDATE_PROGRESS_MESSAGES = {const PageContext: any = createContext(null)-const ApiSettings = () => {+const ApiSettings: NextPageWithLayout = () => {const router = useRouter()const { ref } = router.query@@ -99,17 +100,17 @@ const ApiSettings = () => {}return (- <SettingsLayout title="API Settings">- <PageContext.Provider value={PageState}>- <div className="content w-full h-full overflow-y-auto">- <ServiceList projectRef={ref} />- </div>- </PageContext.Provider>- </SettingsLayout>+ <PageContext.Provider value={PageState}>+ <div className="content h-full w-full overflow-y-auto">+ <ServiceList projectRef={ref} />+ </div>+ </PageContext.Provider>)}-export default withAuth(observer(ApiSettings))+ApiSettings.getLayout = (page) => <SettingsLayout title="API Settings">{page}</SettingsLayout>++export default observer(ApiSettings)const ServiceList: FC<any> = ({ projectRef }) => {const { ui } = useStore()@@ -176,14 +177,14 @@ const ServiceList: FC<any> = ({ projectRef }) => {if (error || isJwtSecretUpdateStatusError) {return (- <div className="p-6 mx-auto sm:w-full md:w-3/4 text-center">+ <div className="mx-auto p-6 text-center sm:w-full md:w-3/4"><Typography.Title level={3}>Error loading API settings</Typography.Title></div>)}if (!data || isJwtSecretUpdateStatusLoading) {return (- <div className="p-6 mx-auto sm:w-full md:w-3/4 text-center">+ <div className="mx-auto p-6 text-center sm:w-full md:w-3/4"><Typography.Title level={3}>Loading...</Typography.Title></div>)@@ -224,7 +225,7 @@ const ServiceList: FC<any> = ({ projectRef }) => {return (<>- <article className="p-4 max-w-4xl">+ <article className="max-w-4xl p-4"><DisplayApiSettings key="DisplayAPISettings" /><section><Panel@@ -246,7 +247,7 @@ const ServiceList: FC<any> = ({ projectRef }) => {layout="horizontal"/></Panel.Content>- <Panel.Content className="border-t border-panel-border-interior-light dark:border-panel-border-interior-dark space-y-6">+ <Panel.Content className="border-panel-border-interior-light dark:border-panel-border-interior-dark space-y-6 border-t"><Inputlabel="JWT Secret"readOnly@@ -257,8 +258,8 @@ const ServiceList: FC<any> = ({ projectRef }) => {isJwtSecretUpdateFailed? 'JWT secret update failed': isUpdatingJwtSecret- ? 'Updating JWT secret...'- : config?.jwt_secret || ''+ ? 'Updating JWT secret...'+ : config?.jwt_secret || ''}className="input-mono"descriptionText={@@ -268,7 +269,7 @@ const ServiceList: FC<any> = ({ projectRef }) => {/><Flag name="jwtSecretUpdate"><div className="space-y-3">- <div className="p-3 px-6 dark:bg-bg-alt-dark bg-bg-alt-light rounded-md shadow-sm border dark:border-dark">+ <div className="dark:bg-bg-alt-dark bg-bg-alt-light dark:border-dark rounded-md border p-3 px-6 shadow-sm">{isUpdatingJwtSecret ? (<div className="flex items-center space-x-2"><IconLoader className="animate-spin" size={14} />@@ -278,10 +279,10 @@ const ServiceList: FC<any> = ({ projectRef }) => {</div>) : (<div className="w-full space-y-2">- <div className="w-full flex items-center justify-between">+ <div className="flex w-full items-center justify-between"><div className="flex flex-col space-y-1"><Typography.Text>Generate a new JWT secret</Typography.Text>- <p className="opacity-50 text-sm">+ <p className="text-sm opacity-50">A random secret will be created, or you can create your own.</p></div>@@ -383,8 +384,8 @@ const ServiceList: FC<any> = ({ projectRef }) => {}><Modal.Content>- <div className="py-4 space-y-2">- <p className="text-sm text-scale-1100">+ <div className="space-y-2 py-4">+ <p className="text-scale-1100 text-sm">Create a custom JWT secret. Make sure it is a strong combination of characters thatcannot be guessed easily.</p>diff --git a/studio/pages/project/[ref]/settings/billing/index.tsx b/studio/pages/project/[ref]/settings/billing/index.tsxindex 7239867bb1a..f16c06a0b28 100644--- a/studio/pages/project/[ref]/settings/billing/index.tsx+++ b/studio/pages/project/[ref]/settings/billing/index.tsx@@ -3,7 +3,7 @@ import { FC, useEffect, useState } from 'react'import { observer } from 'mobx-react-lite'import { Typography, Loading, IconArrowRight } from '@supabase/ui'-import { useProjectPaygStatistics, useProjectSubscription, useStore, withAuth } from 'hooks'+import { useProjectPaygStatistics, useProjectSubscription, useStore } from 'hooks'import { STRIPE_PRODUCT_IDS, TIME_PERIODS_REPORTS, TIME_PERIODS_BILLING } from 'lib/constants'import { SettingsLayout } from 'components/layouts'import LoadingUI from 'components/ui/Loading'@@ -12,24 +12,27 @@ import { PAYGUsage, Subscription, Invoices } from 'components/interfaces/Billingimport ProjectUsage from 'components/to-be-cleaned/Usage'import DateRangePicker from 'components/to-be-cleaned/DateRangePicker'import { PaygStats } from 'components/interfaces/Billing/PAYGUsage/PAYGUsage.types'+import { NextPageWithLayout } from 'types'type ProjectBillingProps = {} & any-const ProjectBilling: FC<ProjectBillingProps> = ({ store }) => {+const ProjectBilling: NextPageWithLayout = ({ store }: ProjectBillingProps) => {const { ui } = useStore()const project = ui.selectedProjectreturn (- <SettingsLayout title="Billing and Usage">- <div className="content w-full h-full overflow-y-auto">- <div className="mx-auto w-full">- <Settings project={project} />- </div>+ <div className="content h-full w-full overflow-y-auto">+ <div className="mx-auto w-full">+ <Settings project={project} /></div>- </SettingsLayout>+ </div>)}-export default withAuth(observer(ProjectBilling))+ProjectBilling.getLayout = (page) => (+ <SettingsLayout title="Billing and Usage">{page}</SettingsLayout>+)++export default observer(ProjectBilling)type SettingsProps = {project: any@@ -64,7 +67,7 @@ const Settings: FC<SettingsProps> = ({ project }) => {}return (- <div className="p-4 container max-w-4xl space-y-8">+ <div className="container max-w-4xl space-y-8 p-4"><Subscriptionloading={loading}project={project}@@ -75,15 +78,15 @@ const Settings: FC<SettingsProps> = ({ project }) => {/>{loading ? (<Loading active={loading}>- <div className="w-full rounded overflow-hidden border border-panel-border-light dark:border-panel-border-dark mb-8">- <div className="px-6 py-6 bg-panel-body-light dark:bg-panel-body-dark flex items-center justify-center">+ <div className="border-panel-border-light dark:border-panel-border-dark mb-8 w-full overflow-hidden rounded border">+ <div className="bg-panel-body-light dark:bg-panel-body-dark flex items-center justify-center px-6 py-6"><Typography.Text>Loading usage breakdown</Typography.Text></div></div></Loading>) : subscription?.tier?.prod_id === STRIPE_PRODUCT_IDS.PAYG ? (<div>- <div className="flex space-x-3 items-center mb-4">+ <div className="mb-4 flex items-center space-x-3"><DateRangePickeronChange={setDateRange}value={TIME_PERIODS_BILLING[0].key}@@ -92,7 +95,7 @@ const Settings: FC<SettingsProps> = ({ project }) => {currentBillingPeriodStart={subscription?.billing.current_period_start}/>{dateRange && (- <div className="flex space-x-2 items-center">+ <div className="flex items-center space-x-2"><Typography.Text type="secondary">{dayjs(dateRange.period_start.date).format('MMM D, YYYY')}</Typography.Text>diff --git a/studio/pages/project/[ref]/settings/billing/update/enterprise.tsx b/studio/pages/project/[ref]/settings/billing/update/enterprise.tsxindex 53b15beff8e..7baae518d76 100644--- a/studio/pages/project/[ref]/settings/billing/update/enterprise.tsx+++ b/studio/pages/project/[ref]/settings/billing/update/enterprise.tsx@@ -1,26 +1,26 @@-import { NextPage } from 'next'import { observer } from 'mobx-react-lite'import { useRouter } from 'next/router'-import { withAuth, useStore } from 'hooks'+import { useStore } from 'hooks'import { BillingLayout } from 'components/layouts'import { EnterpriseRequest } from 'components/interfaces/Billing'+import { NextPageWithLayout } from 'types'-const BillingUpdateEnterprise: NextPage = () => {+const BillingUpdateEnterprise: NextPageWithLayout = () => {const { ui } = useStore()const router = useRouter()const projectRef = ui.selectedProject?.refreturn (- <BillingLayout>- <div className="mx-auto max-w-5xl my-10">- <EnterpriseRequest- onSelectBack={() => router.push(`/project/${projectRef}/settings/billing/update`)}- />- </div>- </BillingLayout>+ <div className="mx-auto my-10 max-w-5xl">+ <EnterpriseRequest+ onSelectBack={() => router.push(`/project/${projectRef}/settings/billing/update`)}+ />+ </div>)}-export default withAuth(observer(BillingUpdateEnterprise))+BillingUpdateEnterprise.getLayout = (page) => <BillingLayout>{page}</BillingLayout>++export default observer(BillingUpdateEnterprise)diff --git a/studio/pages/project/[ref]/settings/billing/update/free.tsx b/studio/pages/project/[ref]/settings/billing/update/free.tsxindex 360560af34c..a92446b703f 100644--- a/studio/pages/project/[ref]/settings/billing/update/free.tsx+++ b/studio/pages/project/[ref]/settings/billing/update/free.tsx@@ -1,16 +1,16 @@import { useState, useEffect } from 'react'-import { NextPage } from 'next'import { observer } from 'mobx-react-lite'import { useRouter } from 'next/router'-import { withAuth, useStore } from 'hooks'+import { useStore } from 'hooks'import { get } from 'lib/common/fetch'import { API_URL, STRIPE_PRODUCT_IDS } from 'lib/constants'import { BillingLayout } from 'components/layouts'import { ExitSurvey, StripeSubscription } from 'components/interfaces/Billing'+import { NextPageWithLayout } from 'types'-const BillingUpdateFree: NextPage = () => {+const BillingUpdateFree: NextPageWithLayout = () => {const { ui } = useStore()const router = useRouter()const projectRef = ui.selectedProject?.ref@@ -62,16 +62,16 @@ const BillingUpdateFree: NextPage = () => {const freeTier = products?.tiers.find((tier: any) => tier.id === STRIPE_PRODUCT_IDS.FREE)return (- <BillingLayout>- <div className="mx-auto max-w-5xl my-10">- <ExitSurvey- freeTier={freeTier}- subscription={subscription}- onSelectBack={() => router.push(`/project/${projectRef}/settings/billing/update`)}- />- </div>- </BillingLayout>+ <div className="mx-auto my-10 max-w-5xl">+ <ExitSurvey+ freeTier={freeTier}+ subscription={subscription}+ onSelectBack={() => router.push(`/project/${projectRef}/settings/billing/update`)}+ />+ </div>)}-export default withAuth(observer(BillingUpdateFree))+BillingUpdateFree.getLayout = (page) => <BillingLayout>{page}</BillingLayout>++export default observer(BillingUpdateFree)diff --git a/studio/pages/project/[ref]/settings/billing/update/index.tsx b/studio/pages/project/[ref]/settings/billing/update/index.tsxindex 0251e7c1081..bfadbe4b155 100644--- a/studio/pages/project/[ref]/settings/billing/update/index.tsx+++ b/studio/pages/project/[ref]/settings/billing/update/index.tsx@@ -1,10 +1,9 @@-import { NextPage } from 'next'import { useEffect, useState } from 'react'import { useRouter } from 'next/router'import { observer } from 'mobx-react-lite'import { Button, Modal } from '@supabase/ui'-import { withAuth, useStore, useSubscriptionStats } from 'hooks'+import { useStore, useSubscriptionStats } from 'hooks'import { get } from 'lib/common/fetch'import { API_URL, DEFAULT_FREE_PROJECTS_LIMIT, STRIPE_PRODUCT_IDS } from 'lib/constants'@@ -12,8 +11,9 @@ import { BillingLayout } from 'components/layouts'import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'import { PlanSelection, StripeSubscription } from 'components/interfaces/Billing'import Connecting from 'components/ui/Loading/Loading'+import { NextPageWithLayout } from 'types'-const BillingUpdate: NextPage = () => {+const BillingUpdate: NextPageWithLayout = () => {const { ui } = useStore()const router = useRouter()const projectRef = ui.selectedProject?.ref@@ -98,15 +98,15 @@ const BillingUpdate: NextPage = () => {if (isLoadingProducts) {return (- <div className="w-full h-full flex items-center justify-center">+ <div className="flex h-full w-full items-center justify-center"><Connecting /></div>)}return (- <BillingLayout>- <div className="mx-auto max-w-6xl my-10 px-6">+ <>+ <div className="mx-auto my-10 max-w-6xl px-6"><PlanSelectionvisible={!selectedPlan || (selectedPlan && showConfirmDowngrade)}tiers={products?.tiers ?? []}@@ -137,9 +137,9 @@ const BillingUpdate: NextPage = () => {header="Free tier limit exceeded"onCancel={() => setShowDowngradeError(false)}>- <div className="py-4 space-y-4">+ <div className="space-y-4 py-4"><Modal.Content>- <p className="text-sm text-scale-1100">+ <p className="text-scale-1100 text-sm">Your account is entitled up to {freeProjectsLimit} free projects across allorganizations you own. You will need to delete or upgrade an existing free projectfirst, before being able to downgrade this project.@@ -160,8 +160,10 @@ const BillingUpdate: NextPage = () => {</Modal.Content></div></Modal>- </BillingLayout>+ </>)}-export default withAuth(observer(BillingUpdate))+BillingUpdate.getLayout = (page) => <BillingLayout>{page}</BillingLayout>++export default observer(BillingUpdate)diff --git a/studio/pages/project/[ref]/settings/billing/update/pro.tsx b/studio/pages/project/[ref]/settings/billing/update/pro.tsxindex 9ff03dafda0..34beb43cd76 100644--- a/studio/pages/project/[ref]/settings/billing/update/pro.tsx+++ b/studio/pages/project/[ref]/settings/billing/update/pro.tsx@@ -1,9 +1,8 @@import { useState, useEffect } from 'react'-import { NextPage } from 'next'import { observer } from 'mobx-react-lite'import { useRouter } from 'next/router'-import { withAuth, useStore } from 'hooks'+import { useStore } from 'hooks'import { get } from 'lib/common/fetch'import { API_URL } from 'lib/constants'@@ -11,8 +10,9 @@ import { BillingLayout } from 'components/layouts'import Connecting from 'components/ui/Loading/Loading'import { StripeSubscription } from 'components/interfaces/Billing'import { ProUpgrade } from 'components/interfaces/Billing'+import { NextPageWithLayout } from 'types'-const BillingUpdatePro: NextPage = () => {+const BillingUpdatePro: NextPageWithLayout = () => {const { ui } = useStore()const router = useRouter()@@ -101,16 +101,16 @@ const BillingUpdatePro: NextPage = () => {if (!products || !subscription) return <Connecting />return (- <BillingLayout>- <ProUpgrade- products={products}- currentSubscription={subscription}- isLoadingPaymentMethods={isLoadingPaymentMethods}- paymentMethods={paymentMethods || []}- onSelectBack={() => router.push(`/project/${projectRef}/settings/billing/update`)}- />- </BillingLayout>+ <ProUpgrade+ products={products}+ currentSubscription={subscription}+ isLoadingPaymentMethods={isLoadingPaymentMethods}+ paymentMethods={paymentMethods || []}+ onSelectBack={() => router.push(`/project/${projectRef}/settings/billing/update`)}+ />)}-export default withAuth(observer(BillingUpdatePro))+BillingUpdatePro.getLayout = (page) => <BillingLayout>{page}</BillingLayout>++export default observer(BillingUpdatePro)diff --git a/studio/pages/project/[ref]/settings/database.tsx b/studio/pages/project/[ref]/settings/database.tsxindex 52e6c064560..b405c4ed338 100644--- a/studio/pages/project/[ref]/settings/database.tsx+++ b/studio/pages/project/[ref]/settings/database.tsx@@ -10,7 +10,7 @@ import { useRouter } from 'next/router'import { debounce } from 'lodash'import { Typography, Input, Button, IconDownload, IconArrowRight, Tabs, Modal } from '@supabase/ui'-import { useStore, withAuth } from 'hooks'+import { useStore } from 'hooks'import { get, patch } from 'lib/common/fetch'import { pluckObjectFields, passwordStrength } from 'lib/helpers'import { API_URL, DEFAULT_MINIMUM_PASSWORD_STRENGTH, TIME_PERIODS_INFRA } from 'lib/constants'@@ -21,12 +21,13 @@ import Panel from 'components/to-be-cleaned/Panel'import { ProjectUsageMinimal } from 'components/to-be-cleaned/Usage'import DateRangePicker from 'components/to-be-cleaned/DateRangePicker'import ChartHandler from 'components/to-be-cleaned/Charts/ChartHandler'+import { NextPageWithLayout } from 'types'dayjs.extend(customParseFormat)dayjs.extend(timezone)dayjs.extend(utc)-const ProjectSettings = () => {+const ProjectSettings: NextPageWithLayout = () => {const router = useRouter()const { ref } = router.query@@ -34,18 +35,18 @@ const ProjectSettings = () => {const project = ui.selectedProjectreturn (- <SettingsLayout title="Database">- <div className="content w-full h-full overflow-y-auto">- <div className="w-full px-4 py-4 max-w-5xl">- <Usage project={project} />- <GeneralSettings projectRef={ref} />- </div>+ <div className="content h-full w-full overflow-y-auto">+ <div className="w-full max-w-5xl px-4 py-4">+ <Usage project={project} />+ <GeneralSettings projectRef={ref} /></div>- </SettingsLayout>+ </div>)}-export default withAuth(observer(ProjectSettings))+ProjectSettings.getLayout = (page) => <SettingsLayout title="Database">{page}</SettingsLayout>++export default observer(ProjectSettings)const Usage: FC<any> = ({ project }) => {const [dateRange, setDateRange] = useState<any>(undefined)@@ -64,7 +65,7 @@ const Usage: FC<any> = ({ project }) => {}><Panel.Content>- <div className="flex space-x-3 items-center mb-4">+ <div className="mb-4 flex items-center space-x-3"><DateRangePickerloading={false}value={'3h'}@@ -73,7 +74,7 @@ const Usage: FC<any> = ({ project }) => {onChange={setDateRange}/>{dateRange && (- <div className="flex space-x-2 items-center">+ <div className="flex items-center space-x-2"><Typography.Text type="secondary">{dayjs(dateRange.period_start.date).format('MMMM D, hh:mma')}</Typography.Text>@@ -207,11 +208,11 @@ const ResetDbPassword: FC<any> = () => {<><Panel><Panel.Content>- <div className="grid grid-cols-1 lg:grid-cols-2 items-center">+ <div className="grid grid-cols-1 items-center lg:grid-cols-2"><div><Typography.Text className="block">Database password</Typography.Text><div style={{ maxWidth: '420px' }}>- <p className="opacity-50 text-sm">+ <p className="text-sm opacity-50">You can use this password to connect directly to your Postgres database.</p></div>@@ -234,7 +235,7 @@ const ResetDbPassword: FC<any> = () => {onCancel={() => setShowResetDbPass(false)}onConfirm={() => confirmResetDbPass()}>- <div className="w-full space-y-8 mb-8">+ <div className="mb-8 w-full space-y-8"><Inputtype="password"onChange={onDbPassChange}@@ -261,11 +262,11 @@ const DownloadCertificate: FC<any> = ({ createdAt }) => {return (<Panel><Panel.Content>- <div className="grid grid-cols-1 lg:grid-cols-2 items-center">+ <div className="grid grid-cols-1 items-center lg:grid-cols-2"><div><Typography.Text className="block">SSL Connection</Typography.Text><div style={{ maxWidth: '420px' }}>- <p className="opacity-50 text-sm">+ <p className="text-sm opacity-50">Use this cert when connecting to your database to prevent snooping andman-in-the-middle attacks.</p>@@ -291,7 +292,7 @@ const GeneralSettings: FC<any> = ({ projectRef }) => {if (data?.error || error) {return (- <div className="p-6 mx-auto sm:w-full md:w-3/4 text-center">+ <div className="mx-auto p-6 text-center sm:w-full md:w-3/4"><Typography.Title level={3}>Error loading database settings</Typography.Title></div>)@@ -299,7 +300,7 @@ const GeneralSettings: FC<any> = ({ projectRef }) => {if (!data) {return (- <div className="p-6 mx-auto sm:w-full md:w-3/4 text-center">+ <div className="mx-auto p-6 text-center sm:w-full md:w-3/4"><Typography.Title level={3}>Loading...</Typography.Title></div>)@@ -326,7 +327,7 @@ const GeneralSettings: FC<any> = ({ projectRef }) => {return (<><div className="">- <section className="space-y-6 mt-6">+ <section className="mt-6 space-y-6"><Paneltitle={[<Typography.Title key="panel-title" level={5} className="mb-0">@@ -368,7 +369,7 @@ const GeneralSettings: FC<any> = ({ projectRef }) => {<Inputlayout="horizontal"- className="input-mono text-base table-input-cell"+ className="input-mono table-input-cell text-base"readOnlycopydisabled@@ -391,7 +392,7 @@ const GeneralSettings: FC<any> = ({ projectRef }) => {<DownloadCertificate createdAt={connectionInfo.inserted_at} /></div><div>- <section className="space-y-6 mt-6">+ <section className="mt-6 space-y-6"><Paneltitle={<Typography.Title key="panel-title" level={5} className="mb-0">diff --git a/studio/pages/project/[ref]/settings/general.tsx b/studio/pages/project/[ref]/settings/general.tsxindex c6f4978d7d0..86adf4d7536 100644--- a/studio/pages/project/[ref]/settings/general.tsx+++ b/studio/pages/project/[ref]/settings/general.tsx@@ -9,26 +9,27 @@ import { Alert, Button, Input, IconRefreshCcw } from '@supabase/ui'import { API_URL } from 'lib/constants'import { pluckJsonSchemaFields, pluckObjectFields } from 'lib/helpers'import { post, delete_ } from 'lib/common/fetch'-import { useStore, withAuth } from 'hooks'+import { useStore } from 'hooks'import { SettingsLayout } from 'components/layouts'import Panel from 'components/to-be-cleaned/Panel'import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'import SchemaFormPanel from 'components/to-be-cleaned/forms/SchemaFormPanel'import TextConfirmModal from 'components/to-be-cleaned/ModalsDeprecated/TextConfirmModal'+import { NextPageWithLayout } from 'types'-const ProjectSettings = () => {+const ProjectSettings: NextPageWithLayout = () => {return (- <SettingsLayout title="General">- <div className="content w-full h-full overflow-y-auto">- <div className="mx-auto w-full">- <GeneralSettings />- </div>+ <div className="content h-full w-full overflow-y-auto">+ <div className="mx-auto w-full">+ <GeneralSettings /></div>- </SettingsLayout>+ </div>)}-export default withAuth(observer(ProjectSettings))+ProjectSettings.getLayout = (page) => <SettingsLayout title="General">{page}</SettingsLayout>++export default observer(ProjectSettings)interface RestartServerButtonProps {projectId: number@@ -97,7 +98,7 @@ const GeneralSettings = observer(() => {}return (- <article className="p-4 max-w-4xl">+ <article className="max-w-4xl p-4"><section><SchemaFormPaneltitle="General"@@ -112,7 +113,7 @@ const GeneralSettings = observer(() => {<section><Paneltitle={- <h5 key="panel-title" className="text-base mb-0">+ <h5 key="panel-title" className="mb-0 text-base">Infrastructure</h5>}@@ -126,15 +127,15 @@ const GeneralSettings = observer(() => {layout="horizontal"/></Panel.Content>- <Panel.Content className="border-t border-panel-border-interior-light dark:border-panel-border-interior-dark">+ <Panel.Content className="border-panel-border-interior-light dark:border-panel-border-interior-dark border-t"><Input readOnly disabled value={project?.region} label="Region" layout="horizontal" /></Panel.Content>- <Panel.Content className="border-t border-panel-border-interior-light dark:border-panel-border-interior-dark">- <div className="w-full flex items-center justify-between">+ <Panel.Content className="border-panel-border-interior-light dark:border-panel-border-interior-dark border-t">+ <div className="flex w-full items-center justify-between"><div><p>Restart server</p><div style={{ maxWidth: '420px' }}>- <p className="opacity-50 text-sm">+ <p className="text-sm opacity-50">Your project will not be available for a few minutes.</p></div>@@ -154,7 +155,7 @@ const GeneralSettings = observer(() => {title="Deleting this project will also remove your database."><div className="flex flex-col">- <p className="block mb-4">+ <p className="mb-4 block">Make sure you have made a backup if you want to keep your data.</p><ProjectDeleteModal project={project} />diff --git a/studio/pages/project/[ref]/settings/index.tsx b/studio/pages/project/[ref]/settings/index.tsxindex d264a9f1a7b..de9d7c708d1 100644--- a/studio/pages/project/[ref]/settings/index.tsx+++ b/studio/pages/project/[ref]/settings/index.tsx@@ -1,15 +1,12 @@-import { NextPage } from 'next'import { observer } from 'mobx-react-lite'-import { withAuth } from 'hooks'import { SettingsLayout } from 'components/layouts'+import { NextPageWithLayout } from 'types'-const Settings: NextPage = () => {- return (- <SettingsLayout>- <>{/* <h1>Use this as a page template for settings pages</h1> */}</>- </SettingsLayout>- )+const Settings: NextPageWithLayout = () => {+ return <>{/* <h1>Use this as a page template for settings pages</h1> */}</>}-export default withAuth(observer(Settings))+Settings.getLayout = (page) => <SettingsLayout>{page}</SettingsLayout>++export default observer(Settings)