cleanup json view
This commit is contained in:
@@ -6,6 +6,9 @@ input, dialog {
|
||||
@apply bg-black
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
.visible_when_parent_hover {
|
||||
opacity: 0;
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user