Skip to content

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

Update account/me page components (#41193)

Saxon Fletcher28e4473953a2
diff --git a/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx b/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx
index be47dd6f31a..339521850b2 100644
--- a/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/AccountConnections.tsx
@@ -3,7 +3,6 @@ import Image from 'next/image'
import { useState } from 'react'
import { toast } from 'sonner'
-import Panel from 'components/ui/Panel'
import { useGitHubAuthorizationDeleteMutation } from 'data/integrations/github-authorization-delete-mutation'
import { useGitHubAuthorizationQuery } from 'data/integrations/github-authorization-query'
import { BASE_PATH } from 'lib/constants'
@@ -11,13 +10,24 @@ import { openInstallGitHubIntegrationWindow } from 'lib/github'
import {
Badge,
Button,
+ Card,
+ CardContent,
cn,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
+ DropdownMenuSeparator,
DropdownMenuTrigger,
} from 'ui'
import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
import ShimmeringLoader from 'ui-patterns/ShimmeringLoader'
export const AccountConnections = () => {
@@ -54,100 +64,103 @@ export const AccountConnections = () => {
}
return (
- <Panel
- className="mb-4 md:mb-8"
- title={
- <div>
- <h5>Connections</h5>
- <p className="text-sm text-foreground-lighter">
- Connect your Supabase account with other services
- </p>
- </div>
- }
- >
- {isLoading && (
- <Panel.Content>
- <ShimmeringLoader />
- </Panel.Content>
- )}
- {isError && (
- <Panel.Content>
- <p className="text-sm text-destructive">
- Failed to load GitHub connection status: {error?.message}
- </p>
- </Panel.Content>
- )}
- {isSuccess && (
- <Panel.Content className="flex justify-between items-center">
- <div className="flex gap-x-4 items-center">
- <Image
- className={cn('dark:invert')}
- src={`${BASE_PATH}/img/icons/github-icon.svg`}
- width={30}
- height={30}
- alt={`GitHub icon`}
- />
- <div>
- <p className="text-sm">GitHub</p>
- <p className="text-sm text-foreground-lighter">
- Sync GitHub repos to Supabase projects for automatic branch creation and merging
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle>Connections</PageSectionTitle>
+ <PageSectionDescription>
+ Connect your Supabase account with other services.
+ </PageSectionDescription>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
+ <Card>
+ {isLoading && (
+ <CardContent>
+ <ShimmeringLoader />
+ </CardContent>
+ )}
+ {isError && (
+ <CardContent>
+ <p className="text-sm text-destructive">
+ Failed to load GitHub connection status: {error?.message}
</p>
- </div>
- </div>
- <div className="flex items-center gap-x-2 ml-2">
- {isConnected ? (
- <>
- <Badge variant="success">Connected</Badge>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button iconRight={<ChevronDown size={14} />} type="default">
- <span>Manage</span>
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent side="bottom" align="end">
- <DropdownMenuItem
- className="space-x-2"
- onSelect={(event) => {
- event.preventDefault()
- handleReauthenticate()
- }}
- >
- <RefreshCw size={14} />
- <p>Re-authenticate</p>
- </DropdownMenuItem>
- <DropdownMenuItem
- className="space-x-2"
- onSelect={() => setIsRemoveModalOpen(true)}
- >
- <Unlink size={14} />
- <p>Remove connection</p>
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </>
- ) : (
- <Button type="primary" onClick={handleConnect}>
- Connect
- </Button>
- )}
- </div>
- </Panel.Content>
- )}
- <ConfirmationModal
- variant="destructive"
- size="small"
- visible={isRemoveModalOpen}
- title="Confirm to remove GitHub authorization"
- confirmLabel="Remove connection"
- onCancel={() => setIsRemoveModalOpen(false)}
- onConfirm={handleRemove}
- loading={isRemoving}
- >
- <p className="text-sm text-foreground-light">
- Removing this authorization will disconnect your GitHub account from Supabase. You can
- reconnect at any time.
- </p>
- </ConfirmationModal>
- </Panel>
+ </CardContent>
+ )}
+ {isSuccess && (
+ <CardContent className="flex justify-between items-center">
+ <div className="flex gap-x-4 items-center">
+ <Image
+ className={cn('dark:invert')}
+ src={`${BASE_PATH}/img/icons/github-icon.svg`}
+ width={30}
+ height={30}
+ alt={`GitHub icon`}
+ />
+ <div>
+ <p className="text-sm">GitHub</p>
+ <p className="text-sm text-foreground-lighter">
+ Sync repos to Supabase projects for automatic branch creation and merging
+ </p>
+ </div>
+ </div>
+ <div className="flex items-center gap-x-2 ml-2">
+ {isConnected ? (
+ <>
+ <Badge variant="success">Connected</Badge>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button iconRight={<ChevronDown size={14} />} type="default">
+ <span>Manage</span>
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent side="bottom" align="end" className="w-44">
+ <DropdownMenuItem
+ className="space-x-2"
+ onSelect={(event) => {
+ event.preventDefault()
+ handleReauthenticate()
+ }}
+ >
+ <RefreshCw size={14} />
+ <p>Re-authenticate</p>
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem
+ className="space-x-2"
+ onSelect={() => setIsRemoveModalOpen(true)}
+ >
+ <Unlink size={14} />
+ <p>Remove connection</p>
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </>
+ ) : (
+ <Button type="primary" onClick={handleConnect}>
+ Connect
+ </Button>
+ )}
+ </div>
+ </CardContent>
+ )}
+ </Card>
+ <ConfirmationModal
+ variant="destructive"
+ size="small"
+ visible={isRemoveModalOpen}
+ title="Confirm to remove GitHub authorization"
+ confirmLabel="Remove connection"
+ onCancel={() => setIsRemoveModalOpen(false)}
+ onConfirm={handleRemove}
+ loading={isRemoving}
+ >
+ <p className="text-sm text-foreground-light">
+ Removing this authorization will disconnect your GitHub account from Supabase. You can
+ reconnect at any time.
+ </p>
+ </ConfirmationModal>
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/interfaces/Account/Preferences/AccountDeletion.tsx b/apps/studio/components/interfaces/Account/Preferences/AccountDeletion.tsx
index c7b848848bb..2d8b9173e15 100644
--- a/apps/studio/components/interfaces/Account/Preferences/AccountDeletion.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/AccountDeletion.tsx
@@ -1,27 +1,39 @@
-import Panel from 'components/ui/Panel'
-import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_ } from 'ui'
-import { CriticalIcon } from 'ui'
+import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, CriticalIcon } from 'ui'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
import { DeleteAccountButton } from './DeleteAccountButton'
export const AccountDeletion = () => {
return (
- <>
- <Panel className="[&>div:first-child]:uppercase" title="Danger Zone">
- <Panel.Content>
- <Alert_Shadcn_ variant="destructive">
- <CriticalIcon />
- <AlertTitle_Shadcn_>Request for account deletion</AlertTitle_Shadcn_>
- <AlertDescription_Shadcn_>
- Deleting your account is permanent and cannot be undone. Your data will be deleted
- within 30 days, except we may retain some metadata and logs for longer where required
- or permitted by law.
- </AlertDescription_Shadcn_>
- <AlertDescription_Shadcn_ className="mt-3">
- <DeleteAccountButton />
- </AlertDescription_Shadcn_>
- </Alert_Shadcn_>
- </Panel.Content>
- </Panel>
- </>
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle>Danger zone</PageSectionTitle>
+ <PageSectionDescription>
+ Permanently delete your Supabase account and data.
+ </PageSectionDescription>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
+ <Alert_Shadcn_ variant="destructive">
+ <CriticalIcon />
+ <AlertTitle_Shadcn_>Request for account deletion</AlertTitle_Shadcn_>
+ <AlertDescription_Shadcn_>
+ Deleting your account is permanent and cannot be undone. Your data will be deleted
+ within 30 days, but we may retain some metadata and logs for longer where required or
+ permitted by law.
+ </AlertDescription_Shadcn_>
+ <AlertDescription_Shadcn_ className="mt-3">
+ <DeleteAccountButton />
+ </AlertDescription_Shadcn_>
+ </Alert_Shadcn_>
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx b/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx
index 8a1f9bcf4d1..08ebeb932bd 100644
--- a/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/AccountIdentities.tsx
@@ -7,13 +7,14 @@ import { useEffect, useState } from 'react'
import { toast } from 'sonner'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
-import Panel from 'components/ui/Panel'
import { useProfileIdentitiesQuery } from 'data/profile/profile-identities-query'
import { useUnlinkIdentityMutation } from 'data/profile/profile-unlink-identity-mutation'
import { BASE_PATH } from 'lib/constants'
import {
Badge,
Button,
+ Card,
+ CardContent,
cn,
Dialog,
DialogContent,
@@ -30,6 +31,14 @@ import {
GitHubChangeEmailAddress,
SSOChangeEmailAddress,
} from './ChangeEmailAddress'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
const getProviderName = (provider: string) =>
provider === 'github'
@@ -71,126 +80,134 @@ export const AccountIdentities = () => {
}, [message])
return (
- <>
- <Panel className="mb-4 md:mb-8" title={<h5>Account Identities</h5>}>
- {isLoading && (
- <Panel.Content>
- <ShimmeringLoader />
- </Panel.Content>
- )}
- {isSuccess &&
- identities.map((identity) => {
- const { identity_id, provider } = identity
- const username = identity.identity_data?.user_name
- const providerName = getProviderName(provider)
- const iconKey =
- provider === 'github'
- ? 'github-icon'
- : provider === 'email'
- ? 'email-icon2'
- : 'saml-icon'
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle>Account identities</PageSectionTitle>
+ <PageSectionDescription>
+ Manage the providers linked to your Supabase account and update their details.
+ </PageSectionDescription>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
+ <Card>
+ {isLoading && (
+ <CardContent>
+ <ShimmeringLoader />
+ </CardContent>
+ )}
+ {isSuccess && (
+ <div className="divide-y">
+ {identities.map((identity) => {
+ const { identity_id, provider } = identity
+ const username = identity.identity_data?.user_name
+ const providerName = getProviderName(provider)
+ const iconKey =
+ provider === 'github'
+ ? 'github-icon'
+ : provider === 'email'
+ ? 'email-icon2'
+ : 'saml-icon'
- return (
- <Panel.Content
- key={identity_id}
- className={cn('flex justify-between', identities.length > 1 ? 'last:border-t' : '')}
- >
- <div className="flex gap-x-4">
- <Image
- className={cn(iconKey === 'github-icon' ? 'dark:invert' : '')}
- src={`${BASE_PATH}/img/icons/${iconKey}.svg`}
- width={30}
- height={30}
- alt={`${identity.provider} icon`}
- />
- <div>
- <div className="flex items-center gap-x-2">
- <p className="text-sm capitalize">{providerName}</p>
- {provider === 'email' && data.new_email && !isChangeExpired && (
- <Tooltip>
- <TooltipTrigger className="flex items-center">
- <Badge variant="default">Pending change</Badge>
- </TooltipTrigger>
- <TooltipContent>Changing to {data.new_email}</TooltipContent>
- </Tooltip>
+ return (
+ <CardContent key={identity_id} className="flex justify-between items-center py-4">
+ <div className="flex gap-x-4">
+ <Image
+ className={cn(iconKey === 'github-icon' ? 'dark:invert' : '')}
+ src={`${BASE_PATH}/img/icons/${iconKey}.svg`}
+ width={30}
+ height={30}
+ alt={`${identity.provider} icon`}
+ />
+ <div>
+ <div className="flex items-center gap-x-2">
+ <p className="text-sm capitalize">{providerName}</p>
+ {provider === 'email' && data.new_email && !isChangeExpired && (
+ <Tooltip>
+ <TooltipTrigger className="flex items-center">
+ <Badge variant="default">Pending change</Badge>
+ </TooltipTrigger>
+ <TooltipContent>Changing to {data.new_email}</TooltipContent>
+ </Tooltip>
+ )}
+ </div>
+ <p className="text-sm text-foreground-lighter">
+ {!!username ? <span>{username} • </span> : null}
+ {identity.email}
+ </p>
+ </div>
+ </div>
+ <div className="flex items-center gap-x-1">
+ {provider === 'email' && (
+ <Button asChild type="default">
+ <Link href="/reset-password">Reset password</Link>
+ </Button>
+ )}
+ <ButtonTooltip
+ type="text"
+ icon={<Edit />}
+ className="w-7"
+ onClick={() => setSelectedProviderUpdateEmail(provider)}
+ tooltip={{ content: { side: 'bottom', text: 'Update email address' } }}
+ />
+ {identities.length > 1 && (
+ <ButtonTooltip
+ type="text"
+ icon={<Unlink />}
+ className="w-7"
+ onClick={() => setSelectedProviderUnlink(provider)}
+ tooltip={{ content: { side: 'bottom', text: 'Unlink identity' } }}
+ />
)}
- {/* [Joshen] Below is not supported yet, but ideal UX */}
- {/* {false && <Badge>Logged in as</Badge>} */}
</div>
- <p className="text-sm text-foreground-lighter">
- {!!username ? <span>{username} • </span> : null}
- {identity.email}
- </p>
- </div>
- </div>
- <div className="flex items-center gap-x-1">
- {provider === 'email' && (
- <Button asChild type="default">
- <Link href="/reset-password">Reset password</Link>
- </Button>
- )}
- <ButtonTooltip
- type="text"
- icon={<Edit />}
- className="w-7"
- onClick={() => setSelectedProviderUpdateEmail(provider)}
- tooltip={{ content: { side: 'bottom', text: 'Update email address' } }}
- />
- {identities.length > 1 && (
- <ButtonTooltip
- type="text"
- icon={<Unlink />}
- className="w-7"
- onClick={() => setSelectedProviderUnlink(provider)}
- tooltip={{ content: { side: 'bottom', text: 'Unlink identity' } }}
- />
- )}
- </div>
- </Panel.Content>
- )
- })}
- </Panel>
-
- <Dialog
- open={!!selectedProviderUpdateEmail}
- onOpenChange={(open: boolean) => {
- if (!open) setSelectedProviderUpdateEmail(undefined)
- }}
- >
- <DialogContent>
- <DialogHeader className="border-b">
- <DialogTitle>
- {selectedProviderUpdateEmail !== 'email'
- ? `Updating email address for ${getProviderName(selectedProviderUpdateEmail ?? '')} identity`
- : 'Update email address'}
- </DialogTitle>
- </DialogHeader>
- {selectedProviderUpdateEmail === 'github' ? (
- <GitHubChangeEmailAddress />
- ) : selectedProviderUpdateEmail?.startsWith('sso') ? (
- <SSOChangeEmailAddress />
- ) : (
- <ChangeEmailAddressForm onClose={() => setSelectedProviderUpdateEmail(undefined)} />
+ </CardContent>
+ )
+ })}
+ </div>
)}
- </DialogContent>
- </Dialog>
+ </Card>
+
+ <Dialog
+ open={!!selectedProviderUpdateEmail}
+ onOpenChange={(open: boolean) => {
+ if (!open) setSelectedProviderUpdateEmail(undefined)
+ }}
+ >
+ <DialogContent>
+ <DialogHeader className="border-b">
+ <DialogTitle>
+ {selectedProviderUpdateEmail !== 'email'
+ ? `Updating email address for ${getProviderName(selectedProviderUpdateEmail ?? '')} identity`
+ : 'Update email address'}
+ </DialogTitle>
+ </DialogHeader>
+ {selectedProviderUpdateEmail === 'github' ? (
+ <GitHubChangeEmailAddress />
+ ) : selectedProviderUpdateEmail?.startsWith('sso') ? (
+ <SSOChangeEmailAddress />
+ ) : (
+ <ChangeEmailAddressForm onClose={() => setSelectedProviderUpdateEmail(undefined)} />
+ )}
+ </DialogContent>
+ </Dialog>
- <ConfirmationModal
- variant="warning"
- size="small"
- loading={isUnlinking}
- visible={!!selectedProviderUnlink}
- title={`Unlink ${getProviderName(selectedProviderUnlink ?? '')} identity`}
- onCancel={() => setSelectedProviderUnlink(undefined)}
- onConfirm={onConfirmUnlinkIdentity}
- confirmLabel="Unlink identity"
- confirmLabelLoading="Unlinking identity"
- alert={{
- base: { variant: 'warning' },
- title: `Confirm to disconnect your ${getProviderName(selectedProviderUnlink ?? '')} identity`,
- description: `After disconnecting, you will only be able to sign in via ${selectedProviderUnlink === 'github' ? 'email and password' : 'your GitHub identity'}`,
- }}
- />
- </>
+ <ConfirmationModal
+ variant="warning"
+ size="small"
+ loading={isUnlinking}
+ visible={!!selectedProviderUnlink}
+ title={`Unlink ${getProviderName(selectedProviderUnlink ?? '')} identity`}
+ onCancel={() => setSelectedProviderUnlink(undefined)}
+ onConfirm={onConfirmUnlinkIdentity}
+ confirmLabel="Unlink identity"
+ confirmLabelLoading="Unlinking identity"
+ alert={{
+ base: { variant: 'warning' },
+ title: `Confirm to disconnect your ${getProviderName(selectedProviderUnlink ?? '')} identity`,
+ description: `After disconnecting, you will only be able to sign in via ${selectedProviderUnlink === 'github' ? 'email and password' : 'your GitHub identity'}`,
+ }}
+ />
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/interfaces/Account/Preferences/AnalyticsSettings.tsx b/apps/studio/components/interfaces/Account/Preferences/AnalyticsSettings.tsx
index 35267f776f6..3b9a41739dd 100644
--- a/apps/studio/components/interfaces/Account/Preferences/AnalyticsSettings.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/AnalyticsSettings.tsx
@@ -4,10 +4,17 @@ import { toast } from 'sonner'
import * as z from 'zod'
import { useConsentState } from 'common'
-import Panel from 'components/ui/Panel'
import { useSendResetMutation } from 'data/telemetry/send-reset-mutation'
-import { FormControl_Shadcn_, FormField_Shadcn_, Form_Shadcn_, Switch } from 'ui'
+import { Card, CardContent, FormControl_Shadcn_, FormField_Shadcn_, Form_Shadcn_, Switch } from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
const AnalyticsSchema = z.object({
telemetryEnabled: z.boolean(),
@@ -26,9 +33,11 @@ export const AnalyticsSettings = () => {
const handleToggle = (value: boolean) => {
if (!hasLoaded) {
- return toast.error(
+ toast.error(
"We couldn't load the privacy settings due to an ad blocker or network error. Please disable any ad blockers and try again. If the problem persists, please contact support."
)
+ form.setValue('telemetryEnabled', !value)
+ return
}
if (value) {
@@ -42,32 +51,44 @@ export const AnalyticsSettings = () => {
}
return (
- <Panel title={<h5 key="panel-title">Analytics and Marketing</h5>}>
- <Panel.Content>
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle>Analytics and Marketing</PageSectionTitle>
+ <PageSectionDescription>
+ Control whether telemetry and marketing data is sent from Supabase services.
+ </PageSectionDescription>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
<Form_Shadcn_ {...form}>
- <FormField_Shadcn_
- control={form.control}
- name="telemetryEnabled"
- render={({ field }) => (
- <FormItemLayout
- layout="flex-row-reverse"
- label="Send telemetry data from Supabase services"
- description="By opting in to sharing telemetry data, Supabase can analyze usage patterns to enhance user experience and use it for marketing and advertising purposes"
- >
- <FormControl_Shadcn_>
- <Switch
- checked={field.value}
- onCheckedChange={(value) => {
- field.onChange(value)
- handleToggle(value)
- }}
- />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
+ <Card>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="telemetryEnabled"
+ render={({ field }) => (
+ <FormItemLayout
+ layout="flex-row-reverse"
+ label="Send telemetry data from Supabase services"
+ description="By opting in to sharing telemetry data, Supabase can analyze usage patterns to enhance user experience and use it for marketing and advertising purposes"
+ >
+ <FormControl_Shadcn_>
+ <Switch
+ checked={field.value}
+ onCheckedChange={(value) => {
+ field.onChange(value)
+ handleToggle(value)
+ }}
+ />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ </Card>
</Form_Shadcn_>
- </Panel.Content>
- </Panel>
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/interfaces/Account/Preferences/HotkeySettings.tsx b/apps/studio/components/interfaces/Account/Preferences/HotkeySettings.tsx
index b97f3d0a19c..669cce3c2ab 100644
--- a/apps/studio/components/interfaces/Account/Preferences/HotkeySettings.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/HotkeySettings.tsx
@@ -4,10 +4,25 @@ import * as z from 'zod'
import { LOCAL_STORAGE_KEYS } from 'common'
import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
-import Panel from 'components/ui/Panel'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
-import { FormControl_Shadcn_, FormField_Shadcn_, Form_Shadcn_, KeyboardShortcut, Switch } from 'ui'
+import {
+ Card,
+ CardContent,
+ FormControl_Shadcn_,
+ FormField_Shadcn_,
+ Form_Shadcn_,
+ KeyboardShortcut,
+ Switch,
+} from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
const HotkeySchema = z.object({
commandMenuEnabled: z.boolean(),
@@ -39,99 +54,102 @@ export const HotkeySettings = () => {
})
return (
- <Panel
- title={
- <div>
- <h5 id="keyboard-shortcuts">Keyboard shortcuts</h5>
- <p className="text-sm text-foreground-lighter">
- Choose which shortcuts stay active while working in the dashboard
- </p>
- </div>
- }
- >
- <Form_Shadcn_ {...form}>
- <Panel.Content className="border-b">
- <FormField_Shadcn_
- control={form.control}
- name="commandMenuEnabled"
- render={({ field }) => (
- <FormItemLayout
- layout="flex-row-reverse"
- label={
- <div className="flex items-center gap-x-3">
- <KeyboardShortcut keys={['Meta', 'k']} />
- <span>Command menu</span>
- </div>
- }
- >
- <FormControl_Shadcn_>
- <Switch
- checked={field.value}
- onCheckedChange={(value) => {
- field.onChange(value)
- setCommandMenuEnabled(value)
- }}
- />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- </Panel.Content>
- <Panel.Content className="border-b">
- <FormField_Shadcn_
- control={form.control}
- name="aiAssistantEnabled"
- render={({ field }) => (
- <FormItemLayout
- layout="flex-row-reverse"
- label={
- <div className="flex items-center gap-x-3">
- <KeyboardShortcut keys={['Meta', 'i']} />
- <span>AI Assistant Panel</span>
- </div>
- }
- >
- <FormControl_Shadcn_>
- <Switch
- checked={field.value}
- onCheckedChange={(value) => {
- field.onChange(value)
- setAiAssistantEnabled(value)
- }}
- />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- </Panel.Content>
- <Panel.Content>
- <FormField_Shadcn_
- control={form.control}
- name="inlineEditorEnabled"
- render={({ field }) => (
- <FormItemLayout
- layout="flex-row-reverse"
- label={
- <div className="flex items-center gap-x-3">
- <KeyboardShortcut keys={['Meta', 'e']} />
- <span>Inline SQL Editor Panel</span>
- </div>
- }
- >
- <FormControl_Shadcn_>
- <Switch
- checked={field.value}
- onCheckedChange={(value) => {
- field.onChange(value)
- setInlineEditorEnabled(value)
- }}
- />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- </Panel.Content>
- </Form_Shadcn_>
- </Panel>
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle id="keyboard-shortcuts">Keyboard shortcuts</PageSectionTitle>
+ <PageSectionDescription>
+ Choose which shortcuts stay active while working in the dashboard.
+ </PageSectionDescription>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
+ <Form_Shadcn_ {...form}>
+ <Card>
+ <CardContent className="border-b">
+ <FormField_Shadcn_
+ control={form.control}
+ name="commandMenuEnabled"
+ render={({ field }) => (
+ <FormItemLayout
+ layout="flex-row-reverse"
+ label={
+ <div className="flex items-center gap-x-3">
+ <KeyboardShortcut keys={['Meta', 'k']} />
+ <span>Command menu</span>
+ </div>
+ }
+ >
+ <FormControl_Shadcn_>
+ <Switch
+ checked={field.value}
+ onCheckedChange={(value) => {
+ field.onChange(value)
+ setCommandMenuEnabled(value)
+ }}
+ />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ <CardContent className="border-b">
+ <FormField_Shadcn_
+ control={form.control}
+ name="aiAssistantEnabled"
+ render={({ field }) => (
+ <FormItemLayout
+ layout="flex-row-reverse"
+ label={
+ <div className="flex items-center gap-x-3">
+ <KeyboardShortcut keys={['Meta', 'i']} />
+ <span>AI Assistant Panel</span>
+ </div>
+ }
+ >
+ <FormControl_Shadcn_>
+ <Switch
+ checked={field.value}
+ onCheckedChange={(value) => {
+ field.onChange(value)
+ setAiAssistantEnabled(value)
+ }}
+ />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="inlineEditorEnabled"
+ render={({ field }) => (
+ <FormItemLayout
+ layout="flex-row-reverse"
+ label={
+ <div className="flex items-center gap-x-3">
+ <KeyboardShortcut keys={['Meta', 'e']} />
+ <span>Inline SQL Editor Panel</span>
+ </div>
+ }
+ >
+ <FormControl_Shadcn_>
+ <Switch
+ checked={field.value}
+ onCheckedChange={(value) => {
+ field.onChange(value)
+ setInlineEditorEnabled(value)
+ }}
+ />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ </Card>
+ </Form_Shadcn_>
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/interfaces/Account/Preferences/InlineEditorSettings.tsx b/apps/studio/components/interfaces/Account/Preferences/InlineEditorSettings.tsx
index c28bcaa39e6..3d702465056 100644
--- a/apps/studio/components/interfaces/Account/Preferences/InlineEditorSettings.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/InlineEditorSettings.tsx
@@ -3,12 +3,19 @@ import { useForm } from 'react-hook-form'
import * as z from 'zod'
import { LOCAL_STORAGE_KEYS } from 'common'
-import Panel from 'components/ui/Panel'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
-import { FormControl_Shadcn_, FormField_Shadcn_, Form_Shadcn_, Switch } from 'ui'
+import { Card, CardContent, FormControl_Shadcn_, FormField_Shadcn_, Form_Shadcn_, Switch } from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
const InlineEditorSchema = z.object({
inlineEditorEnabled: z.boolean(),
@@ -55,32 +62,44 @@ export const InlineEditorSettings = () => {
}
return (
- <Panel title={<h5 id="inline-editor">Dashboard</h5>}>
- <Panel.Content>
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle id="inline-editor">Dashboard</PageSectionTitle>
+ <PageSectionDescription>
+ Choose your preferred experience when editing policies, triggers, and functions.
+ </PageSectionDescription>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
<Form_Shadcn_ {...form}>
- <FormField_Shadcn_
- control={form.control}
- name="inlineEditorEnabled"
- render={({ field }) => (
- <FormItemLayout
- layout="flex-row-reverse"
- label="Edit entities in SQL"
- description="When enabled, view and edit policies, triggers, and functions directly in the SQL editor instead of a more beginner-friendly UI panel. Ideal for those comfortable with SQL."
- >
- <FormControl_Shadcn_>
- <Switch
- checked={field.value}
- onCheckedChange={(value) => {
- field.onChange(value)
- handleToggle(value)
- }}
- />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
+ <Card>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="inlineEditorEnabled"
+ render={({ field }) => (
+ <FormItemLayout
+ layout="flex-row-reverse"
+ label="Edit entities in SQL"
+ description="When enabled, view and edit policies, triggers, and functions directly in the SQL editor instead of a more beginner-friendly UI panel. Ideal for those comfortable with SQL."
+ >
+ <FormControl_Shadcn_>
+ <Switch
+ checked={field.value}
+ onCheckedChange={(value) => {
+ field.onChange(value)
+ handleToggle(value)
+ }}
+ />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ </Card>
</Form_Shadcn_>
- </Panel.Content>
- </Panel>
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx b/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx
index e4e752e784b..adb4fe08a2b 100644
--- a/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/ProfileInformation.tsx
@@ -6,7 +6,6 @@ import {
Card,
CardContent,
CardFooter,
- CardHeader,
FormControl_Shadcn_,
FormField_Shadcn_,
Form_Shadcn_,
@@ -25,6 +24,13 @@ import { useProfile } from 'lib/profile'
import { groupBy } from 'lodash'
import type { FormSchema } from 'types'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
const FormSchema = z.object({
first_name: z.string().optional(),
@@ -59,7 +65,7 @@ export const ProfileInformation = () => {
values: defaultValues,
})
- const { mutate: updateProfile, isPending } = useProfileUpdateMutation({
+ const { mutate: updateProfile, isPending: isUpdatingProfile } = useProfileUpdateMutation({
onSuccess: (data) => {
toast.success('Successfully saved profile')
const { first_name, last_name, username, primary_email } = data
@@ -78,111 +84,128 @@ export const ProfileInformation = () => {
}
return (
- <Form_Shadcn_ {...form}>
- <form id={formId} className="space-y-6 w-full" onSubmit={form.handleSubmit(onSubmit)}>
- <Card className="mb-8">
- <CardHeader>Profile Information</CardHeader>
- <CardContent className="flex flex-col gap-y-2">
- <FormField_Shadcn_
- control={form.control}
- name="first_name"
- render={({ field }) => (
- <FormItemLayout label="First name" layout="horizontal">
- <FormControl_Shadcn_ className="col-span-8">
- <Input_Shadcn_ {...field} className="w-72" />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- <FormField_Shadcn_
- control={form.control}
- name="last_name"
- render={({ field }) => (
- <FormItemLayout label="Last name" layout="horizontal">
- <FormControl_Shadcn_ className="col-span-8">
- <Input_Shadcn_ {...field} className="w-72" />
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- <FormField_Shadcn_
- control={form.control}
- name="primary_email"
- render={({ field }) => (
- <FormItemLayout label="Primary email" layout="horizontal">
- <FormControl_Shadcn_ className="col-span-8">
- <div className="flex flex-col gap-1">
- <Select_Shadcn_
- value={field.value}
- onValueChange={field.onChange}
- disabled={profile?.is_sso_user}
- >
- <SelectTrigger_Shadcn_ className="col-span-8 w-72">
- <SelectValue_Shadcn_ placeholder="Select primary email" />
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_ className="col-span-8">
- {isIdentitiesSuccess &&
- dedupedIdentityEmails.map((email) => (
- <SelectItem_Shadcn_ key={email} value={email}>
- {email}
- </SelectItem_Shadcn_>
- ))}
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- {(profile?.is_sso_user && (
- <p className="text-xs text-foreground-light">
- Primary email is managed by your SSO provider and cannot be changed here.
- </p>
- )) || (
- <p className="text-xs text-foreground-light">
- Primary email is used for account notifications.
- </p>
- )}
- </div>
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- <FormField_Shadcn_
- control={form.control}
- name="username"
- render={({ field }) => (
- <FormItemLayout label="Username" layout="horizontal">
- <FormControl_Shadcn_ className="col-span-8">
- <div className="flex flex-col gap-1">
- <Input_Shadcn_ {...field} className="w-72" disabled={profile?.is_sso_user} />
- {(profile?.is_sso_user && (
- <p className="text-xs text-foreground-light">
- Username is managed by your SSO provider and cannot be changed here.
- </p>
- )) || (
- <p className="text-xs text-foreground-light">
- Username appears as a display name throughout the dashboard.
- </p>
- )}
- </div>
- </FormControl_Shadcn_>
- </FormItemLayout>
- )}
- />
- </CardContent>
- <CardFooter className="justify-end space-x-2">
- {form.formState.isDirty && (
- <Button type="default" onClick={() => form.reset()}>
- Cancel
- </Button>
- )}
- <Button
- type="primary"
- htmlType="submit"
- loading={isPending || isIdentitiesLoading}
- disabled={!form.formState.isDirty}
- >
- Save
- </Button>
- </CardFooter>
- </Card>
- </form>
- </Form_Shadcn_>
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle>Profile information</PageSectionTitle>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
+ <Form_Shadcn_ {...form}>
+ <form id={formId} className="space-y-6 w-full" onSubmit={form.handleSubmit(onSubmit)}>
+ <Card>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="first_name"
+ render={({ field }) => (
+ <FormItemLayout label="First name" layout="flex-row-reverse">
+ <FormControl_Shadcn_ className="col-span-8">
+ <Input_Shadcn_ {...field} placeholder="First name" className="w-full" />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="last_name"
+ render={({ field }) => (
+ <FormItemLayout label="Last name" layout="flex-row-reverse">
+ <FormControl_Shadcn_ className="col-span-8">
+ <Input_Shadcn_ {...field} placeholder="Last name" className="w-full" />
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="primary_email"
+ render={({ field }) => (
+ <FormItemLayout
+ label="Primary email"
+ description={
+ profile?.is_sso_user
+ ? 'Primary email is managed by your SSO provider and cannot be changed here.'
+ : 'Primary email is used for account notifications.'
+ }
+ layout="flex-row-reverse"
+ >
+ <FormControl_Shadcn_ className="col-span-8">
+ <div className="flex flex-col gap-1">
+ <Select_Shadcn_
+ value={field.value}
+ onValueChange={field.onChange}
+ disabled={profile?.is_sso_user}
+ >
+ <SelectTrigger_Shadcn_ className="col-span-8 w-full">
+ <SelectValue_Shadcn_ placeholder="Select primary email" />
+ </SelectTrigger_Shadcn_>
+ <SelectContent_Shadcn_ className="col-span-8">
+ {isIdentitiesSuccess &&
+ dedupedIdentityEmails.map((email) => (
+ <SelectItem_Shadcn_ key={email} value={email}>
+ {email}
+ </SelectItem_Shadcn_>
+ ))}
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+ </div>
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ <CardContent>
+ <FormField_Shadcn_
+ control={form.control}
+ name="username"
+ render={({ field }) => (
+ <FormItemLayout
+ label="Username"
+ description={
+ profile?.is_sso_user
+ ? 'Username is managed by your SSO provider and cannot be changed here.'
+ : 'Username appears as a display name throughout the dashboard.'
+ }
+ layout="flex-row-reverse"
+ >
+ <FormControl_Shadcn_ className="col-span-8">
+ <div className="flex flex-col gap-1">
+ <Input_Shadcn_
+ {...field}
+ className="w-full"
+ placeholder="Username"
+ disabled={profile?.is_sso_user}
+ />
+ </div>
+ </FormControl_Shadcn_>
+ </FormItemLayout>
+ )}
+ />
+ </CardContent>
+ <CardFooter className="justify-end space-x-2">
+ {form.formState.isDirty && (
+ <Button type="default" onClick={() => form.reset()}>
+ Cancel
+ </Button>
+ )}
+ <Button
+ type="primary"
+ htmlType="submit"
+ loading={isUpdatingProfile || isIdentitiesLoading}
+ disabled={!form.formState.isDirty}
+ >
+ Save
+ </Button>
+ </CardFooter>
+ </Card>
+ </form>
+ </Form_Shadcn_>
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx b/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx
index 762a1b6c67d..1cb2298276d 100644
--- a/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx
+++ b/apps/studio/components/interfaces/Account/Preferences/ThemeSettings.tsx
@@ -2,11 +2,13 @@ import { useTheme } from 'next-themes'
import { useEffect, useState } from 'react'
import SVG from 'react-inlinesvg'
+import { LOCAL_STORAGE_KEYS } from 'common'
import { DEFAULT_SIDEBAR_BEHAVIOR } from 'components/interfaces/Sidebar'
-import Panel from 'components/ui/Panel'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
import { BASE_PATH } from 'lib/constants'
import {
+ Card,
+ CardContent,
Label_Shadcn_,
RadioGroup_Shadcn_,
RadioGroupLargeItem_Shadcn_,
@@ -20,7 +22,14 @@ import {
Theme,
} from 'ui'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
-import { LOCAL_STORAGE_KEYS } from 'common'
+import {
+ PageSection,
+ PageSectionContent,
+ PageSectionDescription,
+ PageSectionMeta,
+ PageSectionSummary,
+ PageSectionTitle,
+} from 'ui-patterns/PageSection'
export const ThemeSettings = () => {
const [mounted, setMounted] = useState(false)
@@ -41,73 +50,80 @@ export const ThemeSettings = () => {
function SingleThemeSelection() {
return (
- <form>
- <RadioGroup_Shadcn_
- name="theme"
- onValueChange={setTheme}
- aria-label="Choose a theme"
- defaultValue={theme}
- value={theme}
- className="flex flex-wrap gap-2 md:gap-5"
- >
- {singleThemes.map((theme: Theme) => (
- <RadioGroupLargeItem_Shadcn_
- className="p-3"
- key={theme.value}
- value={theme.value}
- label={theme.name}
- >
- <SVG src={`${BASE_PATH}/img/themes/${theme.value}.svg?v=2`} />
- </RadioGroupLargeItem_Shadcn_>
- ))}
- </RadioGroup_Shadcn_>
- </form>
+ <RadioGroup_Shadcn_
+ name="theme"
+ onValueChange={setTheme}
+ aria-label="Choose a theme"
+ defaultValue={theme}
+ value={theme}
+ className="grid grid-cols-2 gap-4"
+ >
+ {singleThemes.map((theme: Theme) => (
+ <RadioGroupLargeItem_Shadcn_
+ className="p-3 w-full"
+ key={theme.value}
+ value={theme.value}
+ label={theme.name}
+ >
+ <SVG src={`${BASE_PATH}/img/themes/${theme.value}.svg?v=2`} />
+ </RadioGroupLargeItem_Shadcn_>
+ ))}
+ </RadioGroup_Shadcn_>
)
}
return (
- <Panel title={<h5 key="panel-title">Appearance</h5>}>
- <Panel.Content className="grid gap-8 !py-5">
- <div className="grid grid-cols-12">
- <div className="col-span-full md:col-span-4 flex flex-col gap-5">
- <Label_Shadcn_ htmlFor="theme" className="text-light">
- Theme mode
- </Label_Shadcn_>
- <p className="text-sm text-foreground-light max-w-[220px]">
- Choose how Supabase looks to you. Select a single theme, or sync with your system.
- </p>
- </div>
+ <PageSection>
+ <PageSectionMeta>
+ <PageSectionSummary>
+ <PageSectionTitle>Appearance</PageSectionTitle>
+ <PageSectionDescription>
+ Choose how Supabase looks and behaves in the dashboard.
+ </PageSectionDescription>
+ </PageSectionSummary>
+ </PageSectionMeta>
+ <PageSectionContent>
+ <Card>
+ <CardContent className="grid grid-cols-12 gap-6">
+ <div className="col-span-full md:col-span-4 flex flex-col gap-2">
+ <Label_Shadcn_ htmlFor="theme" className="text-foreground">
+ Theme mode
+ </Label_Shadcn_>
+ <p className="text-sm text-foreground-light">
+ Choose how Supabase looks to you. Select a single theme, or sync with your system.
+ </p>
+ </div>
- <div className="col-span-full md:col-span-8 flex flex-col gap-4">
- <p className="text-sm text-light">Supabase will use your selected theme</p>
- <SingleThemeSelection />
- </div>
- </div>
- </Panel.Content>
- <Separator />
- <Panel.Content>
- <FormItemLayout
- isReactForm={false}
- label="Sidebar behavior"
- layout="flex-row-reverse"
- description="Choose your preferred sidebar behavior: open, closed, or expand on hover."
- >
- <Select_Shadcn_
- value={sidebarBehaviour}
- onValueChange={setSidebarBehaviour}
- aria-label="Select an option"
- >
- <SelectTrigger_Shadcn_>
- <SelectValue_Shadcn_ placeholder="Choose an option" />
- </SelectTrigger_Shadcn_>
- <SelectContent_Shadcn_>
- <SelectItem_Shadcn_ value="open">Expanded</SelectItem_Shadcn_>
- <SelectItem_Shadcn_ value="closed">Collapsed</SelectItem_Shadcn_>
- <SelectItem_Shadcn_ value="expandable">Expand on hover</SelectItem_Shadcn_>
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
- </FormItemLayout>
- </Panel.Content>
- </Panel>
+ <div className="col-span-full md:col-span-8 flex flex-col gap-4">
+ <SingleThemeSelection />
+ </div>
+ </CardContent>
+ <Separator />
+ <CardContent>
+ <FormItemLayout
+ isReactForm={false}
+ label="Sidebar behavior"
+ layout="flex-row-reverse"
+ description="Choose your preferred sidebar behavior: open, closed, or expand on hover."
+ >
+ <Select_Shadcn_
+ value={sidebarBehaviour}
+ onValueChange={setSidebarBehaviour}
+ aria-label="Select an option"
+ >
+ <SelectTrigger_Shadcn_>
+ <SelectValue_Shadcn_ placeholder="Choose an option" />
+ </SelectTrigger_Shadcn_>
+ <SelectContent_Shadcn_>
+ <SelectItem_Shadcn_ value="open">Expanded</SelectItem_Shadcn_>
+ <SelectItem_Shadcn_ value="closed">Collapsed</SelectItem_Shadcn_>
+ <SelectItem_Shadcn_ value="expandable">Expand on hover</SelectItem_Shadcn_>
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+ </FormItemLayout>
+ </CardContent>
+ </Card>
+ </PageSectionContent>
+ </PageSection>
)
}
diff --git a/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx b/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx
index 303fa13e9d2..d2d237b7966 100644
--- a/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx
+++ b/apps/studio/components/layouts/AccountLayout/WithSidebar.tsx
@@ -48,11 +48,7 @@ export const WithSidebar = ({
/>
)}
<div className="flex flex-1 flex-col">
- <div className="flex-1 flex-grow overflow-y-auto">
- <div className="mx-auto max-w-7xl w-full md:px-6 lg:px-14 xl:px-28 2xl:px-32 py-16">
- {children}
- </div>
- </div>
+ <div className="flex-1 flex-grow overflow-y-auto">{children}</div>
</div>
<MobileSheetNav open={mobileMenuOpen} onOpenChange={setMobileMenuOpen}>
<SidebarContent
diff --git a/apps/studio/pages/account/me.tsx b/apps/studio/pages/account/me.tsx
index c805527453f..9ebc82ef3a5 100644
--- a/apps/studio/pages/account/me.tsx
+++ b/apps/studio/pages/account/me.tsx
@@ -10,17 +10,20 @@ import AccountLayout from 'components/layouts/AccountLayout/AccountLayout'
import AppLayout from 'components/layouts/AppLayout/AppLayout'
import DefaultLayout from 'components/layouts/DefaultLayout'
import OrganizationLayout from 'components/layouts/OrganizationLayout'
-import {
- ScaffoldContainer,
- ScaffoldHeader,
- ScaffoldSectionTitle,
-} from 'components/layouts/Scaffold'
import AlertError from 'components/ui/AlertError'
-import Panel from 'components/ui/Panel'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useProfile } from 'lib/profile'
import type { NextPageWithLayout } from 'types'
+import { Card, CardContent } from 'ui'
+import { PageContainer } from 'ui-patterns/PageContainer'
+import {
+ PageHeader,
+ PageHeaderDescription,
+ PageHeaderMeta,
+ PageHeaderSummary,
+ PageHeaderTitle,
+} from 'ui-patterns/PageHeader'
const User: NextPageWithLayout = () => {
return <ProfileCard />
@@ -49,63 +52,52 @@ const ProfileCard = () => {
return (
<>
- <ScaffoldContainer>
- <ScaffoldHeader className="pt-0">
- <ScaffoldSectionTitle>Preferences</ScaffoldSectionTitle>
- </ScaffoldHeader>
- </ScaffoldContainer>
- <ScaffoldContainer bottomPadding>
- <article>
- {isLoading && (
- <Panel>
- <div className="p-4">
- <GenericSkeletonLoader />
- </div>
- </Panel>
- )}
- {isError && (
- <Panel>
- <div className="p-4">
- <AlertError error={error} subject="Failed to retrieve account information" />
- </div>
- </Panel>
- )}
- {isSuccess && (
- <>
- {profileShowInformation && isSuccess ? <ProfileInformation /> : null}
- <AccountIdentities />
- </>
- )}
+ <PageHeader size="small">
+ <PageHeaderMeta>
+ <PageHeaderSummary>
+ <PageHeaderTitle>Preferences</PageHeaderTitle>
+ <PageHeaderDescription>
+ Manage your account profile, connections, and dashboard experience.
+ </PageHeaderDescription>
+ </PageHeaderSummary>
+ </PageHeaderMeta>
+ </PageHeader>
+ <PageContainer size="small">
+ {isLoading && (
+ <Card>
+ <CardContent className="p-4">
+ <GenericSkeletonLoader />
+ </CardContent>
+ </Card>
+ )}
+
+ {isError && (
+ <Card>
+ <CardContent className="p-4">
+ <AlertError error={error} subject="Failed to retrieve account information" />
+ </CardContent>
+ </Card>
+ )}
+
+ {isSuccess && (
+ <>
+ {profileShowInformation ? <ProfileInformation /> : null}
+ <AccountIdentities />
+ </>
+ )}
- <section>
- <AccountConnections />
- </section>
+ <AccountConnections />
- <section>
- <ThemeSettings />
- </section>
+ <ThemeSettings />
- <section>
- <HotkeySettings />
- </section>
+ <HotkeySettings />
- <section>
- <InlineEditorSettings />
- </section>
+ <InlineEditorSettings />
- {profileShowAnalyticsAndMarketing && (
- <section>
- <AnalyticsSettings />
- </section>
- )}
+ {profileShowAnalyticsAndMarketing && <AnalyticsSettings />}
- {profileShowAccountDeletion && (
- <section>
- <AccountDeletion />
- </section>
- )}
- </article>
- </ScaffoldContainer>
+ {profileShowAccountDeletion && <AccountDeletion />}
+ </PageContainer>
</>
)
}