Skip to content

Commit 22b12a3

Browse files
add onboarding email verification setting strip
Introduce a compact settings-row layout for the require-email-verification toggle, intended as the main onboarding control surface. Made-with: Cursor
1 parent d23fbbd commit 22b12a3

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"use client";
2+
3+
import { Switch, Typography } from "@/components/ui";
4+
import { EnvelopeSimple } from "@phosphor-icons/react";
5+
6+
const DESCRIPTION =
7+
"Require a verified primary email before users can continue after sign-up.";
8+
9+
const SWITCH_ID = "onboarding-email-verification";
10+
11+
export type OnboardingEmailVerificationSettingProps = {
12+
isEnabled: boolean,
13+
isToggling: boolean,
14+
onCheckedChange: (checked: boolean) => void,
15+
};
16+
17+
/**
18+
* Settings-strip layout: label + description + switch in one compact row.
19+
*/
20+
export function OnboardingEmailVerificationSetting({
21+
isEnabled,
22+
isToggling,
23+
onCheckedChange,
24+
}: OnboardingEmailVerificationSettingProps) {
25+
return (
26+
<div className="flex flex-col gap-3 rounded-2xl bg-foreground/[0.02] p-4 ring-1 ring-foreground/[0.06] sm:flex-row sm:items-center sm:justify-between">
27+
<div className="flex min-w-0 items-start gap-3">
28+
<div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-foreground/[0.04] ring-1 ring-foreground/[0.06]">
29+
<EnvelopeSimple className="h-4 w-4 text-muted-foreground" />
30+
</div>
31+
<label htmlFor={SWITCH_ID} className="min-w-0 cursor-pointer">
32+
<Typography className="text-sm font-medium text-foreground">
33+
Require email verification
34+
</Typography>
35+
<Typography variant="secondary" className="text-xs">
36+
{DESCRIPTION}
37+
</Typography>
38+
</label>
39+
</div>
40+
<div className="flex shrink-0 justify-end sm:pl-4">
41+
<Switch
42+
id={SWITCH_ID}
43+
checked={isEnabled}
44+
disabled={isToggling}
45+
loading={isToggling}
46+
onCheckedChange={onCheckedChange}
47+
/>
48+
</div>
49+
</div>
50+
);
51+
}

0 commit comments

Comments
 (0)