forked from BiosBoy/coconat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved App Structure. Added Redux connected store in App.
- Loading branch information
Showing
23 changed files
with
124 additions
and
32 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
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,5 +1,5 @@ | ||
import Header from './Header'; | ||
import Footer from './Footer'; | ||
import Body from './Body'; | ||
import Footer from './Footer'; | ||
|
||
export { Header, Footer, Body }; | ||
export { Header, Body, Footer }; |
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,4 +1,4 @@ | ||
export const COUNT_ADD = 'COUNT_ADD'; | ||
export const SWITCH_IMAGE = 'SWITCH_IMAGE'; | ||
// consts for Saga asyc actions, probably you do not need this below | ||
export const SOME_SAGA = 'SOME_SAGA'; | ||
export const SOME_ASYNC_ACTION = 'SOME_ASYNC_ACTION'; |
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,16 @@ | ||
import { connect } from 'react-redux'; | ||
import { Body } from '../../components'; | ||
import { switchImage } from '../../modules/actions'; | ||
|
||
const mapStateToProps = state => ({ | ||
imageToShow: state.app.imageToShow | ||
}); | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
switchImage: imageID => dispatch(switchImage(imageID)) | ||
}); | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(Body); |
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,3 @@ | ||
import Body from './Body'; | ||
|
||
export { Body }; |
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,6 +1,7 @@ | ||
const initialState = { | ||
app: { | ||
appName: 'reactStarterKit' | ||
appName: 'CoConatBuider', | ||
imageToShow: 1 | ||
} | ||
}; | ||
|
||
|
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 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 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,19 @@ | ||
import React from 'react'; | ||
import { Route, withRouter } from 'react-router-dom'; | ||
|
||
import { Header, Footer } from '../components'; | ||
|
||
import { Body } from '../containers/Wrappers'; | ||
import styles from '../styles/index.scss'; | ||
|
||
const CoreLayout = () => { | ||
return ( | ||
<div className={styles.appWrapper}> | ||
<Header /> | ||
<Route exact path='/' component={Body} /> | ||
<Footer /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default withRouter(CoreLayout); |
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,13 +1,13 @@ | ||
import { COUNT_ADD, SOME_ASYNC_ACTION } from '../constants'; | ||
import { SWITCH_IMAGE, SOME_ASYNC_ACTION } from '../constants'; | ||
|
||
const addCount = count => ({ | ||
type: COUNT_ADD, | ||
count | ||
const switchImage = imageID => ({ | ||
type: SWITCH_IMAGE, | ||
imageID | ||
}); | ||
|
||
const someAsyncAction = payload => ({ | ||
type: SOME_ASYNC_ACTION, | ||
payload | ||
}); | ||
|
||
export { addCount, someAsyncAction }; | ||
export { switchImage, someAsyncAction }; |
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 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,8 @@ | ||
.button { | ||
margin: 0; | ||
padding: 0; | ||
border: none; | ||
background: transparent; | ||
outline: none; | ||
cursor: pointer; | ||
} |
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