Skip to content

Commit 1ccb629

Browse files
committed
clean up
1 parent dac030e commit 1ccb629

9 files changed

Lines changed: 31 additions & 401 deletions

File tree

apps/connect/src/routes/_remote/rpc/-frames/connect/WelcomeBack.tsx

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Button } from '#/ui/Button.js'
22
import { Frame } from '#/ui/Frame.js'
33
import { Identicon } from '#/ui/Identicon.js'
4-
import ChevronRight from '~icons/lucide/chevron-right'
54
import Fingerprint from '~icons/lucide/fingerprint'
65
import 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. */
99
export 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
}

apps/connect/src/routes/_remote/rpc/wallet_connect.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function WelcomeBack(props: { onSignUp: () => void; submit: Submit }) {
9090
loading={submit.isPending}
9191
onContinue={() => submit.mutate({})}
9292
onCreateNew={onSignUp}
93-
onSwitchAccount={() => submit.mutate({ selectAccount: true })}
93+
onSignIn={() => submit.mutate({ selectAccount: true })}
9494
/>
9595
)
9696
}
@@ -105,7 +105,7 @@ function SignIn(props: { submit: Submit }) {
105105
<Frames.SignIn
106106
error={submit.error?.message}
107107
host={host}
108-
onPasskey={() => submit.mutate({ method: 'login' })}
108+
onPasskey={() => submit.mutate({ method: 'login', selectAccount: true })}
109109
onSubmit={(email) => submit.mutate({ method: 'register', name: email })}
110110
passkeyLoading={submit.isPending}
111111
registerLoading={submit.isPending}

apps/connect/worker/auth.test.ts

Lines changed: 0 additions & 130 deletions
This file was deleted.

apps/connect/worker/lib/otp.test.ts

Lines changed: 0 additions & 85 deletions
This file was deleted.

apps/connect/worker/lib/otp.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)