Skip to content

Commit

Permalink
Merge pull request #50 from AElfProject/feature/upgrade-version
Browse files Browse the repository at this point in the history
feat: upgrade the aelf-smartcontract-viewer package with dark/light theme fun…
  • Loading branch information
yongenaelf authored Oct 17, 2024
2 parents 9289e7e + 70d5710 commit 8a48e46
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions components/contract-viewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -23,6 +25,7 @@ const ContractViewer = ({ name }: { name: string }) => {
headerTitle={"Contract View"}
rpcUrl={sideChainTestnetRpc}
contractName={name}
theme={resolvedTheme as "dark" | "light"}
/>
);
};
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 8a48e46

Please sign in to comment.