New user store structure and updated packages
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import React from "react";
|
||||
import { observer } from 'mobx-react';
|
||||
import Helmet from "react-helmet";
|
||||
|
||||
const Application = (props) => {
|
||||
const Application = observer((props) => {
|
||||
return (
|
||||
<div style={{ width: '100%' }}>
|
||||
<Helmet
|
||||
@@ -13,7 +14,7 @@ const Application = (props) => {
|
||||
{ props.children }
|
||||
</div>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
Application.propTypes = {
|
||||
children: React.PropTypes.node.isRequired,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
|
||||
import userStore from 'stores/UserStore';
|
||||
import store from './DashboardStore';
|
||||
|
||||
import Flex from 'components/Flex';
|
||||
@@ -14,10 +13,14 @@ import FullscreenField from 'components/FullscreenField';
|
||||
|
||||
import styles from './Dashboard.scss';
|
||||
|
||||
@observer
|
||||
@observer(['user'])
|
||||
class Dashboard extends React.Component {
|
||||
static propTypes = {
|
||||
user: React.PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
store.fetchAtlases(userStore.team.id);
|
||||
store.fetchAtlases(this.props.user.team.id);
|
||||
}
|
||||
|
||||
state = {
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
import React from 'react';
|
||||
import store from 'stores/UserStore';
|
||||
import { observer } from 'mobx-react';
|
||||
import { browserHistory } from 'react-router'
|
||||
|
||||
import SlackAuthLink from 'components/SlackAuthLink';
|
||||
|
||||
import styles from './Home.scss';
|
||||
|
||||
@observer(['user'])
|
||||
export default class Home extends React.Component {
|
||||
static propTypes = {
|
||||
user: React.PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
if (store.authenticated) {
|
||||
if (this.props.user.authenticated) {
|
||||
browserHistory.replace('/dashboard');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import React from 'react';
|
||||
import store from 'stores/UserStore';
|
||||
import { observer } from 'mobx-react';
|
||||
|
||||
@observer(['user'])
|
||||
class SlackAuth extends React.Component {
|
||||
static propTypes = {
|
||||
user: React.PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
export default class SlackAuth extends React.Component {
|
||||
componentDidMount = () => {
|
||||
const { code, state } = this.props.location.query;
|
||||
store.authWithSlack(code, state);
|
||||
this.props.user.authWithSlack(code, state);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -13,3 +18,5 @@ export default class SlackAuth extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SlackAuth;
|
||||
Reference in New Issue
Block a user