-
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.
- Loading branch information
Showing
33 changed files
with
1,771 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/serviceWorker.js |
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,43 @@ | ||
{ | ||
"env": { | ||
"jest": true, | ||
"browser": true | ||
}, | ||
"parser": "babel-eslint", | ||
"extends": ["airbnb", "plugin:import/errors"], | ||
"rules": { | ||
"linebreak-style": 0, | ||
"react/prop-types": 0, | ||
"react/jsx-filename-extension": 0, | ||
"react/no-did-mount-set-state": 0, | ||
"global-require": 0, | ||
"id-length": 0, | ||
"max-len": 0, | ||
"jsx-a11y/anchor-is-valid": 0, | ||
"jsx-a11y/label-has-for": 0, | ||
"import/default": 0, | ||
"no-param-reassign": [ | ||
2, | ||
{ | ||
"props": false | ||
} | ||
], | ||
"consistent-return": 0, | ||
"arrow-parens": 0, | ||
"no-underscore-dangle": 0, | ||
"import/no-dynamic-require": 0, | ||
"import/prefer-default-export": 0, | ||
"newline-per-chained-call": 0, | ||
"object-curly-newline": [ | ||
"error", | ||
{ | ||
"ObjectPattern": { | ||
"multiline": false | ||
} | ||
} | ||
], | ||
"jsx-a11y/no-noninteractive-element-interactions": 0, | ||
"jsx-a11y/no-static-element-interactions": 0, | ||
"jsx-a11y/click-events-have-key-events": 0, | ||
} | ||
} |
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.
Empty file.
Empty file.
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,11 @@ | ||
import React from 'react' | ||
|
||
const Login = () => { | ||
return ( | ||
<div> | ||
Login | ||
</div> | ||
) | ||
} | ||
|
||
export default Login |
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,11 @@ | ||
import { connect } from 'react-redux'; | ||
import Login from './Login.styled'; | ||
|
||
const mapStateToProps = state => ({}); | ||
|
||
const mapDispatchToProps = dispatch => ({}); | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(Login); |
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,11 @@ | ||
import React from 'react' | ||
|
||
const Login = () => { | ||
return ( | ||
<div> | ||
Login | ||
</div> | ||
) | ||
} | ||
|
||
export default Login |
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,5 @@ | ||
import Login from './Login/Login.container'; | ||
|
||
export { | ||
Login | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
import { PersistGate } from 'redux-persist/integration/react'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import { Provider } from 'react-redux'; | ||
import { ConnectedRouter } from 'connected-react-router'; | ||
import { store, persistor, history } from './state'; | ||
import * as serviceWorker from './serviceWorker'; | ||
import Routes from './routes'; | ||
import './style.scss'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
ReactDOM.render( | ||
<Provider store={store}> | ||
<PersistGate persistor={persistor}> | ||
<ConnectedRouter history={history}> | ||
{Routes} | ||
</ConnectedRouter> | ||
</PersistGate> | ||
</Provider>, | ||
document.getElementById('root'), | ||
); | ||
|
||
// If you want your app to work offline and load faster, you can change | ||
// unregister() to register() below. Note this comes with some pitfalls. | ||
// Learn more about service workers: https://bit.ly/CRA-PWA | ||
serviceWorker.unregister(); | ||
serviceWorker.unregister(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { Switch, Route } from 'react-router-dom'; | ||
import { | ||
Login, | ||
} from './components/pages'; | ||
|
||
|
||
const Routes = ( | ||
<div> | ||
<Switch> | ||
<Route path="/" exact component={() => <Login />} /> | ||
</Switch> | ||
</div> | ||
); | ||
|
||
export default Routes; |
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,6 @@ | ||
|
||
import { createAction } from 'redux-actions'; | ||
import * as actionTypes from './actionTypes'; | ||
|
||
export const setLoading = createAction(actionTypes.SET_LOADING, isLoading => ({ isLoading })); | ||
export const setError = createAction(actionTypes.SET_ERROR, error => ({ error })); |
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 @@ | ||
|
||
export const SET_LOADING = 'SET_LOADING'; | ||
export const SET_ERROR = 'SET_ERROR'; |
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,4 @@ | ||
export default { | ||
isLoading: false, | ||
error: false, | ||
}; |
Empty file.
Empty file.
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,10 @@ | ||
import { handleActions } from 'redux-actions'; | ||
import initialState from './initial.state'; | ||
import * as actions from './actionCreators'; | ||
|
||
const ui = handleActions( | ||
{}, | ||
initialState, | ||
); | ||
|
||
export default ui; |
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,5 @@ | ||
|
||
import { createAction } from 'redux-actions'; | ||
import * as actionTypes from './actionTypes'; | ||
|
||
export const login = createAction(actionTypes.LOGIN, user => ({ user })); |
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,2 @@ | ||
export const LOGIN = 'LOGIN'; | ||
export const SET_USER = 'SET_USER'; |
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,5 @@ | ||
export default { | ||
id: null, | ||
email: null, | ||
role: null, | ||
}; |
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,9 @@ | ||
import { handleActions } from 'redux-actions'; | ||
import initialState from './initial.state'; | ||
|
||
const user = handleActions( | ||
{}, | ||
initialState, | ||
); | ||
|
||
export default user; |
Empty file.
Empty file.
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,12 @@ | ||
import { combineReducers } from 'redux'; | ||
import ui from './UI/reducer'; | ||
import user from './User/reducer'; | ||
|
||
const AppReducer = combineReducers({ ui, user }); | ||
|
||
const rootReducer = (state, action) => { | ||
if (action.type === 'LOGOUT') return AppReducer({}, action); | ||
return AppReducer(state, action); | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { createStore, applyMiddleware, compose } from 'redux'; | ||
import { persistStore, persistReducer } from 'redux-persist'; | ||
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2'; | ||
import storage from 'redux-persist/lib/storage'; | ||
import createSagaMiddleware from 'redux-saga'; | ||
import { createBrowserHistory } from 'history'; | ||
import { connectRouter, routerMiddleware } from 'connected-react-router'; | ||
|
||
import rootReducer from './index-reducers'; | ||
import rootSagas from './sagas-registration'; | ||
|
||
const sagaMiddleware = createSagaMiddleware(); | ||
|
||
const history = createBrowserHistory(); | ||
|
||
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; // eslint-disable-line no-undef | ||
const enhancer = composeEnhancers(applyMiddleware(routerMiddleware(history), sagaMiddleware)); | ||
|
||
const persistConfig = { | ||
key: 'root', | ||
storage, | ||
blacklist: ['ui'], | ||
stateReconciler: autoMergeLevel2, | ||
}; | ||
const persistedReducer = persistReducer(persistConfig, rootReducer); | ||
|
||
const configureStore = (initialState = {}) => { | ||
const store = createStore(connectRouter(history)(persistedReducer), initialState, enhancer); | ||
const persistor = persistStore(store); | ||
sagaMiddleware.run(rootSagas); | ||
routerMiddleware(history); | ||
persistStore(store); | ||
|
||
return { store, persistor }; | ||
}; | ||
|
||
const { store, persistor } = configureStore(); | ||
|
||
export { store, persistor, history }; |
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,5 @@ | ||
import { all } from 'redux-saga/effects'; | ||
|
||
export default function* root() { | ||
yield all([]); | ||
} |
Oops, something went wrong.