Skip to content

Commit e54d63a

Browse files
fix(onboarding): mobile layout polish for signup hero
- Move variant/image switcher to bottom-center on mobile (two stacked strips), keep top-right pinned on tablet+. Drop the portal so the switcher participates in the natural flex flow on mobile and can't overflow the viewport. - Set the hero container to flex-col so main, footer disclaimer and the switcher stack vertically as intended. - Trim mobile bottom padding on the form so the logo/title/CTA stack sits closer to the screen bottom (matching the existing mobile auth pattern) while keeping tablet+ spacing intact. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent f14d5e8 commit e54d63a

1 file changed

Lines changed: 35 additions & 26 deletions

File tree

packages/shared/src/features/onboarding/components/OnboardingSignupHero.tsx

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import Logo, { LogoPosition } from '../../../components/Logo';
66
import { FooterLinks } from '../../../components/footer/FooterLinks';
77
import SignupDisclaimer from '../../../components/auth/SignupDisclaimer';
88
import type { AuthOptionsProps } from '../../../components/auth/common';
9-
import { RootPortal } from '../../../components/tooltips/Portal';
109
import { ErrorBoundary } from '../../../components/ErrorBoundary';
1110
import { ArticleGrid } from '../../../components/cards/article/ArticleGrid';
1211
import { ActiveFeedNameContext } from '../../../contexts/ActiveFeedNameContext';
@@ -445,20 +444,26 @@ const VariantSwitcher = ({
445444
imageMode: ImageMode;
446445
onImageModeChange: (next: ImageMode) => void;
447446
}): ReactElement => (
448-
<RootPortal>
449-
<div
450-
className="pointer-events-auto fixed left-4 right-4 top-4 flex max-w-[calc(100vw-2rem)] flex-wrap items-center justify-end gap-1 rounded-16 border border-border-subtlest-tertiary bg-raw-pepper-90 p-1.5 shadow-2 tablet:left-auto tablet:right-6 tablet:top-6 tablet:max-w-[min(calc(100vw-3rem),32rem)]"
451-
role="toolbar"
452-
aria-label="Background variant"
453-
style={{ zIndex: VARIANT_SWITCHER_Z_INDEX }}
454-
>
455-
<span className="shrink-0 px-2 text-text-quaternary typo-caption2">
447+
<div
448+
className={classNames(
449+
'pointer-events-auto flex items-center gap-1 rounded-16 border border-border-subtlest-tertiary bg-raw-pepper-90 p-1 shadow-2',
450+
// Mobile: inline, centered, two-row stack at the bottom of the flow
451+
'relative z-1 mt-3 max-w-[calc(100vw-1.5rem)] flex-col self-center',
452+
// Tablet+: detach to top-right
453+
'tablet:fixed tablet:right-6 tablet:top-6 tablet:mt-0 tablet:max-w-[min(calc(100vw-3rem),32rem)] tablet:flex-row tablet:flex-wrap tablet:self-auto tablet:p-1.5',
454+
)}
455+
role="toolbar"
456+
aria-label="Background variant"
457+
style={{ zIndex: VARIANT_SWITCHER_Z_INDEX }}
458+
>
459+
<div className="flex items-center gap-1">
460+
<span className="hidden shrink-0 px-2 text-text-quaternary typo-caption2 tablet:inline">
456461
Variant
457462
</span>
458463
<div
459464
role="radiogroup"
460465
aria-label="Background variant"
461-
className="flex flex-wrap items-center gap-1"
466+
className="flex items-center gap-1"
462467
>
463468
{VARIANTS.map((variant) => {
464469
const active = variant.id === value;
@@ -485,14 +490,16 @@ const VariantSwitcher = ({
485490
);
486491
})}
487492
</div>
488-
<div className="mx-1 hidden h-5 w-px bg-border-subtlest-tertiary tablet:block" />
489-
<span className="shrink-0 px-2 text-text-quaternary typo-caption2">
493+
</div>
494+
<div className="mx-1 hidden h-5 w-px bg-border-subtlest-tertiary tablet:block" />
495+
<div className="flex items-center gap-1">
496+
<span className="hidden shrink-0 px-2 text-text-quaternary typo-caption2 tablet:inline">
490497
Image
491498
</span>
492499
<div
493500
role="radiogroup"
494501
aria-label="Image source"
495-
className="flex flex-wrap items-center gap-1"
502+
className="flex items-center gap-1"
496503
>
497504
{IMAGE_MODES.map((mode) => {
498505
const active = mode.id === imageMode;
@@ -520,7 +527,7 @@ const VariantSwitcher = ({
520527
})}
521528
</div>
522529
</div>
523-
</RootPortal>
530+
</div>
524531
);
525532

526533
// =============================================================
@@ -583,7 +590,7 @@ export const OnboardingSignupHero = ({
583590

584591
const splitSignupColumn = (
585592
<>
586-
<main className="relative flex flex-1 flex-col justify-end px-5 pb-[7.5rem] pt-10 tablet:pb-[5.5rem] laptop:justify-center laptop:px-16 laptop:pb-0 laptop:pt-0">
593+
<main className="relative flex flex-1 flex-col items-center justify-end px-5 pb-6 pt-12 tablet:pb-[5.5rem] laptop:items-stretch laptop:justify-center laptop:px-16 laptop:pb-0 laptop:pt-0">
587594
<div
588595
className={classNames(
589596
'flex w-full flex-col gap-6 tablet:gap-7',
@@ -619,9 +626,9 @@ export const OnboardingSignupHero = ({
619626
return (
620627
<div
621628
className={classNames(
622-
'relative isolate flex min-h-dvh w-full overflow-hidden bg-raw-pepper-90 text-text-primary',
629+
'relative isolate flex min-h-dvh w-full flex-col overflow-hidden bg-raw-pepper-90 text-text-primary',
623630
isSplitLayout
624-
? 'onb-bg-split flex-col laptop:grid laptop:grid-cols-2'
631+
? 'onb-bg-split laptop:grid laptop:grid-cols-2'
625632
: 'onb-bg',
626633
)}
627634
>
@@ -743,13 +750,6 @@ export const OnboardingSignupHero = ({
743750
/>
744751
)}
745752

746-
<VariantSwitcher
747-
value={variantId}
748-
onChange={setVariantId}
749-
imageMode={imageMode}
750-
onImageModeChange={setImageMode}
751-
/>
752-
753753
{isSplitLayout ? (
754754
<div className="relative z-1 flex min-h-dvh flex-1 flex-col laptop:col-start-2 laptop:row-start-1 laptop:min-w-0">
755755
<div
@@ -759,7 +759,7 @@ export const OnboardingSignupHero = ({
759759
{splitSignupColumn}
760760
</div>
761761
) : (
762-
<main className="relative z-1 flex w-full flex-1 flex-col items-center justify-end px-5 pb-[7.5rem] pt-10 tablet:pb-[5.5rem] tablet:pt-14">
762+
<main className="relative z-1 flex w-full flex-1 flex-col items-center justify-end px-5 pb-6 pt-12 tablet:pb-[5.5rem] tablet:pt-14">
763763
<div
764764
className={classNames(
765765
'flex w-full flex-col gap-6 tablet:gap-7',
@@ -809,7 +809,7 @@ export const OnboardingSignupHero = ({
809809

810810
<div
811811
className={classNames(
812-
'pointer-events-auto relative z-1 flex w-full flex-col items-center gap-4 px-5 pb-5',
812+
'pointer-events-auto relative z-1 flex w-full flex-col items-center gap-4 px-5',
813813
isSplitLayout ? 'laptop:hidden' : 'tablet:hidden',
814814
)}
815815
>
@@ -818,6 +818,15 @@ export const OnboardingSignupHero = ({
818818
</div>
819819
<SignupDisclaimer className="!text-text-tertiary typo-caption1" />
820820
</div>
821+
822+
<VariantSwitcher
823+
value={variantId}
824+
onChange={setVariantId}
825+
imageMode={imageMode}
826+
onImageModeChange={setImageMode}
827+
/>
828+
829+
<div className="h-3 w-full tablet:hidden" />
821830
</div>
822831
);
823832
};

0 commit comments

Comments
 (0)