Skip to content

Instantly share code, notes, and snippets.

@baclap
Last active February 20, 2016 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baclap/451d3558eed19f39c3bb to your computer and use it in GitHub Desktop.
Save baclap/451d3558eed19f39c3bb to your computer and use it in GitHub Desktop.
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
// import classes from './EditorView.scss'
import DrawingEditor from 'components/editors/DrawingEditor/DrawingEditor'
import { submitContent } from '../../redux/modules/nodes'
const someFunc = () => {
alert('lksdlksflkjlsdkfjlksjdflksdjflksdjflkjsdlfjflksjdf')
}
export class EditorView extends Component {
static propTypes = {
nodes: PropTypes.object,
submitContent: PropTypes.func
}
render () {
const { nodes, submitContent } = this.props
return (
<div className='container text-center'>
<p>EditorView</p>
<DrawingEditor submitContent={submitContent} nodes={nodes}/>
<GenericButton clickHandler={someFunc}>
Save
</GenericButton>
<GenericButton clickHandler={() => alert('hi')}>
HEllo
</GenericButton>
</div>
)
}
}
class GenericButton extends Component {
render () {
return (
<button onClick={this.props.clickHandler}>
{this.props.children}
</button>
)
}
}
const mapStateToProps = (state) => ({
nodes: state.nodes
})
export default connect(mapStateToProps, {
submitContent
})(EditorView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment