11import React , { Component , PropTypes } from 'react'
22import { connect } from 'react-redux'
33import Actions from './Actions/Creators'
4- import Reactotron from '../client'
54
6- export default class RootContainer extends Component {
5+ class RootContainer extends Component {
76
87 constructor ( props ) {
98 super ( props )
@@ -13,23 +12,22 @@ export default class RootContainer extends Component {
1312 handlePress ( e ) {
1413 e . preventDefault ( )
1514 const { dispatch} = this . props
16- Reactotron . log ( 'A touchable was pressed.' )
17- dispatch ( Actions . requestTemperature ( 'Toronto' ) )
15+ console . tron . log ( 'A touchable was pressed. 🦄 ' )
16+ dispatch ( Actions . requestGithub ( ) )
1817 }
1918
20- componentWillMount ( ) {
19+ componentDidMount ( ) {
2120 const { dispatch } = this . props
2221 dispatch ( Actions . startup ( ) )
2322 }
2423
2524 render ( ) {
26- const { city , temperature , fetching } = this . props
25+ const { message } = this . props
2726 return (
2827 < div style = { Styles . container } >
2928 < a onClick = { this . handlePress } >
30- < p style = { Styles . weather } >
31- { `The weather in ${ city } is ${ fetching ? 'loading' : temperature } .` }
32- </ p >
29+ < h3 > Last Commit Message</ h3 >
30+ < p style = { Styles . message } > { message } </ p >
3331 </ a >
3432 </ div >
3533 )
@@ -44,7 +42,7 @@ const Styles = {
4442 justifyContent : 'center' ,
4543 alignItems : 'center'
4644 } ,
47- weather : {
45+ message : {
4846 fontFamily : 'sans-serif' ,
4947 fontSize : '25px' ,
5048 textAlign : 'center'
@@ -53,16 +51,12 @@ const Styles = {
5351
5452RootContainer . propTypes = {
5553 dispatch : PropTypes . func ,
56- city : PropTypes . string ,
57- temperature : PropTypes . number ,
58- fetching : PropTypes . bool
54+ message : PropTypes . string
5955}
6056
6157const mapStateToProps = ( state ) => {
6258 return {
63- city : state . weather . city ,
64- temperature : state . weather . temperature ,
65- fetching : state . weather . fetching
59+ message : state . github . message
6660 }
6761}
6862
0 commit comments