Skip to content

Commit baf98d0

Browse files
committed
Nebula: Add Move funds page
1 parent 2510c4f commit baf98d0

File tree

9 files changed

+1119
-10
lines changed

9 files changed

+1119
-10
lines changed

apps/dashboard/src/@/components/ui/decimal-input.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export function DecimalInput(props: {
55
maxValue?: number;
66
id?: string;
77
className?: string;
8+
placeholder?: string;
89
}) {
910
return (
1011
<Input
@@ -13,6 +14,7 @@ export function DecimalInput(props: {
1314
value={props.value}
1415
className={props.className}
1516
inputMode="decimal"
17+
placeholder={props.placeholder}
1618
onChange={(e) => {
1719
const number = Number(e.target.value);
1820
// ignore if string becomes invalid number

apps/dashboard/src/app/nebula-app/(app)/components/ChatPageLayout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { cn } from "@/lib/utils";
2+
import { TWAutoConnect } from "../../../(app)/components/autoconnect";
3+
import { nebulaAAOptions } from "../../login/account-abstraction";
24
import type { TruncatedSessionInfo } from "../api/types";
5+
import { nebulaAppThirdwebClient } from "../utils/nebulaThirdwebClient";
36
import { ChatSidebar } from "./ChatSidebar";
47
import { MobileNav } from "./NebulaMobileNav";
58

@@ -27,6 +30,11 @@ export function ChatPageLayout(props: {
2730

2831
<MobileNav sessions={props.sessions} authToken={props.authToken} />
2932

33+
<TWAutoConnect
34+
accountAbstraction={nebulaAAOptions}
35+
client={nebulaAppThirdwebClient}
36+
/>
37+
3038
{props.children}
3139
</div>
3240
);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
"use client";
2+
3+
import { useTheme } from "next-themes";
4+
import { ConnectButton } from "thirdweb/react";
5+
import { inAppWallet } from "thirdweb/wallets";
6+
import { getSDKTheme } from "../../(app)/components/sdk-component-theme";
7+
import { getClientThirdwebClient } from "../../../@/constants/thirdweb-client.client";
8+
import { nebulaAAOptions } from "../login/account-abstraction";
9+
10+
// use dashboard client to allow users to connect to their original wallet and move funds to a different wallet
11+
const dashboardClient = getClientThirdwebClient();
12+
13+
// since only the inApp and smart wallets were affected, only show in-app option
14+
const loginOptions = [
15+
inAppWallet({
16+
auth: {
17+
options: [
18+
"google",
19+
"apple",
20+
"facebook",
21+
"github",
22+
"email",
23+
"phone",
24+
"passkey",
25+
],
26+
},
27+
}),
28+
];
29+
30+
// Note: This component has autoConnect enabled
31+
export function MoveFundsConnectButton(props: {
32+
btnClassName?: string;
33+
connectLabel?: string;
34+
}) {
35+
const { theme } = useTheme();
36+
37+
return (
38+
<ConnectButton
39+
wallets={loginOptions}
40+
client={dashboardClient}
41+
theme={getSDKTheme(theme === "light" ? "light" : "dark")}
42+
accountAbstraction={nebulaAAOptions}
43+
connectButton={{
44+
className: props.btnClassName,
45+
label: props.connectLabel,
46+
}}
47+
detailsButton={{
48+
className: props.btnClassName,
49+
}}
50+
/>
51+
);
52+
}

0 commit comments

Comments
 (0)