From bb7d761ee7042f2a7654f468b29d2c188d8dbe7a Mon Sep 17 00:00:00 2001 From: Victor Oliva Date: Wed, 23 Oct 2024 17:11:42 +0200 Subject: [PATCH] cleanup json view --- src/index.css | 3 +++ src/pages/Extrinsics/JsonMode.tsx | 23 +---------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/index.css b/src/index.css index f7a1369..2c472b5 100644 --- a/src/index.css +++ b/src/index.css @@ -6,6 +6,9 @@ input, dialog { @apply bg-black } +:root { + color-scheme: dark; +} .visible_when_parent_hover { opacity: 0; diff --git a/src/pages/Extrinsics/JsonMode.tsx b/src/pages/Extrinsics/JsonMode.tsx index d46c9d4..04e2731 100644 --- a/src/pages/Extrinsics/JsonMode.tsx +++ b/src/pages/Extrinsics/JsonMode.tsx @@ -10,23 +10,7 @@ export const JsonMode: FC<{ decode: (value: Uint8Array) => unknown value: Uint8Array | null }> = ({ decode, value }) => { - const src = useMemo( - () => (value ? decode(value) : null), - // value - // ? JSON.parse( - // JSON.stringify(decode(value), (_, v) => - // typeof v === "bigint" - // ? `${v}n` - // : v instanceof Binary - // ? bytesToString(v) - // : v, - // ), - // ) - // : null, - [value, decode], - ) - - console.log(src) + const src = useMemo(() => (value ? decode(value) : null), [value, decode]) return (
@@ -34,11 +18,6 @@ export const JsonMode: FC<{ src={src} dark theme="a11y" - // customizeNode={({ node }) => { - // if (node instanceof Binary) { - // return <>{node.asHex()} - // } - // }} replacer={(v) => (v instanceof Binary ? bytesToString(v) : v)} customizeCopy={(v) => JSON.stringify(