import React, { PropTypes } from 'react'; import RawEditor from './MarkdownControlElements/RawEditor'; import VisualEditor from './MarkdownControlElements/VisualEditor'; import { connect } from 'react-redux'; import { switchVisualMode } from '../../actions/editor'; class MarkdownControl extends React.Component { constructor(props){ super(props); this.useVisualEditor = this.useVisualEditor.bind(this); this.useRawEditor = this.useRawEditor.bind(this); } useVisualEditor(){ this.props.switchVisualMode(true); } useRawEditor(){ this.props.switchVisualMode(false); } renderEditor() { const { editor, onChange, onAddMedia, getMedia, value } = this.props; if (editor.get('useVisualMode')) { return (