2016-03-05 21:06:04 -08:00
|
|
|
import React from 'react';
|
|
|
|
import PureComponent from 'react-pure-render/component';
|
2016-05-27 17:11:25 -07:00
|
|
|
import NoSSR from 'react-no-ssr';
|
2016-03-05 21:06:04 -08:00
|
|
|
import Codemirror from 'react-codemirror';
|
|
|
|
|
|
|
|
const defaultOutput = `/**
|
|
|
|
* Your output will go here.
|
|
|
|
* Any console.log() -type
|
|
|
|
* statements will appear in
|
|
|
|
* your browser\'s DevTools
|
|
|
|
* JavaScript console.
|
|
|
|
*/`;
|
|
|
|
|
|
|
|
const defaultOptions = {
|
|
|
|
lineNumbers: false,
|
2016-05-27 17:11:25 -07:00
|
|
|
mode: 'javascript',
|
2016-03-05 21:06:04 -08:00
|
|
|
theme: 'monokai',
|
|
|
|
readOnly: 'nocursor',
|
|
|
|
lineWrapping: true
|
|
|
|
};
|
|
|
|
|
|
|
|
export default class extends PureComponent {
|
|
|
|
static displayName = 'Output';
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
output: defaultOutput
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { output } = this.props;
|
|
|
|
return (
|
|
|
|
<div className='challenge-log'>
|
2016-05-27 17:11:25 -07:00
|
|
|
<NoSSR>
|
|
|
|
<Codemirror
|
|
|
|
options={ defaultOptions }
|
|
|
|
value={ output } />
|
|
|
|
</NoSSR>
|
2016-03-05 21:06:04 -08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|