|
@ -1,22 +1,23 @@ |
|
|
import React from 'react'; |
|
|
import React from 'react'; |
|
|
import ReactDOM from 'react-dom'; |
|
|
import ReactDOM from 'react-dom'; |
|
|
import { Router, Route, IndexRoute, browserHistory } from 'react-router' |
|
|
import { Router, Route, IndexRoute, browserHistory } from 'react-router' |
|
|
import { Provider } from 'react-redux' |
|
|
import { DrizzleProvider } from 'drizzle-react' |
|
|
import { syncHistoryWithStore } from 'react-router-redux' |
|
|
import { syncHistoryWithStore } from 'react-router-redux' |
|
|
import { UserIsAuthenticated, UserIsNotAuthenticated } from './util/wrappers.js' |
|
|
import { UserIsAuthenticated, UserIsNotAuthenticated } from './util/wrappers.js' |
|
|
import getWeb3 from "./util/web3/getWeb3"; |
|
|
|
|
|
|
|
|
|
|
|
// Layouts
|
|
|
// Layouts
|
|
|
import App from './App' |
|
|
import App from './App' |
|
|
import Home from './layouts/home/Home' |
|
|
import HomeContainer from './layouts/home/HomeContainer' |
|
|
import Dashboard from './layouts/dashboard/Dashboard' |
|
|
import Dashboard from './layouts/dashboard/Dashboard' |
|
|
import SignUp from './user/layouts/signup/SignUp' |
|
|
import SignUp from './user/layouts/signup/SignUp' |
|
|
import Profile from './user/layouts/profile/Profile' |
|
|
import Profile from './user/layouts/profile/Profile' |
|
|
|
|
|
import {LoadingContainer} from 'drizzle-react-components' |
|
|
|
|
|
|
|
|
import './index.css'; //???
|
|
|
import './index.css'; //???
|
|
|
|
|
|
|
|
|
// Redux Store
|
|
|
// Redux Store
|
|
|
import store from './store' |
|
|
import store from './store' |
|
|
|
|
|
import drizzleOptions from './util/drizzle/drizzleOptions' |
|
|
|
|
|
|
|
|
// ServiceWorker
|
|
|
// ServiceWorker
|
|
|
import registerServiceWorker from './registerServiceWorker'; |
|
|
import registerServiceWorker from './registerServiceWorker'; |
|
@ -24,28 +25,19 @@ import registerServiceWorker from './registerServiceWorker'; |
|
|
// Initialize react-router-redux.
|
|
|
// Initialize react-router-redux.
|
|
|
const history = syncHistoryWithStore(browserHistory, store); |
|
|
const history = syncHistoryWithStore(browserHistory, store); |
|
|
|
|
|
|
|
|
// Initialize web3 and set in Redux.
|
|
|
|
|
|
getWeb3 |
|
|
|
|
|
.then(results => { |
|
|
|
|
|
console.log('Web3 initialized!') |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(() => { |
|
|
|
|
|
console.log('Error in web3 initialization.') |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReactDOM.render(( |
|
|
ReactDOM.render(( |
|
|
<Provider store={store}> |
|
|
<DrizzleProvider options={drizzleOptions} store={store}> |
|
|
|
|
|
<LoadingContainer> |
|
|
<Router history={history}> |
|
|
<Router history={history}> |
|
|
<Route path="/" component={App}> |
|
|
<Route path="/" component={App}> |
|
|
<IndexRoute component={Home} /> |
|
|
<IndexRoute component={HomeContainer} /> |
|
|
<Route path="dashboard" component={UserIsAuthenticated(Dashboard)} /> |
|
|
<Route path="dashboard" component={UserIsAuthenticated(Dashboard)} /> |
|
|
<Route path="signup" component={UserIsNotAuthenticated(SignUp)} /> |
|
|
<Route path="signup" component={UserIsNotAuthenticated(SignUp)} /> |
|
|
<Route path="profile" component={UserIsAuthenticated(Profile)} /> |
|
|
<Route path="profile" component={UserIsAuthenticated(Profile)} /> |
|
|
</Route> |
|
|
</Route> |
|
|
</Router> |
|
|
</Router> |
|
|
</Provider> |
|
|
</LoadingContainer> |
|
|
|
|
|
</DrizzleProvider> |
|
|
), |
|
|
), |
|
|
document.getElementById('root') |
|
|
document.getElementById('root') |
|
|
); |
|
|
); |
|
|