Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

refactor(templates): tighten settings-dialog XDS purity (grade 85→95) (#2629)

rubyycheung15bb7c05f3b4
diff --git a/packages/cli/templates/pages/settings-dialog/page.tsx b/packages/cli/templates/pages/settings-dialog/page.tsx
index a2da04c0b0..cdccf37c6c 100644
--- a/packages/cli/templates/pages/settings-dialog/page.tsx
+++ b/packages/cli/templates/pages/settings-dialog/page.tsx
@@ -52,44 +52,25 @@ const styles = stylex.create({
backgroundColor: colorVars['--color-background-surface'],
flexShrink: 0,
},
- rowPadding: {
- paddingBlock: spacingVars['--spacing-4'],
- },
- cardContentPadding: {
- paddingInline: spacingVars['--spacing-4'],
- },
- headerPadding: {
- paddingInline: spacingVars['--spacing-6'],
- paddingBlock: spacingVars['--spacing-6'],
+ // Sticky dialog header bar — no XDS prop for sticky/background/z-index.
+ // Inline + block padding comes from the parent XDSLayoutContent `padding`.
+ headerSticky: {
position: 'sticky',
top: 0,
backgroundColor: colorVars['--color-background-surface'],
zIndex: 1,
},
- contentHPadding: {
- paddingInline: spacingVars['--spacing-6'],
- paddingBlockEnd: spacingVars['--spacing-6'],
+ // No `maxWidth` prop on XDSVStack — width only. Inline padding comes from
+ // the parent XDSLayoutContent `padding`.
+ contentMaxWidth: {
maxWidth: 680,
},
- sideNavPadding: {
- paddingBlock: spacingVars['--spacing-4'],
- paddingInline: spacingVars['--spacing-3'],
- },
- sectionHeading: {
- paddingBlockEnd: spacingVars['--spacing-2'],
- },
+ // Aligns the sidebar heading with list-item label text. No heading margin prop.
sideNavHeading: {
marginInline: spacingVars['--spacing-4'],
},
dialogHeight: {
height: '85vh',
- minHeight: '85vh',
- },
- layoutFill: {
- flex: '1 1 0px',
- },
- panelFull: {
- height: '100%',
},
});
@@ -179,7 +160,7 @@ function ExpandableRow({
return (
<>
{isExpanded ? (
- <XDSVStack gap={4} xstyle={styles.rowPadding}>
+ <XDSVStack gap={4}>
<XDSText type="body" weight="semibold" display="block">
{label}
</XDSText>
@@ -190,7 +171,7 @@ function ExpandableRow({
</XDSHStack>
</XDSVStack>
) : (
- <XDSHStack hAlign="between" vAlign="start" xstyle={styles.rowPadding}>
+ <XDSHStack hAlign="between" vAlign="start">
<XDSVStack gap={0}>
<XDSText type="body" weight="semibold" display="block">
{label}
@@ -225,7 +206,7 @@ function InfoRowItem({
}) {
return (
<>
- <XDSHStack hAlign="between" vAlign="start" xstyle={styles.rowPadding}>
+ <XDSHStack hAlign="between" vAlign="start">
<XDSVStack gap={0}>
<XDSText type="body" weight="semibold" display="block">
{label}
@@ -296,15 +277,13 @@ export default function SettingsDialogTemplate() {
xstyle={styles.dialogHeight}>
<XDSLayout
height="fill"
- xstyle={styles.layoutFill}
start={
<XDSLayoutPanel
width={280}
hasDivider
role="navigation"
- padding={0}
- xstyle={styles.panelFull}>
- <XDSVStack gap={4} xstyle={styles.sideNavPadding}>
+ padding={3}>
+ <XDSVStack gap={4}>
<XDSHeading level={2} xstyle={styles.sideNavHeading}>
Account settings
</XDSHeading>
@@ -334,428 +313,403 @@ export default function SettingsDialogTemplate() {
</XDSLayoutPanel>
}
content={
- <XDSLayoutContent isScrollable padding={0}>
- <XDSVStack xstyle={styles.headerPadding}>
- <XDSDialogHeader
- title={
- activeNav === 'Personal information'
- ? 'Personal info'
- : activeNav
- }
- onOpenChange={open => setIsOpen(open)}
- hasDivider={false}
- />
- </XDSVStack>
- <XDSVStack gap={0} xstyle={styles.contentHPadding}>
- {activeNav === 'Personal information' && (
- <XDSVStack gap={6}>
- <XDSVStack gap={0}>
- <ExpandableRow
- label="Legal name"
- value={legalName}
- isExpanded={expandedRow === 'legalName'}
- onEdit={() => handleEdit('legalName')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSTextInput
+ <XDSLayoutContent isScrollable padding={6}>
+ <XDSVStack gap={6}>
+ <XDSVStack xstyle={styles.headerSticky}>
+ <XDSDialogHeader
+ title={
+ activeNav === 'Personal information'
+ ? 'Personal info'
+ : activeNav
+ }
+ onOpenChange={open => setIsOpen(open)}
+ hasDivider={false}
+ />
+ </XDSVStack>
+ <XDSVStack gap={0} xstyle={styles.contentMaxWidth}>
+ {activeNav === 'Personal information' && (
+ <XDSVStack gap={6}>
+ <XDSVStack gap={4}>
+ <ExpandableRow
label="Legal name"
- isLabelHidden
value={legalName}
- onChange={setLegalName}
- />
- </ExpandableRow>
- <ExpandableRow
- label="Preferred first name"
- value={preferredName || 'Not provided'}
- isExpanded={expandedRow === 'preferredName'}
- onEdit={() => handleEdit('preferredName')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSTextInput
+ isExpanded={expandedRow === 'legalName'}
+ onEdit={() => handleEdit('legalName')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSTextInput
+ label="Legal name"
+ isLabelHidden
+ value={legalName}
+ onChange={setLegalName}
+ />
+ </ExpandableRow>
+ <ExpandableRow
label="Preferred first name"
- isLabelHidden
- value={preferredName}
- onChange={setPreferredName}
- />
- </ExpandableRow>
- <ExpandableRow
- label="Email address"
- value={email}
- isExpanded={expandedRow === 'email'}
- onEdit={() => handleEdit('email')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSTextInput
+ value={preferredName || 'Not provided'}
+ isExpanded={expandedRow === 'preferredName'}
+ onEdit={() => handleEdit('preferredName')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSTextInput
+ label="Preferred first name"
+ isLabelHidden
+ value={preferredName}
+ onChange={setPreferredName}
+ />
+ </ExpandableRow>
+ <ExpandableRow
label="Email address"
- isLabelHidden
value={email}
- onChange={setEmail}
- />
- </ExpandableRow>
- <ExpandableRow
- label="Phone number"
- value={phone}
- isExpanded={expandedRow === 'phone'}
- onEdit={() => handleEdit('phone')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSTextInput
+ isExpanded={expandedRow === 'email'}
+ onEdit={() => handleEdit('email')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSTextInput
+ label="Email address"
+ isLabelHidden
+ value={email}
+ onChange={setEmail}
+ />
+ </ExpandableRow>
+ <ExpandableRow
label="Phone number"
- isLabelHidden
value={phone}
- onChange={setPhone}
+ isExpanded={expandedRow === 'phone'}
+ onEdit={() => handleEdit('phone')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSTextInput
+ label="Phone number"
+ isLabelHidden
+ value={phone}
+ onChange={setPhone}
+ />
+ </ExpandableRow>
+ <InfoRowItem
+ label="Identity verification"
+ value="Verified"
+ action=""
/>
- </ExpandableRow>
- <InfoRowItem
- label="Identity verification"
- value="Verified"
- action=""
- />
- <ExpandableRow
- label="Residential address"
- value={address || 'Not provided'}
- isExpanded={expandedRow === 'address'}
- onEdit={() => handleEdit('address')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSTextInput
+ <ExpandableRow
label="Residential address"
- isLabelHidden
- value={address}
- onChange={setAddress}
- />
- </ExpandableRow>
- <ExpandableRow
- label="Mailing address"
- value={mailingAddress || 'Not provided'}
- isExpanded={expandedRow === 'mailingAddress'}
- onEdit={() => handleEdit('mailingAddress')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSTextInput
+ value={address || 'Not provided'}
+ isExpanded={expandedRow === 'address'}
+ onEdit={() => handleEdit('address')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSTextInput
+ label="Residential address"
+ isLabelHidden
+ value={address}
+ onChange={setAddress}
+ />
+ </ExpandableRow>
+ <ExpandableRow
label="Mailing address"
- isLabelHidden
- value={mailingAddress}
- onChange={setMailingAddress}
- />
- </ExpandableRow>
- <ExpandableRow
- label="Emergency contact"
- value={emergencyContact}
- isExpanded={expandedRow === 'emergencyContact'}
- onEdit={() => handleEdit('emergencyContact')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSTextInput
+ value={mailingAddress || 'Not provided'}
+ isExpanded={expandedRow === 'mailingAddress'}
+ onEdit={() => handleEdit('mailingAddress')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSTextInput
+ label="Mailing address"
+ isLabelHidden
+ value={mailingAddress}
+ onChange={setMailingAddress}
+ />
+ </ExpandableRow>
+ <ExpandableRow
label="Emergency contact"
- isLabelHidden
value={emergencyContact}
- onChange={setEmergencyContact}
- />
- </ExpandableRow>
- </XDSVStack>
-
- <XDSCard padding={0}>
- <XDSVStack gap={0} xstyle={styles.cardContentPadding}>
- <XDSHStack
- gap={3}
- vAlign="start"
- xstyle={styles.rowPadding}>
- <XDSCenter
- width={48}
- height={48}
- xstyle={styles.iconBox}>
- <XDSIcon icon={LockClosedIcon} />
- </XDSCenter>
- <XDSVStack gap={0}>
- <XDSText
- type="body"
- weight="semibold"
- display="block">
- Why isn&apos;t my info shown here?
- </XDSText>
- <XDSText
- type="supporting"
- color="secondary"
- display="block">
- We&apos;re hiding some account details to protect
- your identity.
- </XDSText>
- </XDSVStack>
- </XDSHStack>
- <XDSDivider />
- <XDSHStack
- gap={3}
- vAlign="start"
- xstyle={styles.rowPadding}>
- <XDSCenter
- width={48}
- height={48}
- xstyle={styles.iconBox}>
- <XDSIcon icon={PencilSquareIcon} />
- </XDSCenter>
- <XDSVStack gap={0}>
- <XDSText
- type="body"
- weight="semibold"
- display="block">
- Which details can be edited?
- </XDSText>
- <XDSText
- type="supporting"
- color="secondary"
- display="block">
- Contact info and personal details can be edited.
- If this info was used to verify your identity,
- you&apos;ll need to get verified again the next
- time you book—or to continue hosting.
- </XDSText>
- </XDSVStack>
- </XDSHStack>
- <XDSDivider />
- <XDSHStack
- gap={3}
- vAlign="start"
- xstyle={styles.rowPadding}>
- <XDSCenter
- width={48}
- height={48}
- xstyle={styles.iconBox}>
- <XDSIcon icon={ShareIcon} />
- </XDSCenter>
- <XDSVStack gap={0}>
- <XDSText
- type="body"
- weight="semibold"
- display="block">
- What info is shared with others?
- </XDSText>
- <XDSText
- type="supporting"
- color="secondary"
- display="block">
- We only release contact information after a
- reservation is confirmed.
- </XDSText>
- </XDSVStack>
- </XDSHStack>
+ isExpanded={expandedRow === 'emergencyContact'}
+ onEdit={() => handleEdit('emergencyContact')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSTextInput
+ label="Emergency contact"
+ isLabelHidden
+ value={emergencyContact}
+ onChange={setEmergencyContact}
+ />
+ </ExpandableRow>
</XDSVStack>
- </XDSCard>
- </XDSVStack>
- )}
-
- {activeNav === 'Login & security' && (
- <XDSVStack gap={6}>
- <XDSTabList
- value={activeTab}
- onChange={setActiveTab}
- hasDivider>
- <XDSTab value="login" label="Login" />
- <XDSTab value="shared" label="Shared access" />
- </XDSTabList>
-
- {activeTab === 'login' && (
- <XDSVStack gap={8}>
- <XDSVStack gap={0}>
- <XDSHeading level={3} xstyle={styles.sectionHeading}>
- Login
- </XDSHeading>
- <XDSDivider />
- {LOGIN_ROWS.map(row => (
- <InfoRowItem key={row.label} {...row} />
- ))}
- </XDSVStack>
- <XDSVStack gap={0}>
- <XDSHeading level={3} xstyle={styles.sectionHeading}>
- Social accounts
- </XDSHeading>
- <XDSDivider />
- {SOCIAL_ROWS.map(row => (
- <InfoRowItem key={row.label} {...row} />
- ))}
- </XDSVStack>
-
- <XDSVStack gap={0}>
- <XDSHeading level={3} xstyle={styles.sectionHeading}>
- Device history
- </XDSHeading>
- <XDSDivider />
- {DEVICE_ROWS.map((device, i) => (
- <React.Fragment key={i}>
- <XDSHStack
- gap={3}
- vAlign="start"
- xstyle={styles.rowPadding}>
- <XDSIcon icon={ComputerDesktopIcon} />
- <XDSStackItem size="fill">
- <XDSVStack gap={0}>
- <XDSHStack gap={2} vAlign="center">
- <XDSText type="body" weight="semibold">
- {device.label}
- </XDSText>
- {device.badge && (
- <XDSBadge label={device.badge} />
- )}
- </XDSHStack>
- <XDSText
- type="supporting"
- color="secondary"
- display="block">
- {device.location}
- </XDSText>
- </XDSVStack>
- </XDSStackItem>
- {device.action && (
- <XDSLink href="#">{device.action}</XDSLink>
- )}
- </XDSHStack>
- <XDSDivider />
- </React.Fragment>
- ))}
- </XDSVStack>
-
- <XDSVStack gap={0}>
- <XDSHeading level={3} xstyle={styles.sectionHeading}>
- Account
- </XDSHeading>
- <XDSDivider />
- <XDSHStack
- hAlign="between"
- vAlign="start"
- xstyle={styles.rowPadding}>
+ <XDSCard padding={4}>
+ <XDSVStack gap={4}>
+ <XDSHStack gap={3} vAlign="start">
+ <XDSCenter
+ width={48}
+ height={48}
+ xstyle={styles.iconBox}>
+ <XDSIcon icon={LockClosedIcon} />
+ </XDSCenter>
<XDSVStack gap={0}>
<XDSText
type="body"
weight="semibold"
display="block">
- Deactivate your account
+ Why isn&apos;t my info shown here?
</XDSText>
<XDSText
type="supporting"
color="secondary"
display="block">
- This action cannot be undone
+ We&apos;re hiding some account details to
+ protect your identity.
</XDSText>
</XDSVStack>
- <XDSLink href="#">Deactivate</XDSLink>
</XDSHStack>
<XDSDivider />
- </XDSVStack>
- </XDSVStack>
- )}
-
- {activeTab === 'shared' && (
- <XDSVStack gap={8}>
- <XDSVStack gap={2}>
- <XDSHeading level={3} xstyle={styles.sectionHeading}>
- Shared access
- </XDSHeading>
+ <XDSHStack gap={3} vAlign="start">
+ <XDSCenter
+ width={48}
+ height={48}
+ xstyle={styles.iconBox}>
+ <XDSIcon icon={PencilSquareIcon} />
+ </XDSCenter>
+ <XDSVStack gap={0}>
+ <XDSText
+ type="body"
+ weight="semibold"
+ display="block">
+ Which details can be edited?
+ </XDSText>
+ <XDSText
+ type="supporting"
+ color="secondary"
+ display="block">
+ Contact info and personal details can be edited.
+ If this info was used to verify your identity,
+ you&apos;ll need to get verified again the next
+ time you book—or to continue hosting.
+ </XDSText>
+ </XDSVStack>
+ </XDSHStack>
<XDSDivider />
- <XDSText type="body" color="secondary">
- Review each request carefully before approving
- access. We&apos;ll email your employee or co-worker
- a 4-digit code that lets them log into your account
- with their trusted device.
- </XDSText>
- </XDSVStack>
-
- <XDSCard variant="muted">
- <XDSHStack gap={4} vAlign="start">
+ <XDSHStack gap={3} vAlign="start">
<XDSCenter
width={48}
height={48}
xstyle={styles.iconBox}>
- <XDSIcon icon={LockClosedIcon} />
+ <XDSIcon icon={ShareIcon} />
</XDSCenter>
- <XDSVStack gap={1}>
- <XDSText type="body" weight="bold">
- Adding devices from people you trust
+ <XDSVStack gap={0}>
+ <XDSText
+ type="body"
+ weight="semibold"
+ display="block">
+ What info is shared with others?
</XDSText>
- <XDSText type="body" color="secondary">
- When you approve a request, you grant someone
- full access to your account. They&apos;ll be
- able to change reservations and send messages on
- your behalf.
+ <XDSText
+ type="supporting"
+ color="secondary"
+ display="block">
+ We only release contact information after a
+ reservation is confirmed.
</XDSText>
</XDSVStack>
</XDSHStack>
- </XDSCard>
- </XDSVStack>
- )}
- </XDSVStack>
- )}
-
- {activeNav === 'Languages & currency' && (
- <XDSVStack gap={6}>
- <XDSVStack gap={0}>
- <ExpandableRow
- label="Preferred language"
- value={
- LANGUAGES.find(l => l.value === language)?.label ??
- language
- }
- isExpanded={expandedRow === 'language'}
- onEdit={() => handleEdit('language')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSSelector
- label="Language"
- isLabelHidden
- size="lg"
- value={language}
- onChange={setLanguage}
- options={LANGUAGES}
- />
- </ExpandableRow>
- <ExpandableRow
- label="Preferred currency"
- value={
- CURRENCIES.find(c => c.value === currency)?.label ??
- currency
- }
- isExpanded={expandedRow === 'currency'}
- onEdit={() => handleEdit('currency')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSSelector
- label="Currency"
- isLabelHidden
- size="lg"
- value={currency}
- onChange={setCurrency}
- options={CURRENCIES}
- />
- </ExpandableRow>
- <ExpandableRow
- label="Time zone"
- value={
- TIMEZONES.find(t => t.value === timezone)?.label ??
- timezone
- }
- isExpanded={expandedRow === 'timezone'}
- onEdit={() => handleEdit('timezone')}
- onCancel={handleCancel}
- onSave={handleSave}>
- <XDSSelector
+ </XDSVStack>
+ </XDSCard>
+ </XDSVStack>
+ )}
+
+ {activeNav === 'Login & security' && (
+ <XDSVStack gap={6}>
+ <XDSTabList
+ value={activeTab}
+ onChange={setActiveTab}
+ hasDivider>
+ <XDSTab value="login" label="Login" />
+ <XDSTab value="shared" label="Shared access" />
+ </XDSTabList>
+
+ {activeTab === 'login' && (
+ <XDSVStack gap={8}>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Login</XDSHeading>
+ <XDSDivider />
+ {LOGIN_ROWS.map(row => (
+ <InfoRowItem key={row.label} {...row} />
+ ))}
+ </XDSVStack>
+
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Social accounts</XDSHeading>
+ <XDSDivider />
+ {SOCIAL_ROWS.map(row => (
+ <InfoRowItem key={row.label} {...row} />
+ ))}
+ </XDSVStack>
+
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Device history</XDSHeading>
+ <XDSDivider />
+ {DEVICE_ROWS.map((device, i) => (
+ <React.Fragment key={i}>
+ <XDSHStack gap={3} vAlign="start">
+ <XDSIcon icon={ComputerDesktopIcon} />
+ <XDSStackItem size="fill">
+ <XDSVStack gap={0}>
+ <XDSHStack gap={2} vAlign="center">
+ <XDSText type="body" weight="semibold">
+ {device.label}
+ </XDSText>
+ {device.badge && (
+ <XDSBadge label={device.badge} />
+ )}
+ </XDSHStack>
+ <XDSText
+ type="supporting"
+ color="secondary"
+ display="block">
+ {device.location}
+ </XDSText>
+ </XDSVStack>
+ </XDSStackItem>
+ {device.action && (
+ <XDSLink href="#">{device.action}</XDSLink>
+ )}
+ </XDSHStack>
+ <XDSDivider />
+ </React.Fragment>
+ ))}
+ </XDSVStack>
+
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Account</XDSHeading>
+ <XDSDivider />
+ <XDSHStack hAlign="between" vAlign="start">
+ <XDSVStack gap={0}>
+ <XDSText
+ type="body"
+ weight="semibold"
+ display="block">
+ Deactivate your account
+ </XDSText>
+ <XDSText
+ type="supporting"
+ color="secondary"
+ display="block">
+ This action cannot be undone
+ </XDSText>
+ </XDSVStack>
+ <XDSLink href="#">Deactivate</XDSLink>
+ </XDSHStack>
+ <XDSDivider />
+ </XDSVStack>
+ </XDSVStack>
+ )}
+
+ {activeTab === 'shared' && (
+ <XDSVStack gap={8}>
+ <XDSVStack gap={2}>
+ <XDSHeading level={3}>Shared access</XDSHeading>
+ <XDSDivider />
+ <XDSText type="body" color="secondary">
+ Review each request carefully before approving
+ access. We&apos;ll email your employee or
+ co-worker a 4-digit code that lets them log into
+ your account with their trusted device.
+ </XDSText>
+ </XDSVStack>
+
+ <XDSCard variant="muted">
+ <XDSHStack gap={4} vAlign="start">
+ <XDSCenter
+ width={48}
+ height={48}
+ xstyle={styles.iconBox}>
+ <XDSIcon icon={LockClosedIcon} />
+ </XDSCenter>
+ <XDSVStack gap={1}>
+ <XDSText type="body" weight="bold">
+ Adding devices from people you trust
+ </XDSText>
+ <XDSText type="body" color="secondary">
+ When you approve a request, you grant someone
+ full access to your account. They&apos;ll be
+ able to change reservations and send messages
+ on your behalf.
+ </XDSText>
+ </XDSVStack>
+ </XDSHStack>
+ </XDSCard>
+ </XDSVStack>
+ )}
+ </XDSVStack>
+ )}
+
+ {activeNav === 'Languages & currency' && (
+ <XDSVStack gap={6}>
+ <XDSVStack gap={4}>
+ <ExpandableRow
+ label="Preferred language"
+ value={
+ LANGUAGES.find(l => l.value === language)?.label ??
+ language
+ }
+ isExpanded={expandedRow === 'language'}
+ onEdit={() => handleEdit('language')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSSelector
+ label="Language"
+ isLabelHidden
+ size="lg"
+ value={language}
+ onChange={setLanguage}
+ options={LANGUAGES}
+ />
+ </ExpandableRow>
+ <ExpandableRow
+ label="Preferred currency"
+ value={
+ CURRENCIES.find(c => c.value === currency)?.label ??
+ currency
+ }
+ isExpanded={expandedRow === 'currency'}
+ onEdit={() => handleEdit('currency')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSSelector
+ label="Currency"
+ isLabelHidden
+ size="lg"
+ value={currency}
+ onChange={setCurrency}
+ options={CURRENCIES}
+ />
+ </ExpandableRow>
+ <ExpandableRow
label="Time zone"
- isLabelHidden
- size="lg"
- value={timezone}
- onChange={setTimezone}
- options={TIMEZONES}
- />
- </ExpandableRow>
+ value={
+ TIMEZONES.find(t => t.value === timezone)?.label ??
+ timezone
+ }
+ isExpanded={expandedRow === 'timezone'}
+ onEdit={() => handleEdit('timezone')}
+ onCancel={handleCancel}
+ onSave={handleSave}>
+ <XDSSelector
+ label="Time zone"
+ isLabelHidden
+ size="lg"
+ value={timezone}
+ onChange={setTimezone}
+ options={TIMEZONES}
+ />
+ </ExpandableRow>
+ </XDSVStack>
</XDSVStack>
- </XDSVStack>
- )}
-
- {activeNav === 'Privacy' && (
- <XDSVStack gap={6}>
- <XDSVStack gap={8}>
- <XDSVStack gap={0}>
- <XDSHeading level={3}>Messages</XDSHeading>
- <XDSVStack xstyle={styles.rowPadding}>
+ )}
+
+ {activeNav === 'Privacy' && (
+ <XDSVStack gap={6}>
+ <XDSVStack gap={8}>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Messages</XDSHeading>
<XDSSwitch
label="Show people when I've read their messages."
value={readReceipts}
@@ -763,22 +717,17 @@ export default function SettingsDialogTemplate() {
labelPosition="start"
labelSpacing="spread"
/>
+ <XDSHStack hAlign="between" vAlign="center">
+ <XDSText type="body" weight="semibold">
+ Blocked people
+ </XDSText>
+ <XDSLink href="#">View</XDSLink>
+ </XDSHStack>
+ <XDSDivider />
</XDSVStack>
- <XDSHStack
- hAlign="between"
- vAlign="center"
- xstyle={styles.rowPadding}>
- <XDSText type="body" weight="semibold">
- Blocked people
- </XDSText>
- <XDSLink href="#">View</XDSLink>
- </XDSHStack>
- <XDSDivider />
- </XDSVStack>
- <XDSVStack gap={0}>
- <XDSHeading level={3}>Listings</XDSHeading>
- <XDSVStack xstyle={styles.rowPadding}>
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Listings</XDSHeading>
<XDSSwitch
label="Include my listing(s) in search engines"
description="Turning this on means search engines, like Google, will display your listing page(s) in search results."
@@ -787,106 +736,106 @@ export default function SettingsDialogTemplate() {
labelPosition="start"
labelSpacing="spread"
/>
+ <XDSDivider />
</XDSVStack>
- <XDSDivider />
- </XDSVStack>
- <XDSVStack gap={4}>
- <XDSHeading level={3}>Reviews</XDSHeading>
- <XDSText type="supporting" color="secondary">
- Choose what&apos;s shared when you write a review.{' '}
- <XDSLink href="#" type="supporting">
- Learn more
- </XDSLink>
- </XDSText>
<XDSVStack gap={4}>
+ <XDSHeading level={3}>Reviews</XDSHeading>
+ <XDSText type="supporting" color="secondary">
+ Choose what&apos;s shared when you write a review.{' '}
+ <XDSLink href="#" type="supporting">
+ Learn more
+ </XDSLink>
+ </XDSText>
+ <XDSVStack gap={4}>
+ <XDSSwitch
+ label="Show my home city and country"
+ description="Ex: City and country"
+ value={showCity}
+ onChange={setShowCity}
+ labelPosition="start"
+ labelSpacing="spread"
+ />
+ <XDSSwitch
+ label="Show my trip type"
+ description="Ex: Stayed with kids or pets"
+ value={showTripType}
+ onChange={setShowTripType}
+ labelPosition="start"
+ labelSpacing="spread"
+ />
+ <XDSSwitch
+ label="Show my length of stay"
+ description="Ex: A few nights, about a week, etc."
+ value={showStayLength}
+ onChange={setShowStayLength}
+ labelPosition="start"
+ labelSpacing="spread"
+ />
+ <XDSSwitch
+ label="Show my booked services"
+ description="Ex: Gourmet brunch or tasting menu"
+ value={showServices}
+ onChange={setShowServices}
+ labelPosition="start"
+ labelSpacing="spread"
+ />
+ </XDSVStack>
+ <XDSDivider />
+ </XDSVStack>
+
+ <XDSVStack gap={4}>
+ <XDSHeading level={3}>Data privacy</XDSHeading>
+ <XDSCard>
+ <XDSHStack hAlign="between" vAlign="center">
+ <XDSText type="body">
+ Request my personal data
+ </XDSText>
+ <XDSLink href="#">Request</XDSLink>
+ </XDSHStack>
+ </XDSCard>
<XDSSwitch
- label="Show my home city and country"
- description="Ex: City and country"
- value={showCity}
- onChange={setShowCity}
- labelPosition="start"
- labelSpacing="spread"
- />
- <XDSSwitch
- label="Show my trip type"
- description="Ex: Stayed with kids or pets"
- value={showTripType}
- onChange={setShowTripType}
- labelPosition="start"
- labelSpacing="spread"
- />
- <XDSSwitch
- label="Show my length of stay"
- description="Ex: A few nights, about a week, etc."
- value={showStayLength}
- onChange={setShowStayLength}
- labelPosition="start"
- labelSpacing="spread"
- />
- <XDSSwitch
- label="Show my booked services"
- description="Ex: Gourmet brunch or tasting menu"
- value={showServices}
- onChange={setShowServices}
+ label="Help improve AI-powered features"
+ description="When this is on, we use your data to develop and improve AI models."
+ value={aiFeatures}
+ onChange={setAiFeatures}
labelPosition="start"
labelSpacing="spread"
/>
+ <XDSCard>
+ <XDSHStack hAlign="between" vAlign="center">
+ <XDSText type="body">Delete my account</XDSText>
+ <XDSLink href="#">Delete</XDSLink>
+ </XDSHStack>
+ </XDSCard>
+ <XDSCard variant="muted">
+ <XDSHStack gap={4} vAlign="start">
+ <XDSCenter
+ width={48}
+ height={48}
+ xstyle={styles.iconBox}>
+ <XDSIcon icon={ShieldCheckIcon} />
+ </XDSCenter>
+ <XDSVStack gap={1}>
+ <XDSText type="body" weight="bold">
+ Committed to privacy
+ </XDSText>
+ <XDSText type="supporting" color="secondary">
+ We&apos;re committed to keeping your data
+ protected. See details in our{' '}
+ <XDSLink href="#" type="supporting">
+ Privacy Policy
+ </XDSLink>
+ .
+ </XDSText>
+ </XDSVStack>
+ </XDSHStack>
+ </XDSCard>
</XDSVStack>
- <XDSDivider />
- </XDSVStack>
-
- <XDSVStack gap={4}>
- <XDSHeading level={3}>Data privacy</XDSHeading>
- <XDSCard>
- <XDSHStack hAlign="between" vAlign="center">
- <XDSText type="body">
- Request my personal data
- </XDSText>
- <XDSLink href="#">Request</XDSLink>
- </XDSHStack>
- </XDSCard>
- <XDSSwitch
- label="Help improve AI-powered features"
- description="When this is on, we use your data to develop and improve AI models."
- value={aiFeatures}
- onChange={setAiFeatures}
- labelPosition="start"
- labelSpacing="spread"
- />
- <XDSCard>
- <XDSHStack hAlign="between" vAlign="center">
- <XDSText type="body">Delete my account</XDSText>
- <XDSLink href="#">Delete</XDSLink>
- </XDSHStack>
- </XDSCard>
- <XDSCard variant="muted">
- <XDSHStack gap={4} vAlign="start">
- <XDSCenter
- width={48}
- height={48}
- xstyle={styles.iconBox}>
- <XDSIcon icon={ShieldCheckIcon} />
- </XDSCenter>
- <XDSVStack gap={1}>
- <XDSText type="body" weight="bold">
- Committed to privacy
- </XDSText>
- <XDSText type="supporting" color="secondary">
- We&apos;re committed to keeping your data
- protected. See details in our{' '}
- <XDSLink href="#" type="supporting">
- Privacy Policy
- </XDSLink>
- .
- </XDSText>
- </XDSVStack>
- </XDSHStack>
- </XDSCard>
</XDSVStack>
</XDSVStack>
- </XDSVStack>
- )}
+ )}
+ </XDSVStack>
</XDSVStack>
</XDSLayoutContent>
}