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 { Provider } from 'react-redux';
|
||||
import { Switch } from 'react-router';
|
||||
import { ConnectedRouter } from 'react-router-redux';
|
||||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
||||
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 muiTheme from './theme/mui';
|
||||
import routes from './router';
|
||||
|
||||
injectTapEventPlugin();
|
||||
|
||||
|
@ -40,13 +40,11 @@ function* app(): any {
|
|||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<ConnectedRouter history={history}>
|
||||
<MuiThemeProvider muiTheme={muiTheme}>
|
||||
<Switch>
|
||||
|
||||
</Switch>
|
||||
</MuiThemeProvider>
|
||||
</ConnectedRouter>
|
||||
<MuiThemeProvider muiTheme={muiTheme}>
|
||||
<ConnectedRouter history={history}>
|
||||
{routes}
|
||||
</ConnectedRouter>
|
||||
</MuiThemeProvider>
|
||||
</Provider>,
|
||||
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 {
|
||||
return {
|
||||
isSignin: state.member.signin.isAuthenticated,
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user