Skip to content

Commit 0ce1903

Browse files
committed
Dashboard: Fix theme for BuyWidget in chain page
1 parent 86e3aa8 commit 0ce1903

File tree

1 file changed

+4
-0
lines changed
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client

1 file changed

+4
-0
lines changed

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/BuyFundsSection.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
"use client";
2+
import { useTheme } from "next-themes";
23
import { defineChain, type ThirdwebClient } from "thirdweb";
34
import type { ChainMetadata } from "thirdweb/chains";
45
import { BuyWidget } from "thirdweb/react";
6+
import { getSDKTheme } from "@/utils/sdk-component-theme";
57

68
export function BuyFundsSection(props: {
79
chain: ChainMetadata;
810
client: ThirdwebClient;
911
}) {
12+
const { theme } = useTheme();
1013
return (
1114
<section className="flex flex-col gap-4 items-center justify-center">
1215
<BuyWidget
1316
amount="0"
1417
// eslint-disable-next-line no-restricted-syntax
1518
chain={defineChain(props.chain.chainId)}
1619
client={props.client}
20+
theme={getSDKTheme(theme === "dark" ? "dark" : "light")}
1721
/>
1822
</section>
1923
);

0 commit comments

Comments
 (0)