Skip to content

Commit 4464687

Browse files
committed
Revert "lint"
This reverts commit 52256db.
1 parent 6a3d84a commit 4464687

File tree

12 files changed

+126
-60
lines changed

12 files changed

+126
-60
lines changed

apps/dashboard/public/robots.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# *
22
User-agent: *
3-
Disallow: /
3+
Allow: /
44

55
# Host
66
Host: https://thirdweb.com
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
"use client";
2+
import { useTheme } from "next-themes";
3+
import type { ThirdwebClient } from "thirdweb";
4+
import { PayEmbed } from "thirdweb/react";
5+
import { Button } from "@/components/ui/button";
6+
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
7+
import { defineDashboardChain } from "@/lib/defineDashboardChain";
8+
import { getSDKTheme } from "../../../../../../../../@/utils/sdk-component-theme";
9+
10+
export function PayModalButton(props: {
11+
chainId: number;
12+
label: string;
13+
client: ThirdwebClient;
14+
}) {
15+
const { theme } = useTheme();
16+
17+
return (
18+
<Dialog>
19+
<DialogTrigger asChild>
20+
<Button className="w-full" variant="primary">
21+
{props.label}
22+
</Button>
23+
</DialogTrigger>
24+
<DialogContent
25+
className="border-none bg-transparent p-0 md:max-w-[360px]"
26+
dialogCloseClassName="focus:ring-0"
27+
dialogOverlayClassName="backdrop-blur-lg"
28+
>
29+
<PayEmbed
30+
className="!w-auto"
31+
client={props.client}
32+
payOptions={{
33+
prefillBuy: {
34+
allowEdits: {
35+
amount: true,
36+
chain: false,
37+
token: true,
38+
},
39+
// Do not include local chain overrides for chain pages
40+
// eslint-disable-next-line no-restricted-syntax
41+
chain: defineDashboardChain(props.chainId, undefined),
42+
},
43+
}}
44+
theme={getSDKTheme(theme === "dark" ? "dark" : "light")}
45+
/>
46+
</DialogContent>
47+
</Dialog>
48+
);
49+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
"use client";
21
import { defineChain, type ThirdwebClient } from "thirdweb";
32
import type { ChainMetadata } from "thirdweb/chains";
3+
import { SectionTitle } from "./SectionTitle";
44
import { BuyWidget } from "thirdweb/react";
55

66
export function BuyFundsSection(props: {
@@ -9,11 +9,11 @@ export function BuyFundsSection(props: {
99
}) {
1010
return (
1111
<section className="flex flex-col gap-4 items-center justify-center">
12+
<SectionTitle title="Bridge" />
1213
<BuyWidget
13-
amount="0.01"
14-
// eslint-disable-next-line no-restricted-syntax
15-
chain={defineChain(props.chain.chainId)}
1614
client={props.client}
15+
chain={defineChain(props.chain.chainId)}
16+
amount="0.01"
1717
/>
1818
</section>
1919
);

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { CircleAlertIcon } from "lucide-react";
22
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
33
import { getRawAccount } from "../../../../account/settings/getAccount";
44
import { getChain, getChainMetadata } from "../../utils";
5-
import { BuyFundsSection } from "./components/client/BuyFundsSection";
65
import NextSteps from "./components/client/NextSteps";
6+
import { BuyFundsSection } from "./components/server/BuyFundsSection";
77
import { ChainOverviewSection } from "./components/server/ChainOverviewSection";
88
import { ClaimChainSection } from "./components/server/ClaimChainSection";
99
import { ChainCTA } from "./components/server/cta-card";

apps/login/package.json

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

packages/thirdweb/src/bridge/Buy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ export declare namespace quote {
163163
client: ThirdwebClient;
164164
maxSteps?: number;
165165
} & (
166-
| {
166+
| {
167167
buyAmountWei: bigint;
168168
}
169-
| {
169+
| {
170170
amount: bigint;
171171
}
172-
);
172+
);
173173

174174
type Result = Quote & {
175175
intent: {

packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@ export type BuyWidgetProps = {
166166
type UIOptionsResult =
167167
| { type: "success"; data: UIOptions }
168168
| {
169-
type: "indexing_token";
170-
token: Token;
171-
chain: Chain;
172-
}
169+
type: "indexing_token";
170+
token: Token;
171+
chain: Chain;
172+
}
173173
| {
174-
type: "unsupported_token";
175-
tokenAddress: Address;
176-
chain: Chain;
177-
};
174+
type: "unsupported_token";
175+
tokenAddress: Address;
176+
chain: Chain;
177+
};
178178

179179
/**
180180
* Widget is a prebuilt UI for purchasing a specific token.
@@ -285,7 +285,7 @@ export function BuyWidget(props: BuyWidgetProps) {
285285
!props.tokenAddress ||
286286
(isAddress(props.tokenAddress) &&
287287
checksumAddress(props.tokenAddress) ===
288-
checksumAddress(NATIVE_TOKEN_ADDRESS))
288+
checksumAddress(NATIVE_TOKEN_ADDRESS))
289289
) {
290290
const ETH = await getToken(
291291
props.client,
@@ -455,10 +455,10 @@ type BuyWidgetConnectOptions = {
455455
* ```
456456
*/
457457
autoConnect?:
458-
| {
459-
timeout: number;
460-
}
461-
| boolean;
458+
| {
459+
timeout: number;
460+
}
461+
| boolean;
462462

463463
/**
464464
* Metadata of the app that will be passed to connected wallet. Setting this is highly recommended.

packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ export type CheckoutWidgetProps = {
172172
type UIOptionsResult =
173173
| { type: "success"; data: UIOptions }
174174
| {
175-
type: "indexing_token";
176-
token: Token;
177-
chain: Chain;
178-
}
175+
type: "indexing_token";
176+
token: Token;
177+
chain: Chain;
178+
}
179179
| {
180-
type: "unsupported_token";
181-
tokenAddress: Address;
182-
chain: Chain;
183-
};
180+
type: "unsupported_token";
181+
tokenAddress: Address;
182+
chain: Chain;
183+
};
184184

185185
/**
186186
* Widget a prebuilt UI for purchasing a specific token.
@@ -418,10 +418,10 @@ type CheckoutWidgetConnectOptions = {
418418
* ```
419419
*/
420420
autoConnect?:
421-
| {
422-
timeout: number;
423-
}
424-
| boolean;
421+
| {
422+
timeout: number;
423+
}
424+
| boolean;
425425

426426
/**
427427
* Metadata of the app that will be passed to connected wallet. Setting this is highly recommended.

packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ export type TransactionWidgetProps = {
172172
type UIOptionsResult =
173173
| { type: "success"; data: UIOptions }
174174
| {
175-
type: "indexing_token";
176-
token: Token;
177-
chain: Chain;
178-
}
175+
type: "indexing_token";
176+
token: Token;
177+
chain: Chain;
178+
}
179179
| {
180-
type: "unsupported_token";
181-
tokenAddress: Address;
182-
chain: Chain;
183-
};
180+
type: "unsupported_token";
181+
tokenAddress: Address;
182+
chain: Chain;
183+
};
184184

185185
/**
186186
* Widget a prebuilt UI for purchasing a specific token.
@@ -443,10 +443,10 @@ type TransactionWidgetConnectOptions = {
443443
* ```
444444
*/
445445
autoConnect?:
446-
| {
447-
timeout: number;
448-
}
449-
| boolean;
446+
| {
447+
timeout: number;
448+
}
449+
| boolean;
450450

451451
/**
452452
* Metadata of the app that will be passed to connected wallet. Setting this is highly recommended.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { IconFC } from "./types.js";
2+
3+
/**
4+
* @internal
5+
*/
6+
export const CreditCardIcon: IconFC = (props) => {
7+
return (
8+
<svg
9+
fill="none"
10+
height={props.size}
11+
role="presentation"
12+
stroke={props.color ?? "currentColor"}
13+
strokeLinecap="round"
14+
strokeLinejoin="round"
15+
strokeWidth="1"
16+
viewBox="0 0 24 24"
17+
width={props.size}
18+
xmlns="http://www.w3.org/2000/svg"
19+
>
20+
<rect height="14" rx="2" width="20" x="2" y="5" />
21+
<line x1="2" x2="22" y1="10" y2="10" />
22+
</svg>
23+
);
24+
};

0 commit comments

Comments
 (0)