Router settings
This commit is contained in:
parent
49fbd566d5
commit
6321099f9b
|
@ -3,7 +3,6 @@ import * as ReactDOM from 'react-dom';
|
||||||
import { fork } from 'redux-saga/effects';
|
import { fork } from 'redux-saga/effects';
|
||||||
|
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { Switch } from 'react-router';
|
|
||||||
import { ConnectedRouter } from 'react-router-redux';
|
import { ConnectedRouter } from 'react-router-redux';
|
||||||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
||||||
import * as injectTapEventPlugin from 'react-tap-event-plugin';
|
import * as injectTapEventPlugin from 'react-tap-event-plugin';
|
||||||
|
@ -14,6 +13,7 @@ import { store, sagaMiddleware, history } from './redux/store';
|
||||||
|
|
||||||
import sagas from './redux/saga';
|
import sagas from './redux/saga';
|
||||||
import muiTheme from './theme/mui';
|
import muiTheme from './theme/mui';
|
||||||
|
import routes from './router';
|
||||||
|
|
||||||
injectTapEventPlugin();
|
injectTapEventPlugin();
|
||||||
|
|
||||||
|
@ -40,13 +40,11 @@ function* app(): any {
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConnectedRouter history={history}>
|
|
||||||
<MuiThemeProvider muiTheme={muiTheme}>
|
<MuiThemeProvider muiTheme={muiTheme}>
|
||||||
<Switch>
|
<ConnectedRouter history={history}>
|
||||||
|
{routes}
|
||||||
</Switch>
|
|
||||||
</MuiThemeProvider>
|
|
||||||
</ConnectedRouter>
|
</ConnectedRouter>
|
||||||
|
</MuiThemeProvider>
|
||||||
</Provider>,
|
</Provider>,
|
||||||
appContainer,
|
appContainer,
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import * as React from 'react';
|
||||||
|
import { Route, Switch } from 'react-router-dom';
|
||||||
|
|
||||||
|
import Signin from '../views/member/Signin';
|
||||||
|
|
||||||
|
const routes = (
|
||||||
|
<Switch>
|
||||||
|
<Route path='/signin' component={Signin} />
|
||||||
|
<Route path='/'>
|
||||||
|
</Route>
|
||||||
|
</Switch>
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
export default routes;
|
|
@ -11,7 +11,7 @@ import * as signinActions from '../redux/action/signin';
|
||||||
|
|
||||||
export function mapStateToProps(state: any): SigninProps {
|
export function mapStateToProps(state: any): SigninProps {
|
||||||
return {
|
return {
|
||||||
isSignin: state.member.signin.isAuthenticated,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user