Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba5d1b3
commit 77d6805
Showing
19 changed files
with
55 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
src | ||
tools | ||
webpack.config.js | ||
.babelrc | ||
.editoconfig | ||
.eslintrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,23 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { bindActionCreators } from 'redux'; | ||
import * as actions from '../actions/actions'; | ||
import App from '../components/App'; | ||
import React, { Component } from 'react'; | ||
import GreetingBox from '../components/GreetingBox'; | ||
|
||
class AppContainer extends Component { | ||
class GreetingBoxComponent extends Component { | ||
|
||
static propTypes = { | ||
actions: PropTypes.object.isRequired, | ||
state: PropTypes.object.isRequired | ||
}; | ||
constructor(props) { | ||
super(props); | ||
this.state = { greetingText: "Hello, friend!" }; | ||
} | ||
|
||
setGreetingText(text) { | ||
this.setState({ greetingText: text }); | ||
} | ||
|
||
render() { | ||
const { greetingText } = this.props.state; | ||
const { setGreetingText } = this.props.actions; | ||
const { greetingText } = this.state; | ||
return ( | ||
<App greetingText={greetingText} setGreetingText={setGreetingText} /> | ||
<GreetingBox greetingText={greetingText} setGreetingText={this.setGreetingText.bind(this)} /> | ||
); | ||
} | ||
} | ||
|
||
function mapStateToProps(state) { | ||
return { | ||
state: state.reducer | ||
}; | ||
} | ||
|
||
function mapDispatchToProps(dispatch) { | ||
return { | ||
actions: bindActionCreators(actions, dispatch) | ||
}; | ||
} | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(AppContainer); | ||
export default GreetingBoxComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import React from 'react'; | ||
import {render} from 'react-dom'; | ||
import { Provider } from 'react-redux'; | ||
import configureStore from './store/configureStore'; | ||
import AppContainer from './containers/AppContainer'; | ||
|
||
import './styles/styles.scss'; | ||
|
||
const store = configureStore(); | ||
|
||
render( | ||
<Provider store={store}> | ||
<AppContainer /> | ||
</Provider>, document.getElementById('app') | ||
<AppContainer />, document.getElementById('app') | ||
); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.