mirror of
https://github.com/supabase/supabase.git
synced 2026-05-06 22:18:00 +08:00
## Context Just happened to pass by this - refactor to use Admonition instead of Alert + fix spacing + use InlineLink e.g General settings while on a preview branch ### Before <img width="795" height="364" alt="image" src="https://github.com/user-attachments/assets/28ab66ab-bd10-408e-afb5-24e287efc705" /> ### After <img width="759" height="349" alt="image" src="https://github.com/user-attachments/assets/db62925d-f2e2-4c10-9cab-ce8204f2077c" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Preview-branch notices across Settings now use a unified admonition design with adjusted spacing for improved visual consistency. * **Refactor** * Standardized branch-notice layout and inline navigation links across Addons, General, and Integrations; each notice now links directly to its respective settings page for clearer navigation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
69 lines
2.4 KiB
TypeScript
69 lines
2.4 KiB
TypeScript
import { Admonition } from 'ui-patterns'
|
|
|
|
import { AWSPrivateLinkSection } from './AWSPrivateLink/AWSPrivateLinkSection'
|
|
import { GitHubSection } from './GithubIntegration/GithubSection'
|
|
import { VercelSection } from './VercelIntegration/VercelSection'
|
|
import { SidePanelVercelProjectLinker } from '@/components/interfaces/Organization/IntegrationSettings/SidePanelVercelProjectLinker'
|
|
import { ScaffoldContainer, ScaffoldDivider } from '@/components/layouts/Scaffold'
|
|
import { InlineLink } from '@/components/ui/InlineLink'
|
|
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
|
|
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
|
|
import { BASE_PATH } from '@/lib/constants'
|
|
|
|
export const IntegrationImageHandler = ({ title }: { title: 'vercel' | 'github' | 'aws' }) => {
|
|
return (
|
|
<img
|
|
className="border rounded-lg shadow-sm w-full sm:w-48 mt-6 border-body"
|
|
src={`${BASE_PATH}/img/integrations/covers/${title}-cover.png`}
|
|
alt={`${title} cover`}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export const IntegrationSettings = () => {
|
|
const { data: project } = useSelectedProjectQuery()
|
|
const isBranch = project?.parent_project_ref !== undefined
|
|
|
|
const showVercelIntegration = useIsFeatureEnabled('integrations:vercel')
|
|
const showAWSPrivateLinkFeature = useIsFeatureEnabled('integrations:aws_private_link')
|
|
// PrivateLink is not available in eu-central-2 (Zurich) until Feb 2026
|
|
const isPrivateLinkUnsupportedRegion = project?.region === 'eu-central-2'
|
|
const showAWSPrivateLink = showAWSPrivateLinkFeature && !isPrivateLinkUnsupportedRegion
|
|
|
|
return (
|
|
<>
|
|
{isBranch && (
|
|
<ScaffoldContainer>
|
|
<Admonition
|
|
type="default"
|
|
className="mt-6"
|
|
title="You are currently on a preview branch of your project"
|
|
>
|
|
To adjust your project's integration settings, you may return to your{' '}
|
|
<InlineLink href={`/project/${project.parent_project_ref}/settings/integrations`}>
|
|
main branch
|
|
</InlineLink>
|
|
.
|
|
</Admonition>
|
|
</ScaffoldContainer>
|
|
)}
|
|
<GitHubSection />
|
|
|
|
{showVercelIntegration && (
|
|
<>
|
|
<ScaffoldDivider />
|
|
<VercelSection isProjectScoped={true} />
|
|
<SidePanelVercelProjectLinker />
|
|
</>
|
|
)}
|
|
|
|
{showAWSPrivateLink && (
|
|
<>
|
|
<ScaffoldDivider />
|
|
<AWSPrivateLinkSection />
|
|
</>
|
|
)}
|
|
</>
|
|
)
|
|
}
|