p5.js-web-editor/shared/containers/App/App.jsx

32 lines
811 B
React
Raw Normal View History

2016-05-06 01:01:31 +02:00
import React from 'react';
import Editor from '../../components/Editor/Editor'
2016-05-10 00:28:38 +02:00
import PreviewFrame from '../../components/Preview/PreviewFrame'
import Preview from '../../components/Preview/Preview'
2016-05-06 01:01:31 +02:00
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as FileActions from '../../redux/actions'
class App extends React.Component {
render() {
return (
<div class="app">
<Editor
content={this.props.file.content}
updateFile={this.props.updateFile} />
2016-05-10 00:28:38 +02:00
<PreviewFrame content={this.props.file.content} />
</div>
2016-05-06 01:01:31 +02:00
);
}
}
function mapStateToProps(state) {
return {
file: state.file
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(FileActions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(App);