Skip to content

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

Improve custom domains UI + shift to general settings

Joshen Lim8830f75b756e
diff --git a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainActivate.tsx b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainActivate.tsx
index fb282d0e9ed..ddac4535323 100644
--- a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainActivate.tsx
+++ b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainActivate.tsx
@@ -1,10 +1,14 @@
-import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'
+import Link from 'next/link'
+import { useState } from 'react'
+import { observer } from 'mobx-react-lite'
+import { Button, IconExternalLink } from 'ui'
+
+import { useStore } from 'hooks'
+import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation'
import { useCustomDomainActivateMutation } from 'data/custom-domains/custom-domains-activate-mutation'
import { CustomDomainResponse } from 'data/custom-domains/custom-domains-query'
-import { useStore } from 'hooks'
-import { observer } from 'mobx-react-lite'
-import { useState } from 'react'
-import { Button } from 'ui'
+import Panel from 'components/ui/Panel'
+import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'
export type CustomDomainActivateProps = {
projectRef?: string
@@ -17,6 +21,7 @@ const CustomDomainActivate = ({ projectRef, customDomain }: CustomDomainActivate
const [isActivateConfirmModalVisible, setIsActivateConfirmModalVisible] = useState(false)
const { mutateAsync: activateCustomDomain } = useCustomDomainActivateMutation()
+ const { mutateAsync: deleteCustomDomain, isLoading: isDeleting } = useCustomDomainDeleteMutation()
const onActivateCustomDomain = async () => {
if (!projectRef) {
@@ -40,43 +45,79 @@ const CustomDomainActivate = ({ projectRef, customDomain }: CustomDomainActivate
}
}
+ const onCancelCustomDomain = async () => {
+ if (!projectRef) {
+ throw new Error('Project ref is required')
+ }
+ try {
+ await deleteCustomDomain({ projectRef })
+ } catch (error: any) {
+ ui.setNotification({ category: 'error', message: error.message })
+ }
+ }
+
return (
<>
- <div className="flex flex-col items-start gap-6">
- <div className="flex flex-col gap-2">
- <h4 className="text-scale-1200">
- Setup complete! Press activate to enable the custom domain{' '}
- <code className="text-sm">{customDomain.hostname}</code> for this project.
- </h4>
- <span className="text-sm text-scale-1100">
- We recommend that you schedule a downtime window of 20 - 30 minutes for your
- application, as you will need to update any services that need to know about your custom
- domain (e.g client side code or OAuth providers)
- </span>
- </div>
+ <div className="flex flex-col items-start">
+ <Panel.Content>
+ <div className="flex flex-col gap-2">
+ <h4 className="text-scale-1200">
+ Setup complete! Press activate to enable the custom domain{' '}
+ <code className="text-sm">{customDomain.hostname}</code> for this project.
+ </h4>
+ <span className="text-sm text-scale-1100">
+ We recommend that you schedule a downtime window of 20 - 30 minutes for your
+ application, as you will need to update any services that need to know about your
+ custom domain (e.g client side code or OAuth providers)
+ </span>
+ </div>
+ </Panel.Content>
- <Button
- icon={
- <svg
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 24 24"
- strokeWidth={1}
- stroke="currentColor"
- className="w-4 h-4"
- >
- <path
- strokeLinecap="round"
- strokeLinejoin="round"
- d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"
- />
- </svg>
- }
- onClick={() => setIsActivateConfirmModalVisible(true)}
- className="self-end"
- >
- Activate
- </Button>
+ <div className="w-full border-t border-scale-400" />
+
+ <Panel.Content className="w-full">
+ <div className="flex items-center justify-between">
+ <Link href="https://supabase.com/docs/guides/platform/custom-domains">
+ <a target="_blank">
+ <Button type="default" icon={<IconExternalLink />}>
+ Documentation
+ </Button>
+ </a>
+ </Link>
+ <div className="flex items-center space-x-2">
+ <Button
+ type="default"
+ onClick={onCancelCustomDomain}
+ loading={isDeleting}
+ className="self-end"
+ >
+ Cancel
+ </Button>
+ <Button
+ icon={
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ strokeWidth={1}
+ stroke="currentColor"
+ className="w-4 h-4"
+ >
+ <path
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"
+ />
+ </svg>
+ }
+ onClick={() => setIsActivateConfirmModalVisible(true)}
+ className="self-end"
+ >
+ Activate
+ </Button>
+ </div>
+ </div>
+ </Panel.Content>
</div>
<ConfirmModal
diff --git a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainConfig.tsx b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainConfig.tsx
index 438178f8964..fbaa6eefcb2 100644
--- a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainConfig.tsx
+++ b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainConfig.tsx
@@ -1,18 +1,18 @@
-import { observer } from 'mobx-react-lite'
import Link from 'next/link'
-import { useState } from 'react'
+import { observer } from 'mobx-react-lite'
import { Button, IconAlertCircle, IconExternalLink } from 'ui'
import { useParams } from 'hooks'
-import Panel from 'components/ui/Panel'
-import UpgradeToPro from 'components/ui/UpgradeToPro'
import { useProjectSettingsQuery } from 'data/config/project-settings-query'
import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'
-import CustomDomainActivate from './CustomDomainActivate'
+import Panel from 'components/ui/Panel'
+import { FormHeader } from 'components/ui/Forms'
+import UpgradeToPro from 'components/ui/UpgradeToPro'
import CustomDomainDelete from './CustomDomainDelete'
+import CustomDomainVerify from './CustomDomainVerify'
+import CustomDomainActivate from './CustomDomainActivate'
import CustomDomainsConfigureHostname from './CustomDomainsConfigureHostname'
import CustomDomainsShimmerLoader from './CustomDomainsShimmerLoader'
-import CustomDomainVerify from './CustomDomainVerify'
const CustomDomainConfig = () => {
const { ref } = useParams()
@@ -49,46 +49,47 @@ const CustomDomainConfig = () => {
const isUnknownError = isError && !isNoHostnameConfiguredError && !isNotAllowedError
- if (isNoHostnameConfiguredError) {
- return (
- <CustomDomainsConfigureHostname
- projectRef={ref}
- title={CUSTOM_DOMAINS_TITLE}
- settings={settings}
- />
- )
- }
-
return (
- <>
- <Panel title={CUSTOM_DOMAINS_TITLE}>
- <Panel.Content className="space-y-6">
- {isLoading && <CustomDomainsShimmerLoader />}
+ <div>
+ <FormHeader title="Custom Domains" description="" />
+ {isNoHostnameConfiguredError ? (
+ <CustomDomainsConfigureHostname projectRef={ref} settings={settings} />
+ ) : (
+ <Panel>
+ {isLoading && (
+ <Panel.Content className="space-y-6">
+ <CustomDomainsShimmerLoader />
+ </Panel.Content>
+ )}
{isNotAllowedError && (
- <UpgradeToPro
- icon={<IconAlertCircle size={18} strokeWidth={1.5} />}
- primaryText="Custom domains are a Pro plan add-on"
- projectRef={ref as string}
- secondaryText="To configure a custom domain for your project, please upgrade to a Pro plan"
- />
+ <Panel.Content className="space-y-6">
+ <UpgradeToPro
+ icon={<IconAlertCircle size={18} strokeWidth={1.5} />}
+ primaryText="Custom domains are a Pro plan add-on"
+ projectRef={ref as string}
+ secondaryText="To configure a custom domain for your project, please upgrade to a Pro plan"
+ />
+ </Panel.Content>
)}
{isUnknownError && (
- <div className="flex items-center justify-center space-x-2 py-8">
- <IconAlertCircle size={16} strokeWidth={1.5} />
- <p className="text-sm text-scale-1100">
- Failed to retrieve custom domain configuration. Please try again later or{' '}
- <Link href={`/support/new?ref=${ref}&category=sales`}>
- <a className="underline">contact support</a>
- </Link>
- .
- </p>
- </div>
+ <Panel.Content className="space-y-6">
+ <div className="flex items-center justify-center space-x-2 py-8">
+ <IconAlertCircle size={16} strokeWidth={1.5} />
+ <p className="text-sm text-scale-1100">
+ Failed to retrieve custom domain configuration. Please try again later or{' '}
+ <Link href={`/support/new?ref=${ref}&category=sales`}>
+ <a className="underline">contact support</a>
+ </Link>
+ .
+ </p>
+ </div>
+ </Panel.Content>
)}
{isSuccess && (
- <div className="flex flex-col gap-4">
+ <div className="flex flex-col">
{(data.status === '2_initiated' || data.status === '3_challenge_verified') && (
<CustomDomainVerify
projectRef={ref}
@@ -106,24 +107,10 @@ const CustomDomainConfig = () => {
)}
</div>
)}
- </Panel.Content>
- </Panel>
- </>
+ </Panel>
+ )}
+ </div>
)
}
export default observer(CustomDomainConfig)
-
-const CUSTOM_DOMAINS_TITLE = (
- <div className="flex-1 flex items-center justify-between">
- <h5 className="mb-0">Custom Domain</h5>
-
- <Link href="https://supabase.com/docs/guides/platform/custom-domains">
- <a target="_blank">
- <Button type="default" icon={<IconExternalLink />}>
- Documentation
- </Button>
- </a>
- </Link>
- </div>
-)
diff --git a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainDelete.tsx b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainDelete.tsx
index 917a48e9a58..bacebf659b4 100644
--- a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainDelete.tsx
+++ b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainDelete.tsx
@@ -1,10 +1,13 @@
-import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'
+import Link from 'next/link'
+import { useState } from 'react'
+import { observer } from 'mobx-react-lite'
+import { Button, IconExternalLink, IconTrash } from 'ui'
+
+import { useStore } from 'hooks'
import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation'
import { CustomDomainResponse } from 'data/custom-domains/custom-domains-query'
-import { useStore } from 'hooks'
-import { observer } from 'mobx-react-lite'
-import { useState } from 'react'
-import { Button, IconTrash } from 'ui'
+import Panel from 'components/ui/Panel'
+import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'
export type CustomDomainDeleteProps = {
projectRef?: string
@@ -42,7 +45,7 @@ const CustomDomainDelete = ({ projectRef, customDomain }: CustomDomainDeleteProp
return (
<>
- <div className="flex items-center justify-between">
+ <Panel.Content>
<div className="w-full space-y-2">
<p className="text-xs text-scale-1100">Active custom domain:</p>
<div className="flex items-center space-x-2">
@@ -51,12 +54,23 @@ const CustomDomainDelete = ({ projectRef, customDomain }: CustomDomainDeleteProp
<span>{customDomain.hostname}</span>
</code>
</div>
- <p className="text-sm !mt-4">
+ <p className="text-sm text-scale-1100">
Your custom domain is currently active and is serving traffic
</p>
</div>
+ </Panel.Content>
+
+ <div className="w-full border-t border-scale-400" />
- <div>
+ <Panel.Content className="w-full">
+ <div className="flex items-center justify-between">
+ <Link href="https://supabase.com/docs/guides/platform/custom-domains">
+ <a target="_blank">
+ <Button type="default" icon={<IconExternalLink />}>
+ Documentation
+ </Button>
+ </a>
+ </Link>
<Button
type="danger"
icon={<IconTrash />}
@@ -65,7 +79,7 @@ const CustomDomainDelete = ({ projectRef, customDomain }: CustomDomainDeleteProp
Delete Custom Domain
</Button>
</div>
- </div>
+ </Panel.Content>
<ConfirmModal
danger
diff --git a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainVerify.tsx b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainVerify.tsx
index f58ea6481cb..c8dee15035a 100644
--- a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainVerify.tsx
+++ b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainVerify.tsx
@@ -1,13 +1,16 @@
+import Link from 'next/link'
+import { useState } from 'react'
+import { observer } from 'mobx-react-lite'
+import { Button, IconAlertCircle, IconExternalLink, IconHelpCircle, IconRefreshCw } from 'ui'
+
+import { useStore } from 'hooks'
import { ProjectSettingsResponse } from 'data/config/project-settings-query'
import { CustomDomainResponse } from 'data/custom-domains/custom-domains-query'
import { useCustomDomainDeleteMutation } from 'data/custom-domains/custom-domains-delete-mutation'
import { useCustomDomainReverifyMutation } from 'data/custom-domains/custom-domains-reverify-mutation'
-import { useStore } from 'hooks'
-import { observer } from 'mobx-react-lite'
-import { Alert, Button, IconAlertCircle, IconHelpCircle, IconRefreshCw } from 'ui'
import DNSRecord from './DNSRecord'
+import Panel from 'components/ui/Panel'
import InformationBox from 'components/ui/InformationBox'
-import { useState } from 'react'
export type CustomDomainVerifyProps = {
projectRef?: string
@@ -50,114 +53,129 @@ const CustomDomainVerify = ({ projectRef, customDomain, settings }: CustomDomain
return (
<>
- <div>
- <h4 className="text-scale-1200 mb-2">
- Successfully added your custom domain{' '}
- <code className="text-sm">{customDomain.hostname}</code>
- </h4>
- <p className="text-sm text-scale-1100">
- Set the following record(s) in your DNS provider, then click verify to confirm your
- control over the domain
- </p>
- <p className="text-sm text-scale-1100">
- Records which have been successfully verified will be removed from this list below.
- </p>
- <div className="mt-4 mb-2">
- <InformationBox
- hideCollapse
- defaultVisibility
- icon={
- isNotVerifiedYet ? (
- <IconAlertCircle className="text-scale-1100" strokeWidth={1.5} />
- ) : (
- <IconHelpCircle className="text-scale-1100" strokeWidth={1.5} />
- )
- }
- title={
- isNotVerifiedYet
- ? 'Unable to verify records from DNS provider yet.'
- : 'Please note that it may take up to 24 hours for the DNS records to propagate.'
- }
- description={
- isNotVerifiedYet
- ? 'Do check again in a bit as it may take up to 24 hours for changes in DNS records to propagate.'
- : undefined
- }
- />
+ <Panel.Content className="space-y-6">
+ <div>
+ <h4 className="text-scale-1200 mb-2">
+ Successfully added your custom domain{' '}
+ <code className="text-sm">{customDomain.hostname}</code>
+ </h4>
+ <p className="text-sm text-scale-1100">
+ Set the following record(s) in your DNS provider, then click verify to confirm your
+ control over the domain
+ </p>
+ <p className="text-sm text-scale-1100">
+ Records which have been successfully verified will be removed from this list below.
+ </p>
+ <div className="mt-4 mb-2">
+ <InformationBox
+ hideCollapse
+ defaultVisibility
+ icon={
+ isNotVerifiedYet ? (
+ <IconAlertCircle className="text-scale-1100" strokeWidth={1.5} />
+ ) : (
+ <IconHelpCircle className="text-scale-1100" strokeWidth={1.5} />
+ )
+ }
+ title={
+ isNotVerifiedYet
+ ? 'Unable to verify records from DNS provider yet.'
+ : 'Please note that it may take up to 24 hours for the DNS records to propagate.'
+ }
+ description={
+ isNotVerifiedYet
+ ? 'Do check again in a bit as it may take up to 24 hours for changes in DNS records to propagate.'
+ : undefined
+ }
+ />
+ </div>
</div>
- </div>
- <div className="space-y-2">
- <div className="flex gap-4">
- <div className="w-[50px]">
- <p className="text-scale-1100 text-sm">Type</p>
- </div>
- <div className="text-sm grid gap-2 md:grid md:grid-cols-12 md:gap-x-4 input-mono flex-1">
- <div className="flex flex-row space-x-2 justify-between col-span-12">
- <label className="block text-scale-1100 text-sm break-all">Name</label>
+ <div className="space-y-2">
+ <div className="flex gap-4">
+ <div className="w-[50px]">
+ <p className="text-scale-1100 text-sm">Type</p>
</div>
- </div>
- <div className="text-sm grid gap-2 md:grid md:grid-cols-12 md:gap-x-4 input-mono flex-1">
- <div className="flex flex-row space-x-2 justify-between col-span-12">
- <label className="block text-scale-1100 text-sm break-all">Content</label>
+ <div className="text-sm grid gap-2 md:grid md:grid-cols-12 md:gap-x-4 input-mono flex-1">
+ <div className="flex flex-row space-x-2 justify-between col-span-12">
+ <label className="block text-scale-1100 text-sm break-all">Name</label>
+ </div>
+ </div>
+ <div className="text-sm grid gap-2 md:grid md:grid-cols-12 md:gap-x-4 input-mono flex-1">
+ <div className="flex flex-row space-x-2 justify-between col-span-12">
+ <label className="block text-scale-1100 text-sm break-all">Content</label>
+ </div>
</div>
</div>
- </div>
- {customDomain.verification_errors?.includes(
- 'custom hostname does not CNAME to this zone.'
- ) && (
- <DNSRecord
- type="CNAME"
- name={customDomain.hostname}
- value={settings?.autoApiService.app_config.endpoint ?? 'Loading...'}
- />
- )}
-
- {customDomain.ownership_verification && (
- <DNSRecord
- type={customDomain.ownership_verification.type}
- name={customDomain.ownership_verification.name}
- value={customDomain.ownership_verification.value}
- />
- )}
-
- {customDomain.ssl.status === 'pending_validation' && (
- <DNSRecord
- type="TXT"
- name={customDomain.ssl.txt_name ?? 'Loading...'}
- value={customDomain.ssl.txt_value ?? 'Loading...'}
- />
- )}
-
- {customDomain.ssl.status === 'pending_deployment' && (
- <div className="flex items-center justify-center space-x-2 py-8">
- <IconAlertCircle size={16} strokeWidth={1.5} />
- <p className="text-sm text-scale-1100">
- SSL certificate is being deployed. Please wait a few minutes and try again.
- </p>
+ {customDomain.verification_errors?.includes(
+ 'custom hostname does not CNAME to this zone.'
+ ) && (
+ <DNSRecord
+ type="CNAME"
+ name={customDomain.hostname}
+ value={settings?.autoApiService.app_config.endpoint ?? 'Loading...'}
+ />
+ )}
+
+ {customDomain.ownership_verification && (
+ <DNSRecord
+ type={customDomain.ownership_verification.type}
+ name={customDomain.ownership_verification.name}
+ value={customDomain.ownership_verification.value}
+ />
+ )}
+
+ {customDomain.ssl.status === 'pending_validation' && (
+ <DNSRecord
+ type="TXT"
+ name={customDomain.ssl.txt_name ?? 'Loading...'}
+ value={customDomain.ssl.txt_value ?? 'Loading...'}
+ />
+ )}
+
+ {customDomain.ssl.status === 'pending_deployment' && (
+ <div className="flex items-center justify-center space-x-2 py-8">
+ <IconAlertCircle size={16} strokeWidth={1.5} />
+ <p className="text-sm text-scale-1100">
+ SSL certificate is being deployed. Please wait a few minutes and try again.
+ </p>
+ </div>
+ )}
+ </div>
+ </Panel.Content>
+
+ <div className="border-t border-scale-400" />
+
+ <Panel.Content>
+ <div className="flex items-center justify-between">
+ <Link href="https://supabase.com/docs/guides/platform/custom-domains">
+ <a target="_blank">
+ <Button type="default" icon={<IconExternalLink />}>
+ Documentation
+ </Button>
+ </a>
+ </Link>
+ <div className="flex items-center space-x-2">
+ <Button
+ type="default"
+ onClick={onCancelCustomDomain}
+ loading={isDeleting}
+ className="self-end"
+ >
+ Cancel
+ </Button>
+ <Button
+ icon={<IconRefreshCw />}
+ onClick={onReverifyCustomDomain}
+ loading={isReverifyLoading}
+ className="self-end"
+ >
+ Verify
+ </Button>
</div>
- )}
- </div>
-
- <div className="flex items-center space-x-2 justify-end">
- <Button
- type="default"
- onClick={onCancelCustomDomain}
- loading={isDeleting}
- className="self-end"
- >
- Cancel
- </Button>
- <Button
- icon={<IconRefreshCw />}
- onClick={onReverifyCustomDomain}
- loading={isReverifyLoading}
- className="self-end"
- >
- Verify
- </Button>
- </div>
+ </div>
+ </Panel.Content>
</>
)
}
diff --git a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainsConfigureHostname.tsx b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainsConfigureHostname.tsx
index 8dd54267153..4c91404edaf 100644
--- a/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainsConfigureHostname.tsx
+++ b/studio/components/interfaces/Settings/API/CustomDomainConfig/CustomDomainsConfigureHostname.tsx
@@ -1,3 +1,8 @@
+import * as yup from 'yup'
+import { Form, Input } from 'ui'
+import { observer } from 'mobx-react-lite'
+
+import { useStore } from 'hooks'
import {
FormActions,
FormPanel,
@@ -5,14 +10,8 @@ import {
FormSectionContent,
FormSectionLabel,
} from 'components/ui/Forms'
-import InformationBox from 'components/ui/InformationBox'
import { ProjectSettingsResponse } from 'data/config/project-settings-query'
import { useCustomDomainCreateMutation } from 'data/custom-domains/custom-domains-create-mutation'
-import { useStore } from 'hooks'
-import { observer } from 'mobx-react-lite'
-import { ReactNode } from 'react'
-import { Form, IconAlertCircle, Input } from 'ui'
-import * as yup from 'yup'
const FORM_ID = 'custom-domains-form'
@@ -22,13 +21,11 @@ const schema = yup.object({
export type CustomDomainsConfigureHostnameProps = {
projectRef?: string
- title: ReactNode
settings?: ProjectSettingsResponse
}
const CustomDomainsConfigureHostname = ({
projectRef,
- title,
settings,
}: CustomDomainsConfigureHostnameProps) => {
const { ui } = useStore()
@@ -67,7 +64,6 @@ const CustomDomainsConfigureHostname = ({
<>
<FormPanel
disabled={true}
- header={title}
footer={
<div className="flex py-4 px-8">
<FormActions
diff --git a/studio/components/interfaces/Settings/API/ServiceList.tsx b/studio/components/interfaces/Settings/API/ServiceList.tsx
index c20e68926da..f1dcce06dca 100644
--- a/studio/components/interfaces/Settings/API/ServiceList.tsx
+++ b/studio/components/interfaces/Settings/API/ServiceList.tsx
@@ -5,7 +5,6 @@ import { IconAlertCircle, Input } from 'ui'
import {
useStore,
- useFlag,
useProjectSettings,
useProjectPostgrestConfig,
useJwtSecretUpdateStatus,
@@ -16,7 +15,6 @@ import PostgrestConfig from './PostgrestConfig'
import { DisplayApiSettings } from 'components/ui/ProjectSettings'
import { JWT_SECRET_UPDATE_ERROR_MESSAGES } from './API.constants'
import JWTSettings from './JWTSettings'
-import CustomDomainConfig from './CustomDomainConfig/CustomDomainConfig'
interface Props {
projectRef: string
@@ -27,8 +25,6 @@ const ServiceList: FC<Props> = ({ projectRef }) => {
const router = useRouter()
const { ref } = router.query
- const isCustomDomainsEnabled = useFlag('customDomains')
-
const { services, isError, mutateSettings } = useProjectSettings(ref as string | undefined)
const { mutateConfig } = useProjectPostgrestConfig(ref as string | undefined)
const { jwtSecretUpdateError, jwtSecretUpdateStatus }: any = useJwtSecretUpdateStatus(ref)
@@ -102,12 +98,6 @@ const ServiceList: FC<Props> = ({ projectRef }) => {
<section>
<PostgrestConfig />
</section>
-
- {isCustomDomainsEnabled && (
- <section className="mt-8">
- <CustomDomainConfig />
- </section>
- )}
</div>
</>
)
diff --git a/studio/pages/project/[ref]/settings/general.tsx b/studio/pages/project/[ref]/settings/general.tsx
index 63f43cd3ca1..9b2debd943d 100644
--- a/studio/pages/project/[ref]/settings/general.tsx
+++ b/studio/pages/project/[ref]/settings/general.tsx
@@ -1,13 +1,18 @@
import { observer } from 'mobx-react-lite'
+import { useFlag } from 'hooks'
import { NextPageWithLayout } from 'types'
import { SettingsLayout } from 'components/layouts'
import { General, Infrastructure, DeleteProjectPanel } from 'components/interfaces/Settings/General'
+import CustomDomainConfig from 'components/interfaces/Settings/API/CustomDomainConfig/CustomDomainConfig'
const ProjectSettings: NextPageWithLayout = () => {
+ const isCustomDomainsEnabled = useFlag('customDomains')
+
return (
<div className="1xl:px-28 mx-auto flex flex-col gap-8 px-5 py-6 lg:px-16 xl:px-24 2xl:px-32 ">
<General />
<Infrastructure />
+ {isCustomDomainsEnabled && <CustomDomainConfig />}
<DeleteProjectPanel />
</div>
)