Upgraded dependencies
This commit is contained in:
@ -1,14 +1,15 @@
|
||||
import React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
|
||||
@observer(['user'])
|
||||
@inject('user')
|
||||
@observer
|
||||
class SlackAuthLink extends React.Component {
|
||||
static propTypes = {
|
||||
children: React.PropTypes.node.isRequired,
|
||||
scopes: React.PropTypes.arrayOf(React.PropTypes.string),
|
||||
user: React.PropTypes.object.isRequired,
|
||||
redirectUri: React.PropTypes.string,
|
||||
}
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
scopes: [
|
||||
@ -17,7 +18,7 @@ class SlackAuthLink extends React.Component {
|
||||
'identity.avatar',
|
||||
'identity.team',
|
||||
],
|
||||
}
|
||||
};
|
||||
|
||||
slackUrl = () => {
|
||||
const baseUrl = 'https://slack.com/oauth/authorize';
|
||||
@ -28,17 +29,17 @@ class SlackAuthLink extends React.Component {
|
||||
state: this.props.user.getOauthState(),
|
||||
};
|
||||
|
||||
const urlParams = Object.keys(params).map((key) => {
|
||||
return `${key}=${encodeURIComponent(params[key])}`;
|
||||
}).join('&');
|
||||
const urlParams = Object.keys(params)
|
||||
.map(key => {
|
||||
return `${key}=${encodeURIComponent(params[key])}`;
|
||||
})
|
||||
.join('&');
|
||||
|
||||
return `${baseUrl}?${urlParams}`;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<a href={ this.slackUrl() }>{ this.props.children }</a>
|
||||
);
|
||||
return <a href={this.slackUrl()}>{this.props.children}</a>;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user