diff --git a/common/app/routes/Challenges/Output.jsx b/common/app/routes/Challenges/Output.jsx index b63b6f1b6b..d73d0cef48 100644 --- a/common/app/routes/Challenges/Output.jsx +++ b/common/app/routes/Challenges/Output.jsx @@ -1,10 +1,12 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; +import { connect } from 'react-redux'; import NoSSR from 'react-no-ssr'; import Codemirror from 'react-codemirror'; import ns from './ns.json'; import CodeMirrorSkeleton from './Code-Mirror-Skeleton.jsx'; +import { themeSelector } from '../../redux'; const defaultOptions = { lineNumbers: false, @@ -13,19 +15,23 @@ const defaultOptions = { readOnly: 'nocursor' }; +const mapStateToProps = state => ({ theme: themeSelector(state) }); + const propTypes = { defaultOutput: PropTypes.string, - output: PropTypes.string + output: PropTypes.string, + theme: PropTypes.string }; -export default class Output extends PureComponent { +export class Output extends PureComponent { render() { const { output, defaultOutput } = this.props; + const cmTheme = this.props.theme === 'default' ? 'default' : 'dracula'; return (