Skip to content

Commit

Permalink
chore: fix types and cleanup (#90)
Browse files Browse the repository at this point in the history
* chore: fix type and cleanup

* chore: remove unused default value

* chore: remove unused from index.tsx

* chore: remove local

* chore: remove unused import
  • Loading branch information
nickbytes authored Aug 9, 2022
1 parent e8aab94 commit 0ece05a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 76 deletions.
15 changes: 2 additions & 13 deletions packages/inspector/components/TraitsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
import { trait } from "../types";
import { Trait } from "../types";
import { isOdd } from "../util";

export const TraitsTable = ({
name,
loading,
tokenId,
attributes,
}: {
name: string;
loading: boolean;
tokenId: number;
attributes: trait[];
}) => {
const Loading = () => "loading";
export const TraitsTable = ({ name, attributes }: { name: string; attributes: Trait[] }) => {
return (
<div className="flex w-full flex-col">
<span className="w-full px-8 py-2 text-label font-bold bg-[#21262d]">{name}</span>
Expand Down
10 changes: 0 additions & 10 deletions packages/inspector/hooks/useLocalRPC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ type NFTState = {
rawSvg: string;
};

const nftStateDefault: NFTState = {
status: FetchStatus.UNFETCHED,
metadata: {
image: "",
attributes: [],
},
tokenId: -1,
rawSvg: "",
};

const LOCAL_RPC_URI = "http://localhost:8545";
export const useLocalRPC = () => {
const [bibosContract, setBibosContract] = useState<Contract>(null);
Expand Down
12 changes: 2 additions & 10 deletions packages/inspector/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { useState } from "react";
import SyntaxHighlighter from "react-syntax-highlighter";
import { xml } from "@codemirror/lang-xml";
import { EditorView } from "@codemirror/view";
import { basicSetup } from "codemirror";
import CodeMirror from "@uiw/react-codemirror";
import { syntaxHighlighting, bracketMatching, foldGutter, codeFolding } from "@codemirror/language";
import { syntaxHighlighting, foldGutter, codeFolding } from "@codemirror/language";
import { highlightDark, themeDark } from "../components/CodeMirrorTheme";

import { FetchStatus } from "../types";
Expand Down Expand Up @@ -37,7 +35,6 @@ export default function Index() {
<CodeMirror
className="w-full h-full border-none scrollbar-none"
value={formattedSvg}
// height={ '100%' }
basicSetup={{
foldGutter: false,
}}
Expand Down Expand Up @@ -106,12 +103,7 @@ export default function Index() {
/>
</div>

<TraitsTable
loading={status == FetchStatus.UNFETCHED}
tokenId={token.tokenId}
name={token.name}
attributes={token.attributes}
/>
<TraitsTable name={token.name} attributes={token.attributes} />
<HorizontalRule />
<Toolbar>
<Button
Expand Down
43 changes: 0 additions & 43 deletions packages/inspector/pages/local.tsx

This file was deleted.

0 comments on commit 0ece05a

Please sign in to comment.