Highlight ViewSource and Devtools ViewSource
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
843505f6a9
commit
8a7477f50c
5 changed files with 89 additions and 8 deletions
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue