Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanjohan committed Jul 9, 2024
1 parent e7f0f83 commit b28ccdd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ type ModuleResourceProps = {

const GROUP_ARRAYS_AFTER_LENGTH = 100;
const COLLAPSE_STRINGS_AFTER_LENGTH = 80;
const MAX_CARD_HEIGHT = 500;


export const ModuleResource = ({
key,
resource,
Expand All @@ -25,6 +24,7 @@ export const ModuleResource = ({
<>
<div>{resource.type}</div>
<ReactJson
key={key}
src={resource.data}
collapseStringsAfterLength={COLLAPSE_STRINGS_AFTER_LENGTH}
displayObjectSize={false}
Expand Down
18 changes: 6 additions & 12 deletions packages/nextjs/app/debug/_components/contract/ModuleResources.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { FunctionForm } from "~~/app/debug/_components/contract";
import { Contract, ContractName } from "~~/utils/scaffold-move/contract";
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
import { useEffect, useState } from 'react';
import {Types} from "aptos";
import {useGetAccountResources} from "~~/hooks/scaffold-move";
import { ModuleResource } from "./ModuleResource";

Expand All @@ -12,16 +8,14 @@ export const ModuleResources = ({
}: {
deployedContractData: Contract<ContractName>;
}) => {
if (!deployedContractData || deployedContractData.abi === undefined) {
return null;
}

const {isLoading, data, error} = useGetAccountResources(deployedContractData.abi!.address);


const [accountResources, setAccountResources] =
useState<Types.MoveResource[] | null>(null);

if (error) {
return <>Cannot fetch resources.
{error.type && <p>Error: {error.type}</p>}
{error.message && <p>Error message: {error.message}</p>}
</>;
}

if (!data?.length) {
return <>No resources</>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const AddressInfoDropdown = ({
useOutsideClick(dropdownRef, closeDropdown);


const { disconnect, wallet } = useWallet();
const { disconnect } = useWallet();
return (
<>
<details ref={dropdownRef} className="dropdown dropdown-end leading-3">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useTheme } from "next-themes";
import { ArrowsRightLeftIcon } from "@heroicons/react/24/solid";
import { getTargetNetworks } from "~~/utils/scaffold-eth";

Expand All @@ -10,8 +9,6 @@ type NetworkOptionsProps = {

export const NetworkOptions = ({ hidden = false }: NetworkOptionsProps) => {
const chain = "devnet"; // TODO: Get this from wallet?
const { resolvedTheme } = useTheme();
const isDarkMode = resolvedTheme === "dark";

return (
<>
Expand Down

0 comments on commit b28ccdd

Please sign in to comment.