Skip to content

Commit fbfccbc

Browse files
committed
[Dashboard] Refactor PayPage client initialization and enhance OnRampScreen props
- Replaced the client initialization in PayPage to use `payAppThirdwebClient` instead of `getClientThirdwebClient`. - Updated OnRampScreen to accept and utilize `paymentLinkId` prop, enhancing the component's functionality for payment link handling.
1 parent fc93a94 commit fbfccbc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/dashboard/src/app/pay/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Metadata } from "next";
22
import { createThirdwebClient, defineChain, getContract } from "thirdweb";
33
import { getCurrencyMetadata } from "thirdweb/extensions/erc20";
44
import { checksumAddress } from "thirdweb/utils";
5-
import { getClientThirdwebClient } from "../../@/constants/thirdweb-client.client";
65
import { PayPageEmbed } from "./components/client/PayPageEmbed.client";
76
import { PaymentLinkForm } from "./components/client/PaymentLinkForm.client";
87
import type { PayParams } from "./components/types";
@@ -59,7 +58,7 @@ export default async function PayPage({
5958
const client =
6059
params.clientId && !Array.isArray(params.clientId)
6160
? createThirdwebClient({ clientId: params.clientId })
62-
: getClientThirdwebClient(undefined);
61+
: payAppThirdwebClient;
6362

6463
const tokenContract = getContract({
6564
client: payAppThirdwebClient,

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function OnRampScreen(props: {
8686
payer: props.payer,
8787
theme: props.theme,
8888
isAutoMode,
89+
paymentLinkId: props.paymentLinkId,
8990
});
9091
const firstStepChainId = state.steps[0]?.step.token.chainId;
9192
return (
@@ -289,6 +290,7 @@ function useOnRampScreenState(props: {
289290
payer: PayerInfo;
290291
theme: "light" | "dark";
291292
isAutoMode?: boolean;
293+
paymentLinkId?: string;
292294
}): OnRampScreenState {
293295
const onRampSteps = getOnRampSteps(props.quote);
294296
const [currentStepIndex, setCurrentStepIndex] = useState(0);
@@ -323,6 +325,7 @@ function useOnRampScreenState(props: {
323325
client: props.client,
324326
payer: props.payer,
325327
isFiatFlow: true,
328+
paymentLinkId: props.paymentLinkId,
326329
});
327330

328331
// Track swap status

0 commit comments

Comments
 (0)