cleanup json view

This commit is contained in:
Victor Oliva
2024-10-23 17:11:42 +02:00
parent 86e376b39f
commit bb7d761ee7
2 changed files with 4 additions and 22 deletions
+3
View File
@@ -6,6 +6,9 @@ input, dialog {
@apply bg-black
}
:root {
color-scheme: dark;
}
.visible_when_parent_hover {
opacity: 0;
+1 -22
View File
@@ -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 (
<div className="overflow-auto p-2 bg-polkadot-900 text-sm">
@@ -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(