Migrated user/team/auth from redux to mobx

This commit is contained in:
Jori Lallo
2016-06-04 15:53:08 -07:00
parent 6a5303149d
commit e5d1612cbf
13 changed files with 129 additions and 194 deletions

View File

@@ -1,22 +1,15 @@
import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { replace } from 'react-router-redux';
import auth from '../../utils/auth';
import store from 'stores/UserStore';
import { browserHistory } from 'react-router'
import SlackAuthLink from '../../components/SlackAuthLink';
import styles from './Home.scss';
class Home extends React.Component {
static propTypes = {
replace: React.PropTypes.func.isRequired,
}
export default class Home extends React.Component {
componentDidMount = () => {
if (auth.loggedIn()) {
this.props.replace('/dashboard');
if (store.authenticated) {
browserHistory.replace('/dashboard');
}
}
@@ -53,11 +46,3 @@ class Home extends React.Component {
);
}
}
const mapDispatchToProps = (dispatch) => {
return bindActionCreators({ replace }, dispatch)
}
export default connect(
null, mapDispatchToProps
)(Home);