Skip to content

Commit 584a9f8

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

File tree

7 files changed

+908
-3
lines changed

7 files changed

+908
-3
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
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
export function MoveFundsConnectButton(props: {
31+
btnClassName?: string;
32+
connectLabel?: string;
33+
}) {
34+
const { theme } = useTheme();
35+
36+
return (
37+
<ConnectButton
38+
wallets={loginOptions}
39+
client={dashboardClient}
40+
theme={getSDKTheme(theme === "light" ? "light" : "dark")}
41+
accountAbstraction={nebulaAAOptions}
42+
connectButton={{
43+
className: props.btnClassName,
44+
label: props.connectLabel,
45+
}}
46+
detailsButton={{
47+
className: props.btnClassName,
48+
}}
49+
/>
50+
);
51+
}

0 commit comments

Comments
 (0)