add light theme support, underline links to block detail
This commit is contained in:
@@ -5,26 +5,31 @@ import ReactJson from "react18-json-view"
|
||||
import "react18-json-view/src/dark.css"
|
||||
import "react18-json-view/src/style.css"
|
||||
import "./jsonDisplay.css"
|
||||
import { useTheme } from "@/ThemeProvider"
|
||||
|
||||
export const JsonDisplay: FC<{
|
||||
src: unknown
|
||||
}> = ({ src }) => (
|
||||
<ReactJson
|
||||
src={src}
|
||||
dark
|
||||
theme="a11y"
|
||||
replacer={(v) => (v instanceof Binary ? bytesToString(v) : v)}
|
||||
customizeCopy={(v) =>
|
||||
JSON.stringify(
|
||||
v,
|
||||
(_, v) =>
|
||||
typeof v === "bigint"
|
||||
? `${v}n`
|
||||
: v instanceof Binary
|
||||
? bytesToString(v)
|
||||
: v,
|
||||
2,
|
||||
)
|
||||
}
|
||||
/>
|
||||
)
|
||||
}> = ({ src }) => {
|
||||
const theme = useTheme()
|
||||
|
||||
return (
|
||||
<ReactJson
|
||||
src={src}
|
||||
dark={theme === "dark"}
|
||||
theme="a11y"
|
||||
replacer={(v) => (v instanceof Binary ? bytesToString(v) : v)}
|
||||
customizeCopy={(v) =>
|
||||
JSON.stringify(
|
||||
v,
|
||||
(_, v) =>
|
||||
typeof v === "bigint"
|
||||
? `${v}n`
|
||||
: v instanceof Binary
|
||||
? bytesToString(v)
|
||||
: v,
|
||||
2,
|
||||
)
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user