Skip to content

Commit

Permalink
fix: remove extra divs
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Dec 5, 2019
1 parent 49074ab commit 49d29be
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 47 deletions.
91 changes: 44 additions & 47 deletions src/containers/Inspector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const Inspector: React.FC<IProps> = (props) => {
};

return (
<div style={{ height: "100%" }}>
<>
<AppBar position="static" elevation={0} color="default">
<Toolbar>
<img
Expand Down Expand Up @@ -150,53 +150,50 @@ const Inspector: React.FC<IProps> = (props) => {
}
</Toolbar>
</AppBar>
<div style={{ display: "flex", marginBottom: "-80px" }}>
<SplitPane
split="vertical"
minSize={100}
maxSize={-100}
defaultSize={"50%"}
style={{ flexGrow: 1 }}
onChange={() => {
if (editorRef && editorRef.current) {
(editorRef.current as any).layout();
}
}}>
<div style={{ width: "99%", padding: "10px" }}>
<JSONRPCRequest
onChange={(val) => setJson(JSON.parse(val))}
openrpcMethodObject={props.openrpcMethodObject}
value={JSON.stringify(json, null, 4)}
/>
</div>
<div style={{ height: "100%", padding: "10px", overflowY: "auto", paddingBottom: "80px" }}>
{(results || error) &&
<Button
style={{ position: "absolute", top: "15px", right: "15px", zIndex: 1 }}
onClick={handleClearButton}>
Clear
<SplitPane
split="vertical"
minSize={100}
maxSize={-100}
defaultSize={"50%"}
style={{ flexGrow: 1 }}
onChange={() => {
if (editorRef && editorRef.current) {
(editorRef.current as any).layout();
}
}}>
<JSONRPCRequest
onChange={(val) => setJson(JSON.parse(val))}
openrpcMethodObject={props.openrpcMethodObject}
value={JSON.stringify(json, null, 4)}
/>
<>
{(results || error) &&
<Button
style={{ position: "absolute", top: "15px", right: "15px", zIndex: 1 }}
onClick={handleClearButton}>
Clear
</Button>
}
<Editor
options={{
minimap: {
enabled: false,
},
wordWrap: "on",
lineNumbers: "off",
wrappingIndent: "deepIndent",
readOnly: true,
showFoldingControls: "always",
}}
editorDidMount={handleResponseEditorDidMount}
theme={darkMode.value ? "dark" : "light"}
language="json"
value={JSON.stringify(error || results, null, 4) || ""}
/>
</div>
</SplitPane >
</div>
</div>
}
<Editor
options={{
minimap: {
enabled: false,
},
wordWrap: "on",
lineNumbers: "off",
wrappingIndent: "deepIndent",
readOnly: true,
showFoldingControls: "always",
}}
height="100vh"
editorDidMount={handleResponseEditorDidMount}
theme={darkMode.value ? "dark" : "light"}
language="json"
value={JSON.stringify(error || results, null, 4) || ""}
/>
</>
</SplitPane>
</>
);
};

Expand Down
1 change: 1 addition & 0 deletions src/containers/JSONRPCRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const JSONRPCRequest: React.FC<IProps> = (props) => {
return (
<>
<ControlledEditor
height="100vh"
theme={darkMode.value ? "dark" : "light"}
value={props.value}
editorDidMount={handleEditorDidMount}
Expand Down

0 comments on commit 49d29be

Please sign in to comment.