diff --git a/components/contract-viewer/index.tsx b/components/contract-viewer/index.tsx index 55f75b5..700ddf2 100644 --- a/components/contract-viewer/index.tsx +++ b/components/contract-viewer/index.tsx @@ -4,12 +4,14 @@ import React from "react"; import { useSearchParams } from "next/navigation"; import { useWallet } from "@/data/wallet"; import { ContractView } from "aelf-smartcontract-viewer"; +import { useTheme } from "next-themes"; const sideChainTestnetRpc = "https://explorer-test-side02.aelf.io/chain"; const ContractViewer = ({ name }: { name: string }) => { const searchParams = useSearchParams(); const wallet = useWallet(); + const { resolvedTheme } = useTheme(); const contractViewerAddress = searchParams.get("contract-viewer-address"); if (!contractViewerAddress || !wallet?.wallet) { @@ -23,6 +25,7 @@ const ContractViewer = ({ name }: { name: string }) => { headerTitle={"Contract View"} rpcUrl={sideChainTestnetRpc} contractName={name} + theme={resolvedTheme as "dark" | "light"} /> ); }; diff --git a/package-lock.json b/package-lock.json index a1cc208..44239e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "@xterm/addon-fit": "^0.10.0", "@xterm/xterm": "^5.5.0", "aelf-sdk": "^3.4.14-beta.1", - "aelf-smartcontract-viewer": "^1.0.2", + "aelf-smartcontract-viewer": "^1.0.5", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cmdk": "^1.0.0", @@ -4923,9 +4923,9 @@ } }, "node_modules/aelf-smartcontract-viewer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/aelf-smartcontract-viewer/-/aelf-smartcontract-viewer-1.0.2.tgz", - "integrity": "sha512-hJwHYSoaf6kuY29MgVJJRdHGKm6LrxplFRC7pm2gtgQGtIckKZpNvRP9YUs1jeDd2Rqy619Hkuom7s5HYlZqZQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/aelf-smartcontract-viewer/-/aelf-smartcontract-viewer-1.0.5.tgz", + "integrity": "sha512-ksC1Z+jR4LEtZQzEsYCaTkgNLNozeoG0QpDbko0oceCSuzp/jkZe0kMRgqvNdvIViiRlZXQBcWgTChApeysV7Q==", "license": "ISC", "dependencies": { "@portkey/contracts": "^2.11.0-alpha.16", diff --git a/package.json b/package.json index 8db253a..dcc5af5 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@xterm/addon-fit": "^0.10.0", "@xterm/xterm": "^5.5.0", "aelf-sdk": "^3.4.14-beta.1", - "aelf-smartcontract-viewer": "^1.0.2", + "aelf-smartcontract-viewer": "^1.0.5", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cmdk": "^1.0.0",