Files
supabase/apps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GithubSection.tsx
T
Saxon Fletcher e92f13f11a adjust project settings integrations layout (#46868)
<img width="1521" height="967" alt="image"
src="https://github.com/user-attachments/assets/8d7bed1f-3ed8-4311-bd4b-92345ae02a52"
/>

Updates project settings integration page to more aligned with our
updated layout guidance (as defined in layout.mdx in design system).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Style**
* Refined the integrations settings page layout and visual design across
AWS PrivateLink, GitHub, and Vercel integration sections for improved
consistency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-12 07:42:11 -06:00

65 lines
2.4 KiB
TypeScript

import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useParams } from 'common'
import { useMemo } from 'react'
import {
PageSection,
PageSectionContent,
PageSectionDescription,
PageSectionMeta,
PageSectionSummary,
PageSectionTitle,
} from 'ui-patterns/PageSection'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
import { IntegrationSectionIcon } from '../IntegrationsSettings'
import { GitHubIntegrationConnectionForm } from './GitHubIntegrationConnectionForm'
import NoPermission from '@/components/ui/NoPermission'
import { useGitHubConnectionsQuery } from '@/data/integrations/github-connections-query'
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
export const GitHubSection = () => {
const { ref: projectRef } = useParams()
const { data: organization } = useSelectedOrganizationQuery()
const { can: canReadGitHubConnection, isLoading: isLoadingPermissions } =
useAsyncCheckPermissions(PermissionAction.READ, 'integrations.github_connections')
const { data: connections } = useGitHubConnectionsQuery(
{ organizationId: organization?.id },
{ enabled: !!projectRef && !!organization?.id }
)
const existingConnection = useMemo(
() => connections?.find((c) => c.project.ref === projectRef),
[connections, projectRef]
)
return (
<PageSection>
<PageSectionMeta>
<div className="flex flex-1 items-start gap-6">
<IntegrationSectionIcon title="github" />
<PageSectionSummary>
<PageSectionTitle>GitHub Integration</PageSectionTitle>
<PageSectionDescription>
Connect any of your GitHub repositories to a project. Supabase applies database
changes when you merge into your production branch. If branching is enabled, each pull
request gets its own preview database.
</PageSectionDescription>
</PageSectionSummary>
</div>
</PageSectionMeta>
<PageSectionContent>
{isLoadingPermissions ? (
<GenericSkeletonLoader />
) : !canReadGitHubConnection ? (
<NoPermission resourceText="view this organization's GitHub connections" />
) : (
<GitHubIntegrationConnectionForm connection={existingConnection} />
)}
</PageSectionContent>
</PageSection>
)
}