diff --git a/src/explorer/details.js b/src/explorer/details.js index 983f859..4fe48b8 100644 --- a/src/explorer/details.js +++ b/src/explorer/details.js @@ -69,7 +69,7 @@ class Details extends React.Component { - Signature : {entryData.signature}

- - Data : {entryData.data} + - Data : {_this.formatData(entryData.data)}

)} @@ -119,6 +119,18 @@ class Details extends React.Component { handleClose () { _this.props.onClose() } + + formatData (data) { + try { + const parsed = JSON.parse(data) + const str = JSON.stringify(parsed, null, 2) + + return str + } catch (error) { + console.warn('error in formatData', error) + return data + } + } } Details.propTypes = { entry: PropTypes.object,