Skip to content

Commit 155206d

Browse files
authored
feat: add SMS early access call out to demo app (#2119)
1 parent de34972 commit 155206d

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

examples/ui-demo/src/components/configuration/Authentication.tsx

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { GoogleIcon } from "../icons/google";
88
import { DiscordLogo } from "../icons/discord";
99
import { LockIcon } from "../icons/lock";
1010
import { MailIcon } from "../icons/mail";
11+
import { PhoneIcon } from "../icons/phone";
1112
import { SocialIcon } from "../icons/social";
1213
import { TwitterIcon } from "../icons/twitter";
1314
import { WalletIcon } from "../icons/wallet";
@@ -159,6 +160,34 @@ export const Authentication = ({ className }: { className?: string }) => {
159160
active={auth.showEmail}
160161
setActive={setEmailAuth}
161162
/>
163+
<AuthMethod
164+
icon={<PhoneIcon />}
165+
name="SMS"
166+
active={false}
167+
nameClassName="opacity-100"
168+
unavailable={
169+
<ExternalLink
170+
href={links.sms || "#"}
171+
onClick={() => {
172+
Metrics.trackEvent({
173+
name: "clicked_sms_early_access",
174+
});
175+
}}
176+
className="flex items-center gap-2"
177+
>
178+
<div className="ml-auto px-2 py-0.5 bg-demo-surface-secondary rounded-full flex gap-1">
179+
<span className="text-sm text-brand font-semibold">
180+
Early access
181+
</span>
182+
</div>
183+
<ExternalLinkIcon
184+
height={16}
185+
width={16}
186+
className="stroke-secondary"
187+
/>
188+
</ExternalLink>
189+
}
190+
/>
162191
<AuthMethod
163192
icon={<SocialIcon />}
164193
name="Social"
@@ -286,17 +315,19 @@ const AuthMethod = ({
286315
className,
287316
callout,
288317
iconClassName,
318+
nameClassName,
289319
}: {
290320
icon: React.ReactNode;
291321
name: string;
292322
details?: React.ReactNode;
293323
active?: boolean;
294324
disabled?: boolean;
295-
unavailable?: boolean;
325+
unavailable?: React.ReactNode | boolean;
296326
setActive?: (active: boolean) => void;
297327
className?: string;
298328
callout?: React.ReactNode;
299329
iconClassName?: string;
330+
nameClassName?: string;
300331
}) => {
301332
return (
302333
<div
@@ -310,7 +341,11 @@ const AuthMethod = ({
310341
<div className="ml-2 flex-1 flex flex-col gap-3">
311342
<div className="flex flex-1 min-w-full flex-row justify-between items-center">
312343
<label
313-
className={cn("font-medium text-sm", unavailable && "opacity-50")}
344+
className={cn(
345+
"font-medium text-sm",
346+
unavailable && "opacity-50",
347+
nameClassName,
348+
)}
314349
htmlFor={`${name}-auth-method`}
315350
>
316351
{name}
@@ -329,9 +364,15 @@ const AuthMethod = ({
329364
</div>
330365

331366
{unavailable && (
332-
<div className="ml-auto border px-2 py-1 rounded-sm bg-purple-50 border-purple-50">
333-
<p className="text-xs font-semibold text-purple-500">Soon</p>
334-
</div>
367+
<>
368+
{typeof unavailable === "boolean" ? (
369+
<div className="ml-auto border px-2 py-1 rounded-sm bg-purple-50 border-purple-50">
370+
<p className="text-xs font-semibold text-purple-500">Soon</p>
371+
</div>
372+
) : (
373+
unavailable
374+
)}
375+
</>
335376
)}
336377
</div>
337378
{callout}

examples/ui-demo/src/metrics.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ type DemoEvents = [
22
{
33
name: "logged_in";
44
},
5+
{
6+
name: "clicked_sms_early_access";
7+
},
58
{
69
name: "authentication_toggled";
710
data: {

examples/ui-demo/src/utils/links.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export const links = {
88
dashboard: `https://dashboard.alchemy.com/accounts?utm_source=demo_alchemy_com&utm_medium=referral&utm_campaign=demo_to_dashboard`,
99
passkey: "https://www.alchemy.com/docs/wallets/core/add-passkey",
1010
auth0: "https://www.alchemy.com/docs/wallets/signer/authentication/auth0",
11+
sms: "https://alchemyapi.typeform.com/to/GLXIYjKz",
1112
};

0 commit comments

Comments
 (0)