Skip to content

Commit 49d29be

Browse files
committed
fix: remove extra divs
1 parent 49074ab commit 49d29be

File tree

2 files changed

+45
-47
lines changed

2 files changed

+45
-47
lines changed

src/containers/Inspector.tsx

+44-47
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const Inspector: React.FC<IProps> = (props) => {
119119
};
120120

121121
return (
122-
<div style={{ height: "100%" }}>
122+
<>
123123
<AppBar position="static" elevation={0} color="default">
124124
<Toolbar>
125125
<img
@@ -150,53 +150,50 @@ const Inspector: React.FC<IProps> = (props) => {
150150
}
151151
</Toolbar>
152152
</AppBar>
153-
<div style={{ display: "flex", marginBottom: "-80px" }}>
154-
<SplitPane
155-
split="vertical"
156-
minSize={100}
157-
maxSize={-100}
158-
defaultSize={"50%"}
159-
style={{ flexGrow: 1 }}
160-
onChange={() => {
161-
if (editorRef && editorRef.current) {
162-
(editorRef.current as any).layout();
163-
}
164-
}}>
165-
<div style={{ width: "99%", padding: "10px" }}>
166-
<JSONRPCRequest
167-
onChange={(val) => setJson(JSON.parse(val))}
168-
openrpcMethodObject={props.openrpcMethodObject}
169-
value={JSON.stringify(json, null, 4)}
170-
/>
171-
</div>
172-
<div style={{ height: "100%", padding: "10px", overflowY: "auto", paddingBottom: "80px" }}>
173-
{(results || error) &&
174-
<Button
175-
style={{ position: "absolute", top: "15px", right: "15px", zIndex: 1 }}
176-
onClick={handleClearButton}>
177-
Clear
153+
<SplitPane
154+
split="vertical"
155+
minSize={100}
156+
maxSize={-100}
157+
defaultSize={"50%"}
158+
style={{ flexGrow: 1 }}
159+
onChange={() => {
160+
if (editorRef && editorRef.current) {
161+
(editorRef.current as any).layout();
162+
}
163+
}}>
164+
<JSONRPCRequest
165+
onChange={(val) => setJson(JSON.parse(val))}
166+
openrpcMethodObject={props.openrpcMethodObject}
167+
value={JSON.stringify(json, null, 4)}
168+
/>
169+
<>
170+
{(results || error) &&
171+
<Button
172+
style={{ position: "absolute", top: "15px", right: "15px", zIndex: 1 }}
173+
onClick={handleClearButton}>
174+
Clear
178175
</Button>
179-
}
180-
<Editor
181-
options={{
182-
minimap: {
183-
enabled: false,
184-
},
185-
wordWrap: "on",
186-
lineNumbers: "off",
187-
wrappingIndent: "deepIndent",
188-
readOnly: true,
189-
showFoldingControls: "always",
190-
}}
191-
editorDidMount={handleResponseEditorDidMount}
192-
theme={darkMode.value ? "dark" : "light"}
193-
language="json"
194-
value={JSON.stringify(error || results, null, 4) || ""}
195-
/>
196-
</div>
197-
</SplitPane >
198-
</div>
199-
</div>
176+
}
177+
<Editor
178+
options={{
179+
minimap: {
180+
enabled: false,
181+
},
182+
wordWrap: "on",
183+
lineNumbers: "off",
184+
wrappingIndent: "deepIndent",
185+
readOnly: true,
186+
showFoldingControls: "always",
187+
}}
188+
height="100vh"
189+
editorDidMount={handleResponseEditorDidMount}
190+
theme={darkMode.value ? "dark" : "light"}
191+
language="json"
192+
value={JSON.stringify(error || results, null, 4) || ""}
193+
/>
194+
</>
195+
</SplitPane>
196+
</>
200197
);
201198
};
202199

src/containers/JSONRPCRequest.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const JSONRPCRequest: React.FC<IProps> = (props) => {
9595
return (
9696
<>
9797
<ControlledEditor
98+
height="100vh"
9899
theme={darkMode.value ? "dark" : "light"}
99100
value={props.value}
100101
editorDidMount={handleEditorDidMount}

0 commit comments

Comments
 (0)