about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/follow_requests
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2017-05-12 21:44:10 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-12 14:44:10 +0200
commit2991a7cfe685ca9b42230b7030b9e7d0ece94c88 (patch)
tree72da0f02bc6279aeab1e641fb7d51527efcb9066 /app/javascript/mastodon/features/follow_requests
parent44a3584e2d54488393e6f50e482ed61d2765e312 (diff)
Use ES Class Fields & Static Properties (#3008)
Use ES Class Fields & Static Properties (currently stage 2) for improve class outlook.

Added babel-plugin-transform-class-properties as a Babel plugin.
Diffstat (limited to 'app/javascript/mastodon/features/follow_requests')
-rw-r--r--app/javascript/mastodon/features/follow_requests/components/account_authorize.js14
-rw-r--r--app/javascript/mastodon/features/follow_requests/index.js20
2 files changed, 15 insertions, 19 deletions
diff --git a/app/javascript/mastodon/features/follow_requests/components/account_authorize.js b/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
index 9fe464628..be2a36ff1 100644
--- a/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
+++ b/app/javascript/mastodon/features/follow_requests/components/account_authorize.js
@@ -16,6 +16,13 @@ const messages = defineMessages({
 
 class AccountAuthorize extends ImmutablePureComponent {
 
+  static propTypes = {
+    account: ImmutablePropTypes.map.isRequired,
+    onAuthorize: PropTypes.func.isRequired,
+    onReject: PropTypes.func.isRequired,
+    intl: PropTypes.object.isRequired
+  };
+
   render () {
     const { intl, account, onAuthorize, onReject } = this.props;
     const content = { __html: emojify(account.get('note')) };
@@ -41,11 +48,4 @@ class AccountAuthorize extends ImmutablePureComponent {
 
 }
 
-AccountAuthorize.propTypes = {
-  account: ImmutablePropTypes.map.isRequired,
-  onAuthorize: PropTypes.func.isRequired,
-  onReject: PropTypes.func.isRequired,
-  intl: PropTypes.object.isRequired
-};
-
 export default injectIntl(AccountAuthorize);
diff --git a/app/javascript/mastodon/features/follow_requests/index.js b/app/javascript/mastodon/features/follow_requests/index.js
index c88de48c0..9d1aef7cf 100644
--- a/app/javascript/mastodon/features/follow_requests/index.js
+++ b/app/javascript/mastodon/features/follow_requests/index.js
@@ -21,16 +21,18 @@ const mapStateToProps = state => ({
 
 class FollowRequests extends ImmutablePureComponent {
 
-  constructor (props, context) {
-    super(props, context);
-    this.handleScroll = this.handleScroll.bind(this);
-  }
+  static propTypes = {
+    params: PropTypes.object.isRequired,
+    dispatch: PropTypes.func.isRequired,
+    accountIds: ImmutablePropTypes.list,
+    intl: PropTypes.object.isRequired
+  };
 
   componentWillMount () {
     this.props.dispatch(fetchFollowRequests());
   }
 
-  handleScroll (e) {
+  handleScroll = (e) => {
     const { scrollTop, scrollHeight, clientHeight } = e.target;
 
     if (scrollTop === scrollHeight - clientHeight) {
@@ -62,13 +64,7 @@ class FollowRequests extends ImmutablePureComponent {
       </Column>
     );
   }
-}
 
-FollowRequests.propTypes = {
-  params: PropTypes.object.isRequired,
-  dispatch: PropTypes.func.isRequired,
-  accountIds: ImmutablePropTypes.list,
-  intl: PropTypes.object.isRequired
-};
+}
 
 export default connect(mapStateToProps)(injectIntl(FollowRequests));