Skip to content

Commit 41869c3

Browse files
committed
feat(app): refine onboarding card and wallet connect loading
1 parent 751c76a commit 41869c3

5 files changed

Lines changed: 84 additions & 13 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import clsx from 'clsx';
2+
import Image from 'next/image';
3+
import styles from './styles.module.scss';
4+
5+
interface AbstractBadgeProps {
6+
className?: string;
7+
}
8+
9+
export default function AbstractBadge({ className }: AbstractBadgeProps) {
10+
return (
11+
<div className={clsx(styles.badge, className)}>
12+
<Image
13+
src="/assets/images/Abstract_AppIcon_LightMode.svg"
14+
alt="Abstract AGW icon"
15+
width={72}
16+
height={72}
17+
priority
18+
/>
19+
</div>
20+
);
21+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@import '@/styles/mixins';
2+
3+
.badge {
4+
width: 72px;
5+
height: 72px;
6+
line-height: 0;
7+
}

app/src/components/SessionWizard/steps/NotLoggedIn.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client';
22

33
import Button from '@/@abstract-ui/components/Button';
4+
import AbstractBadge from '@/components/AbstractBadge';
45
import {
56
Card,
67
CardContent,
@@ -13,21 +14,33 @@ import { useSessionWizardState } from '@/hooks/useSessionWizardState';
1314
import styles from '../styles.module.scss';
1415

1516
export default function NotLoggedIn() {
16-
const { login } = useSessionWizardState();
17+
const { login, isLoginPending } = useSessionWizardState();
1718

1819
return (
1920
<div className={styles.wrapper}>
2021
<Card>
21-
<CardHeader gradient />
22-
<CardContent className={styles.content}>
23-
<CardTitle>Create AGW Session Key</CardTitle>
22+
<CardHeader gradient>
23+
<div className={styles.badge}>
24+
<AbstractBadge />
25+
</div>
26+
</CardHeader>
27+
<CardContent className={styles.loginContent}>
28+
<CardTitle>AGW MCP Server Onboarding</CardTitle>
2429
<CardDescription>
25-
Connect with Abstract Global Wallet to configure and create a scoped session key.
30+
Connect your Abstract Global Wallet to finish AGW MCP Server setup for local tools.
31+
After login, you will choose a scoped session policy and create a session for secure
32+
automated actions. This flow only configures MCP access for this machine.
2633
</CardDescription>
2734
</CardContent>
2835
<CardFooter className={styles.footer}>
29-
<Button className={styles.footerButton} height="40" variant="primary" onClick={login}>
30-
Connect with Abstract
36+
<Button
37+
className={styles.footerButton}
38+
height="40"
39+
variant="primary"
40+
disabled={isLoginPending}
41+
onClick={login}
42+
>
43+
{isLoginPending ? 'Connecting wallet...' : 'Login with AGW'}
3144
</Button>
3245
</CardFooter>
3346
</Card>

app/src/components/SessionWizard/styles.module.scss

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838

3939
.walletAddress {
4040
margin: 0;
41-
font-size: 34px;
42-
line-height: 1;
41+
font-size: 22px;
42+
line-height: 1.15;
4343
letter-spacing: -0.03em;
4444
font-weight: 500;
4545
}
@@ -57,6 +57,17 @@
5757
padding: 20px 24px 16px;
5858
}
5959

60+
.loginContent {
61+
text-align: center;
62+
}
63+
64+
.badge {
65+
position: absolute;
66+
top: 50%;
67+
left: 50%;
68+
transform: translate(-50%, -50%);
69+
}
70+
6071
.sectionTitle {
6172
margin: 0;
6273
text-align: center;
@@ -89,6 +100,17 @@
89100
color: #2a313c;
90101
}
91102

103+
.select {
104+
appearance: none;
105+
-webkit-appearance: none;
106+
-moz-appearance: none;
107+
padding-right: 40px;
108+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.5 5.5L7 9L10.5 5.5' stroke='%233D4450' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
109+
background-repeat: no-repeat;
110+
background-size: 14px 14px;
111+
background-position: right 16px center;
112+
}
113+
92114
.textarea {
93115
border-radius: 14px;
94116
min-height: 200px;

app/src/hooks/useSessionWizardState.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
'use client';
22

3-
import { useLoginWithAbstract } from '@abstract-foundation/agw-react';
4-
import { useAccount } from 'wagmi';
5-
import { useEffect } from 'react';
3+
import { useCallback, useEffect } from 'react';
4+
import { useAccount, useConnect } from 'wagmi';
65
import useSessionWizardStore from '@/stores/useSessionWizardStore';
76

87
export function useSessionWizardState() {
9-
const { login } = useLoginWithAbstract();
108
const { isConnected, address } = useAccount();
9+
const { connect, connectors, isPending: isLoginPending } = useConnect();
10+
11+
const login = useCallback(() => {
12+
const connector = connectors.find(c => c.id === 'xyz.abs.privy');
13+
if (!connector) {
14+
throw new Error('Abstract connector not found');
15+
}
16+
connect({ connector });
17+
}, [connect, connectors]);
1118

1219
const currentStep = useSessionWizardStore(state => state.currentStep);
1320
const agwAddress = useSessionWizardStore(state => state.agwAddress);
@@ -53,6 +60,7 @@ export function useSessionWizardState() {
5360
markCreationSuccess,
5461
markCreationError,
5562
isConnected,
63+
isLoginPending,
5664
login,
5765
};
5866
}

0 commit comments

Comments
 (0)