11import { Button } from '#/ui/Button.js'
22import { Frame } from '#/ui/Frame.js'
33import { Identicon } from '#/ui/Identicon.js'
4- import ChevronRight from '~icons/lucide/chevron-right'
54import Fingerprint from '~icons/lucide/fingerprint'
65import LogIn from '~icons/lucide/log-in'
6+ import UserPlus from '~icons/lucide/user-plus'
77
88/** Returning user with a connected wallet — sign in with existing passkey or switch account. */
99export function WelcomeBack ( props : WelcomeBack . Props ) {
10- const { address, error, host, label, loading, onContinue, onCreateNew, onSwitchAccount } = props
10+ const { address, error, host, label, loading, onContinue, onCreateNew, onSignIn } = props
1111
1212 return (
1313 < form
@@ -32,17 +32,12 @@ export function WelcomeBack(props: WelcomeBack.Props) {
3232 />
3333 < Frame . Footer >
3434 < div className = "flex flex-col gap-4" >
35- < button
36- className = "flex h-[38px] w-full cursor-pointer items-center gap-3 rounded-lg bg-mute px-3 transition-colors hover:bg-mute-hover"
37- onClick = { onSwitchAccount }
38- type = "button"
39- >
35+ < div className = "flex h-[38px] w-full items-center gap-3 rounded-lg bg-mute px-3" >
4036 { address && (
4137 < Identicon address = { address } className = "size-6 shrink-0 rounded-full" size = { 24 } />
4238 ) }
4339 < p className = "min-w-0 flex-1 truncate text-left text-label-13" > { label } </ p >
44- < ChevronRight className = "size-4 shrink-0 text-foreground-secondary" />
45- </ button >
40+ </ div >
4641 < Button
4742 loading = { loading }
4843 prefix = { < Fingerprint className = "size-4" /> }
@@ -52,12 +47,30 @@ export function WelcomeBack(props: WelcomeBack.Props) {
5247 Continue with passkey
5348 </ Button >
5449 { error && < p className = "text-label-13 text-red-9" > { error } </ p > }
50+
51+ < div className = "flex items-center gap-3" >
52+ < div className = "h-px flex-1 bg-border" />
53+ < p className = "text-label-12 text-foreground-secondary" > or</ p >
54+ < div className = "h-px flex-1 bg-border" />
55+ </ div >
56+
57+ < Button
58+ onClick = { onSignIn }
59+ prefix = { < Fingerprint className = "size-4" /> }
60+ type = "button"
61+ variant = "muted"
62+ >
63+ Sign in with another account
64+ </ Button >
5565 < button
5666 className = "cursor-pointer text-label-13 text-foreground-secondary transition-colors hover:text-foreground"
5767 onClick = { onCreateNew }
5868 type = "button"
5969 >
60- Create another account
70+ < span className = "inline-flex items-center gap-1.5" >
71+ < UserPlus className = "size-3.5" />
72+ Create a new account
73+ </ span >
6174 </ button >
6275 </ div >
6376 </ Frame . Footer >
@@ -78,11 +91,11 @@ export declare namespace WelcomeBack {
7891 label ?: string | undefined
7992 /** Whether the passkey action is in progress. */
8093 loading ?: boolean | undefined
81- /** Called when the user clicks "Continue with passkey". */
94+ /** Called when the user clicks "Continue with passkey" for the displayed account . */
8295 onContinue ?: ( ( ) => void ) | undefined
83- /** Called when the user clicks "Create another account". */
96+ /** Called when the user clicks "Create a new account". */
8497 onCreateNew ?: ( ( ) => void ) | undefined
85- /** Called when the user clicks the account row to switch . */
86- onSwitchAccount ?: ( ( ) => void ) | undefined
98+ /** Called when the user clicks "Sign in with another account" — prompts all passkeys . */
99+ onSignIn ?: ( ( ) => void ) | undefined
87100 }
88101}
0 commit comments