mirror of
https://github.com/AykutSarac/jsoncrack.com.git
synced 2025-02-04 01:32:54 +08:00
refactor
This commit is contained in:
parent
8ecd67baf6
commit
5a02cb8809
@ -10,22 +10,20 @@ export const TreeView = () => {
|
||||
const json = useJson(state => state.json);
|
||||
|
||||
return (
|
||||
<>
|
||||
<JSONTree
|
||||
hideRoot
|
||||
data={JSON.parse(json)}
|
||||
valueRenderer={(valueAsString, value) => <Value {...{ valueAsString, value }} />}
|
||||
labelRenderer={(keyPath, nodeType) => <Label {...{ keyPath, nodeType }} />}
|
||||
theme={{
|
||||
extend: {
|
||||
overflow: "scroll",
|
||||
height: "100%",
|
||||
scheme: "monokai",
|
||||
author: "wimer hazenberg (http://www.monokai.nl)",
|
||||
base00: theme.GRID_BG_COLOR,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
<JSONTree
|
||||
hideRoot
|
||||
data={JSON.parse(json)}
|
||||
valueRenderer={(valueAsString, value) => <Value {...{ valueAsString, value }} />}
|
||||
labelRenderer={(keyPath, nodeType) => <Label {...{ keyPath, nodeType }} />}
|
||||
theme={{
|
||||
extend: {
|
||||
overflow: "scroll",
|
||||
height: "100%",
|
||||
scheme: "monokai",
|
||||
author: "wimer hazenberg (http://www.monokai.nl)",
|
||||
base00: theme.GRID_BG_COLOR,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
@ -178,8 +178,8 @@ const useFile = create<FileStates & JsonActions>()((set, get) => ({
|
||||
}
|
||||
},
|
||||
checkEditorSession: (url, widget) => {
|
||||
if (url && typeof url === "string") {
|
||||
if (isURL(url)) return get().fetchUrl(url);
|
||||
if (url && typeof url === "string" && isURL(url)) {
|
||||
return get().fetchUrl(url);
|
||||
}
|
||||
|
||||
let contents = defaultJson;
|
||||
|
Loading…
x
Reference in New Issue
Block a user