Files
freeCodeCamp/common/app/routes/challenges/components/classic/Output.jsx
2016-07-28 23:39:17 -07:00

33 lines
711 B
JavaScript

import React, { PropTypes } from 'react';
import PureComponent from 'react-pure-render/component';
import NoSSR from 'react-no-ssr';
import Codemirror from 'react-codemirror';
const defaultOptions = {
lineNumbers: false,
mode: 'javascript',
theme: 'monokai',
readOnly: 'nocursor',
lineWrapping: true
};
export default class extends PureComponent {
static displayName = 'Output';
static propTypes = {
output: PropTypes.string
};
render() {
const { output } = this.props;
return (
<div className='challenge-log'>
<NoSSR>
<Codemirror
options={ defaultOptions }
value={ output }
/>
</NoSSR>
</div>
);
}
}