Skip to content

Commit 70d7fac

Browse files
committed
lint
1 parent 0d21770 commit 70d7fac

File tree

9 files changed

+76
-61
lines changed

9 files changed

+76
-61
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1+
"use client";
12
import { defineChain, type ThirdwebClient } from "thirdweb";
23
import type { ChainMetadata } from "thirdweb/chains";
34
import { BuyWidget } from "thirdweb/react";
4-
import { SectionTitle } from "./SectionTitle";
55

66
export function BuyFundsSection(props: {
77
chain: ChainMetadata;
88
client: ThirdwebClient;
99
}) {
1010
return (
1111
<section className="flex flex-col gap-4 items-center justify-center">
12-
<SectionTitle title="Bridge" />
1312
<BuyWidget
1413
amount="0"
1514
// eslint-disable-next-line no-restricted-syntax

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";
56
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";

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ export type UIOptions = Prettify<
4040
};
4141
} & (
4242
| {
43-
mode: "fund_wallet";
44-
destinationToken: Token;
45-
initialAmount?: string;
46-
presetOptions?: [number, number, number];
47-
}
43+
mode: "fund_wallet";
44+
destinationToken: Token;
45+
initialAmount?: string;
46+
presetOptions?: [number, number, number];
47+
}
4848
| {
49-
mode: "direct_payment";
50-
paymentInfo: {
51-
sellerAddress: Address;
52-
token: Token;
53-
amount: string;
54-
feePayer?: "sender" | "receiver";
55-
};
56-
}
49+
mode: "direct_payment";
50+
paymentInfo: {
51+
sellerAddress: Address;
52+
token: Token;
53+
amount: string;
54+
feePayer?: "sender" | "receiver";
55+
};
56+
}
5757
| { mode: "transaction"; transaction: PreparedTransaction }
5858
)
5959
>;
@@ -283,10 +283,10 @@ export function BridgeOrchestrator({
283283
amount={state.context.destinationAmount}
284284
client={client}
285285
destinationToken={state.context.destinationToken}
286+
mode={uiOptions.mode}
286287
onBack={() => {
287288
send({ type: "BACK" });
288289
}}
289-
mode={uiOptions.mode}
290290
onError={handleError}
291291
onQuoteReceived={handleQuoteReceived}
292292
paymentLinkId={paymentLinkId}

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/QuoteLoader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function getBridgeParams(args: {
204204
if (
205205
paymentMethod.originToken.chainId === destinationToken.chainId &&
206206
paymentMethod.originToken.address.toLowerCase() ===
207-
destinationToken.address.toLowerCase()
207+
destinationToken.address.toLowerCase()
208208
) {
209209
return {
210210
amount: toUnits(amount, destinationToken.decimals),

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.

packages/thirdweb/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,30 @@ export function PaymentDetails({
7272

7373
useQuery({
7474
queryFn: () => {
75-
if (preparedQuote.type === "buy" || preparedQuote.type === "sell" || preparedQuote.type === "transfer") {
75+
if (
76+
preparedQuote.type === "buy" ||
77+
preparedQuote.type === "sell" ||
78+
preparedQuote.type === "transfer"
79+
) {
7680
trackPayEvent({
77-
chainId: preparedQuote.type === "transfer" ? preparedQuote.intent.chainId : preparedQuote.intent.originChainId,
81+
chainId:
82+
preparedQuote.type === "transfer"
83+
? preparedQuote.intent.chainId
84+
: preparedQuote.intent.originChainId,
7885
client,
7986
event: "payment_details",
80-
fromToken: preparedQuote.type === "transfer" ? preparedQuote.intent.tokenAddress : preparedQuote.intent.originTokenAddress,
81-
toChainId: preparedQuote.type === "transfer" ? preparedQuote.intent.chainId : preparedQuote.intent.destinationChainId,
82-
toToken: preparedQuote.type === "transfer" ? preparedQuote.intent.tokenAddress : preparedQuote.intent.destinationTokenAddress,
87+
fromToken:
88+
preparedQuote.type === "transfer"
89+
? preparedQuote.intent.tokenAddress
90+
: preparedQuote.intent.originTokenAddress,
91+
toChainId:
92+
preparedQuote.type === "transfer"
93+
? preparedQuote.intent.chainId
94+
: preparedQuote.intent.destinationChainId,
95+
toToken:
96+
preparedQuote.type === "transfer"
97+
? preparedQuote.intent.tokenAddress
98+
: preparedQuote.intent.destinationTokenAddress,
8399
});
84100
}
85101
},

packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const SuccessScreenWithTheme = (props: SuccessScreenWithThemeProps) => {
9393
const meta = {
9494
args: {
9595
completedStatuses: mockBuyCompletedStatuses,
96-
onDone: () => { },
96+
onDone: () => {},
9797
preparedQuote: simpleBuyQuote,
9898
theme: "dark",
9999
uiOptions: FUND_WALLET_UI_OPTIONS.ethDefault,

0 commit comments

Comments
 (0)