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
Showing
16 changed files
with
143 additions
and
207 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
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,16 +1,12 @@ | ||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import {expect} from 'chai'; | ||
import {App} from './App'; | ||
// import React from 'react' | ||
// import { shallow } from 'enzyme' | ||
import { expect } from 'chai' | ||
import { App } from './App' | ||
|
||
describe('App', () => { | ||
|
||
const props = {}; | ||
|
||
describe('mapDispatchToProps', () => { | ||
it('Should return empty object', () => { | ||
expect(App.mapDispatchToProps().actions).to.be.empty; | ||
}); | ||
}); | ||
|
||
}); | ||
expect(App.mapDispatchToProps().actions).to.be.empty | ||
}) | ||
}) | ||
}) |
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,17 +1,17 @@ | ||
import { combineReducers } from 'redux'; | ||
import {routerReducer} from 'react-router-redux'; | ||
import {i18nReducer } from 'react-redux-i18n'; | ||
import { combineReducers } from 'redux' | ||
import { routerReducer } from 'react-router-redux' | ||
import { i18nReducer } from 'react-redux-i18n' | ||
|
||
/** | ||
* Get the root reducer object | ||
* @return {Object} The root reducer object | ||
*/ | ||
const rootReducer = combineReducers({ | ||
i18n: i18nReducer, | ||
routing: routerReducer | ||
}); | ||
const rootReducer = combineReducers({ | ||
i18n: i18nReducer, | ||
routing: routerReducer | ||
}) | ||
|
||
/** | ||
* Export the reducer | ||
*/ | ||
export default rootReducer; | ||
export default rootReducer |
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 @@ | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./configureStore.prod'); | ||
module.exports = require('./configureStore.prod') | ||
} else { | ||
module.exports = require('./configureStore.dev'); | ||
module.exports = require('./configureStore.dev') | ||
} |
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,21 +1,20 @@ | ||
import {createStore, applyMiddleware} from 'redux'; | ||
import { loadTranslations, setLocale, syncTranslationWithStore } from 'react-redux-i18n'; | ||
import thunk from 'redux-thunk'; | ||
import rootReducer from '../reducers'; | ||
import translationsObject from './../../assets/lang/index'; | ||
import { createStore, applyMiddleware } from 'redux' | ||
import { loadTranslations, setLocale, syncTranslationWithStore } from 'react-redux-i18n' | ||
import thunk from 'redux-thunk' | ||
import rootReducer from '../reducers' | ||
import translationsObject from './../../assets/lang/index' | ||
|
||
/** | ||
* Configure the store for the PROD mode | ||
* @param {Object} initialState The initialState given | ||
* @return {Object} The app store | ||
*/ | ||
export default function configureStore(initialState) { | ||
export default function configureStore (initialState) { | ||
const store = createStore(rootReducer, initialState, applyMiddleware(thunk)) | ||
|
||
const store = createStore(rootReducer, initialState, applyMiddleware(thunk)); | ||
syncTranslationWithStore(store) | ||
store.dispatch(loadTranslations(translationsObject)) | ||
store.dispatch(setLocale('fr')) | ||
|
||
syncTranslationWithStore(store); | ||
store.dispatch(loadTranslations(translationsObject)); | ||
store.dispatch(setLocale('fr')); | ||
|
||
return store; | ||
return store | ||
} |
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,10 +1,10 @@ | ||
export default { | ||
user:{ | ||
token:null | ||
user: { | ||
token: null | ||
}, | ||
app:{ | ||
auth:{ | ||
isLoginModalOpen:false | ||
app: { | ||
auth: { | ||
isLoginModalOpen: false | ||
} | ||
} | ||
}; | ||
} |
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,17 +1,17 @@ | ||
export default { | ||
application: { | ||
homePage:{ | ||
linkTo:'Home' | ||
}, | ||
kingdomPage:{ | ||
linkTo:'Kingdom' | ||
}, | ||
header:{ | ||
login:'Login', | ||
logout:'Disconnect' | ||
} | ||
}, | ||
date: { | ||
long: 'MMMM Do, YYYY' | ||
} | ||
}; | ||
application: { | ||
homePage: { | ||
linkTo: 'Home' | ||
}, | ||
kingdomPage: { | ||
linkTo: 'Kingdom' | ||
}, | ||
header: { | ||
login: 'Login', | ||
logout: 'Disconnect' | ||
} | ||
}, | ||
date: { | ||
long: 'MMMM Do, YYYY' | ||
} | ||
} |
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,17 +1,17 @@ | ||
export default { | ||
application: { | ||
homePage:{ | ||
linkTo:'Accueil' | ||
}, | ||
kingdomPage:{ | ||
linkTo:'Royaume' | ||
}, | ||
header:{ | ||
login:'Se connecter', | ||
logout:'Se déconnecter' | ||
} | ||
homePage: { | ||
linkTo: 'Accueil' | ||
}, | ||
kingdomPage: { | ||
linkTo: 'Royaume' | ||
}, | ||
header: { | ||
login: 'Se connecter', | ||
logout: 'Se déconnecter' | ||
} | ||
}, | ||
date: { | ||
long: 'D MMMM YYYY' | ||
} | ||
}; | ||
} |
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,7 +1,7 @@ | ||
import en from './en'; | ||
import fr from './fr'; | ||
import en from './en' | ||
import fr from './fr' | ||
|
||
export default { | ||
en, | ||
fr | ||
}; | ||
} |
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,23 +1,23 @@ | ||
/* eslint-disable import/default */ | ||
|
||
import React from 'react'; | ||
import {render} from 'react-dom'; | ||
import { Provider } from 'react-redux'; | ||
import { Router, browserHistory } from 'react-router'; | ||
import { syncHistoryWithStore } from 'react-router-redux'; | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import { Provider } from 'react-redux' | ||
import { Router, browserHistory } from 'react-router' | ||
import { syncHistoryWithStore } from 'react-router-redux' | ||
|
||
import routes from './routes'; | ||
import configureStore from './app/store/configureStore'; | ||
require('./favicon.ico'); // Tell webpack to load favicon.ico | ||
import './styles/styles.scss'; // Yep, that's right. You can import SASS/CSS files too! Webpack will run the associated loader and plug this into the page. | ||
import routes from './routes' | ||
import configureStore from './app/store/configureStore' | ||
require('./favicon.ico') // Tell webpack to load favicon.ico | ||
import './styles/styles.scss' // Yep, that's right. You can import SASS/CSS files too! Webpack will run the associated loader and plug this into the page. | ||
|
||
const store = configureStore(); | ||
const store = configureStore() | ||
|
||
// Create an enhanced history that syncs navigation events with the store | ||
const history = syncHistoryWithStore(browserHistory, store); | ||
const history = syncHistoryWithStore(browserHistory, store) | ||
|
||
render( | ||
<Provider store={store}> | ||
<Router history={history} routes={routes(store)} /> | ||
</Provider>, document.getElementById('app') | ||
); | ||
) |
Oops, something went wrong.