diff --git a/.all-contributorsrc b/.all-contributorsrc index 41cf41d..13f196e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -100,6 +100,15 @@ "contributions": [ "code" ] + }, + { + "login": "bcherny", + "name": "Boris Cherny", + "avatar_url": "https://avatars2.githubusercontent.com/u/1761758?v=4", + "profile": "https://performancejs.com", + "contributions": [ + "code" + ] } ] } diff --git a/components/ConversionPanel.js b/components/ConversionPanel.js index 5dcbd30..3b7d7c9 100644 --- a/components/ConversionPanel.js +++ b/components/ConversionPanel.js @@ -103,9 +103,16 @@ export default class ConversionPanel extends PureComponent { fetchJSON = async () => { const url = window.prompt("Enter URL to fetch JSON from a remote server."); if (!url) return; - const res = await unfetch(url); - const json = await res.json(); - this.onChange(JSON.stringify(json, null, 2)); + try { + const res = await unfetch(url); + const json = await res.json(); + this.onChange(JSON.stringify(json, null, 2)); + } catch (e) { + this.setState({ + info: e.message, + infoType: "error" + }); + } }; onChange = async (newValue, leftSplitValue) => { @@ -255,12 +262,14 @@ export default class ConversionPanel extends PureComponent { flex: 1; display: flex; flex-direction: row; + overflow: hidden; } .section { flex: 1; position: relative; - height: calc(100vh - 50px); + display: flex; + flex-direction: column; } .right { @@ -309,6 +318,13 @@ export default class ConversionPanel extends PureComponent { color: #666; font-weight: normal; } + + .panel { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + } `}