-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
54 lines (51 loc) · 2.42 KB
/
Copy pathmain.js
File metadata and controls
54 lines (51 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* Created by John on 10/22/16.
*/
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import App from './src/containers/App';
import { createStore,applyMiddleware } from 'redux/lib'
import rootReducer from './src/reducers/index';
import promiseMiddleware from 'redux-promise';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import HomePage from './src/components/HomePage';
import RequireAuth from './src/containers/RequireAuth';
import reduxThunk from 'redux-thunk';
import * as Actions from './src/actions/index';
import MarketView from './src/containers/MarketView.jsx';
import Cart from './src/containers/Cart';
import AccountPage from './src/containers/AccountPage';
import AddItemPage from './src/containers/AddItemPage';
import AboutPage from './src/components/AboutPage';
import Home from './src/components/Home';
import Footer from './src/containers/Footer';
import EditUserPage from './src/containers/EditUserPage';
import EditEmailPage from './src/containers/EditEmailPage';
import EditPasswordPage from './src/containers/EditPasswordPage';
import EditAvailableDatesPage from './src/containers/EditAvailableDatesPage';
import NavBar from './src/containers/NavBar';
import Blog from './src/containers/Blog';
const store = createStore( rootReducer, applyMiddleware( reduxThunk ));
store.dispatch(Actions.verifyAuth());
ReactDOM.render(
<Provider store={store}>
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={MarketView} />
<Route path="/home" component={Home}/>
<Route path="/cart" component={RequireAuth(Cart)}/>
<Route path="/account" component={RequireAuth(AccountPage)}/>
<Route path="/addItem" component={RequireAuth(AddItemPage)}/>
<Route path="/edit" component={RequireAuth(EditUserPage)}/>
<Route path="/email" component={RequireAuth(EditEmailPage)}/>
<Route path="/password" component={RequireAuth(EditPasswordPage)}/>
<Route path="/available" component={RequireAuth(EditAvailableDatesPage)}/>
<Route path="/about" component={AboutPage}/>
<Route path="/login" component={HomePage}/>
<Route path="/blog" component={Blog}/>
</Route>
</Router>
</Provider>,
document.getElementById('app')
);