mirror of https://gitlab.com/ecentrics/concordia
Ezerous
6 years ago
14 changed files with 102 additions and 24 deletions
@ -0,0 +1,12 @@ |
|||||
|
import React from 'react'; |
||||
|
import pageNotFound from '../resources/PageNotFound.jpg'; |
||||
|
|
||||
|
const NotFound = () => { |
||||
|
return ( |
||||
|
<div style={{textAlign: "center"}}> |
||||
|
<img src={pageNotFound} alt="Page not found!"/> |
||||
|
</div> |
||||
|
); |
||||
|
}; |
||||
|
|
||||
|
export default NotFound; |
@ -1,28 +1,23 @@ |
|||||
import { createStore, applyMiddleware, compose } from 'redux'; |
import { createStore, applyMiddleware, compose } from 'redux'; |
||||
import reducer from './reducers/reducer'; |
|
||||
import rootSaga from './sagas/rootSaga'; |
|
||||
import createSagaMiddleware from 'redux-saga'; |
import createSagaMiddleware from 'redux-saga'; |
||||
import { generateContractsInitialState } from 'drizzle'; |
import { generateContractsInitialState } from 'drizzle'; |
||||
|
|
||||
|
import drizzleReducer from './reducers/drizzleReducer'; |
||||
|
import rootSaga from './sagas/drizzleSaga'; |
||||
import drizzleOptions from '../config/drizzleOptions'; |
import drizzleOptions from '../config/drizzleOptions'; |
||||
|
|
||||
|
const initialState = { contracts: generateContractsInitialState(drizzleOptions) }; |
||||
|
|
||||
// Redux DevTools
|
// Redux DevTools
|
||||
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; |
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; |
||||
|
|
||||
const sagaMiddleware = createSagaMiddleware(); |
const sagaMiddleware = createSagaMiddleware(); |
||||
|
const composedEnhancers = composeEnhancers(applyMiddleware(sagaMiddleware)); |
||||
const initialState = { |
|
||||
contracts: generateContractsInitialState(drizzleOptions) |
|
||||
}; |
|
||||
|
|
||||
const store = createStore( |
const store = createStore( |
||||
reducer, |
drizzleReducer, |
||||
initialState, |
initialState, |
||||
composeEnhancers( |
composedEnhancers |
||||
applyMiddleware( |
|
||||
sagaMiddleware |
|
||||
) |
|
||||
) |
|
||||
); |
); |
||||
|
|
||||
sagaMiddleware.run(rootSaga); |
sagaMiddleware.run(rootSaga); |
@ -0,0 +1,6 @@ |
|||||
|
import { combineReducers } from 'redux'; |
||||
|
import { connectRouter } from 'connected-react-router' |
||||
|
|
||||
|
export default (history) => combineReducers({ |
||||
|
router: connectRouter(history) |
||||
|
}) |
@ -0,0 +1,27 @@ |
|||||
|
import { createBrowserHistory } from 'history' |
||||
|
import { createStore, applyMiddleware, compose } from 'redux'; |
||||
|
import { routerMiddleware } from 'connected-react-router' |
||||
|
|
||||
|
import createRootReducer from './reducers/routerReducer'; |
||||
|
|
||||
|
export const history = createBrowserHistory(); |
||||
|
|
||||
|
const rootReducer = createRootReducer(history); |
||||
|
|
||||
|
const initialState = {}; |
||||
|
|
||||
|
// Redux DevTools
|
||||
|
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; |
||||
|
|
||||
|
const routingMiddleware = routerMiddleware(history); |
||||
|
|
||||
|
|
||||
|
const composedEnhancers = composeEnhancers(applyMiddleware(routingMiddleware)); |
||||
|
|
||||
|
const routerStore = createStore( |
||||
|
rootReducer, |
||||
|
initialState, |
||||
|
composedEnhancers |
||||
|
); |
||||
|
|
||||
|
export default routerStore; |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 216 KiB |
@ -0,0 +1,27 @@ |
|||||
|
import React from 'react' |
||||
|
import { Route, Switch } from 'react-router-dom' |
||||
|
import HomeContainer from '../containers/HomeContainer' |
||||
|
import NotFound from '../components/NotFound' |
||||
|
|
||||
|
const routes = ( |
||||
|
<div> |
||||
|
<Switch> |
||||
|
<Route exact path="/" component={HomeContainer} /> |
||||
|
<Route component={NotFound} /> |
||||
|
</Switch> |
||||
|
</div> |
||||
|
); |
||||
|
|
||||
|
export default routes |
||||
|
|
||||
|
|
||||
|
// const routes = (
|
||||
|
// <div>
|
||||
|
// <NavBar />
|
||||
|
// <Switch>
|
||||
|
// <Route exact path="/" component={Home} />
|
||||
|
// <Route path="/signup" component={SignUp} />
|
||||
|
// <Route component={NotFound} />
|
||||
|
// </Switch>
|
||||
|
// </div>
|
||||
|
// );
|
Loading…
Reference in new issue