Highlight ViewSource and Devtools ViewSource

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2017-12-20 20:40:41 +00:00
parent 843505f6a9
commit 8a7477f50c
No known key found for this signature in database
GPG key ID: 0435A1D4BBD34D64
5 changed files with 89 additions and 8 deletions

View file

@ -16,14 +16,17 @@ limitations under the License.
'use strict';
var React = require('react');
import React from 'react';
import PropTypes from 'prop-types';
import Highlight from '../views/elements/Highlight';
module.exports = React.createClass({
displayName: 'ViewSource',
propTypes: {
content: React.PropTypes.object.isRequired,
onFinished: React.PropTypes.func.isRequired,
content: PropTypes.object.isRequired,
onFinished: PropTypes.func.isRequired,
},
componentDidMount: function() {
@ -45,9 +48,9 @@ module.exports = React.createClass({
render: function() {
return (
<div className="mx_ViewSource">
<pre>
{JSON.stringify(this.props.content, null, 2)}
</pre>
<Highlight className="json">
{ JSON.stringify(this.props.content, null, 2) }
</Highlight>
</div>
);
}