Flow for all the files

This commit is contained in:
Jori Lallo
2017-05-11 17:23:56 -07:00
parent a98199599a
commit 0a76d6af9e
110 changed files with 512 additions and 269 deletions

View File

@ -3,15 +3,15 @@ import React from 'react';
import { observer, inject } from 'mobx-react';
import UserStore from 'stores/UserStore';
@inject('user')
@observer
class SlackAuthLink extends React.Component {
props: {
children: any,
scopes: Array<string>,
user: UserStore,
redirectUri: string,
};
type Props = {
children: React.Element<any>,
scopes?: Array<string>,
user: UserStore,
redirectUri: string,
};
@observer class SlackAuthLink extends React.Component {
props: Props;
static defaultProps = {
scopes: [
@ -25,10 +25,8 @@ class SlackAuthLink extends React.Component {
slackUrl = () => {
const baseUrl = 'https://slack.com/oauth/authorize';
const params = {
// $FlowIssue global variable
client_id: SLACK_KEY,
scope: this.props.scopes.join(' '),
// $FlowIssue global variable
scope: this.props.scopes ? this.props.scopes.join(' ') : '',
redirect_uri: this.props.redirectUri || SLACK_REDIRECT_URI,
state: this.props.user.getOauthState(),
};
@ -47,4 +45,4 @@ class SlackAuthLink extends React.Component {
}
}
export default SlackAuthLink;
export default inject('user')(SlackAuthLink);