Skip to content

Commit 0aa72e3

Browse files
committed
Migrate In-app wallet settings page to shadcn/tailwind (#4360)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR updates global CSS variables, adds a new API key field, and refactors components for In-App Wallet settings. ### Detailed summary - Updated global CSS variables for input and ring styles - Added `redirectUrls` field to `UpdateKeyInput` interface - Added `InAppWalletSettingsUI` storybook component - Refactored `Configure` and `index` components for In-App Wallet settings > The following files were skipped due to too many changes: `apps/dashboard/src/components/embedded-wallets/Configure/index.tsx` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 1198dc7 commit 0aa72e3

File tree

4 files changed

+610
-552
lines changed

4 files changed

+610
-552
lines changed

apps/dashboard/src/@/styles/globals.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
/* Borders */
3737
--border: 0 0% 80%;
38-
--input: var(--border);
39-
--ring: 215.88 100% 60%;
38+
--input: 0 0% 80%;
39+
--ring: 0 0% 85%;
4040

4141
/* Others */
4242
--radius: 0.5rem;

apps/dashboard/src/@3rdweb-sdk/react/hooks/useApi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,14 @@ interface CreateKeyInput {
180180
services?: UpdateKeyServiceInput[];
181181
}
182182

183-
interface UpdateKeyInput {
183+
export interface UpdateKeyInput {
184184
id: string;
185185
name: string;
186186
domains: string[];
187187
bundleIds: string[];
188188
walletAddresses?: string[];
189189
services?: UpdateKeyServiceInput[];
190+
redirectUrls: string[];
190191
}
191192

192193
interface UsageBundler {
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import type { ApiKey, ApiKeyService } from "@3rdweb-sdk/react/hooks/useApi";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
import { InAppWalletSettingsUI } from "./index";
4+
5+
const meta = {
6+
title: "settings/in-app-wallet",
7+
component: Variants,
8+
parameters: {
9+
nextjs: {
10+
appDirectory: true,
11+
},
12+
},
13+
} satisfies Meta<typeof Variants>;
14+
15+
export default meta;
16+
type Story = StoryObj<typeof meta>;
17+
18+
export const GrowthPlan: Story = {
19+
args: {
20+
canEditAdvancedFeatures: true,
21+
},
22+
};
23+
24+
export const FreePlan: Story = {
25+
args: {
26+
canEditAdvancedFeatures: false,
27+
},
28+
};
29+
30+
const embeddedWalletService: ApiKeyService = {
31+
id: "embeddedWallets",
32+
name: "embeddedWallets", // important
33+
targetAddresses: [],
34+
actions: [],
35+
};
36+
37+
const apiKeyStub: ApiKey = {
38+
id: "api-key-id-foo",
39+
name: "api key name foo",
40+
key: "key-foobar",
41+
accountId: "account-id-foo",
42+
bundleIds: ["bundle-id-foo", "bundle-id-bar"],
43+
createdAt: new Date().toISOString(),
44+
creatorWalletAddress: "0x1F846F6DAE38E1C88D71EAA191760B15f38B7A37",
45+
domains: ["example1.com", "example2.com"],
46+
secretMasked: "",
47+
walletAddresses: ["0x1F846F6DAE38E1C88D71EAA191760B15f38B7A37"],
48+
redirectUrls: [],
49+
revokedAt: "",
50+
lastAccessedAt: new Date().toISOString(),
51+
updatedAt: new Date().toISOString(),
52+
services: [embeddedWalletService],
53+
};
54+
55+
function Variants(props: {
56+
canEditAdvancedFeatures: boolean;
57+
}) {
58+
return (
59+
<div className="min-h-screen bg-background p-6 text-foreground max-w-[1140px] mx-auto">
60+
<div className="flex gap-10 flex-col">
61+
<InAppWalletSettingsUI
62+
canEditAdvancedFeatures={props.canEditAdvancedFeatures}
63+
apiKey={apiKeyStub}
64+
isUpdating={false}
65+
trackingCategory="foo"
66+
updateApiKey={() => {}}
67+
/>
68+
</div>
69+
</div>
70+
);
71+
}

0 commit comments

Comments
 (0)