diff options
Diffstat (limited to 'app/javascript/flavours/glitch/features/follow_requests')
-rw-r--r-- | app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx (renamed from app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.js) | 3 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/features/follow_requests/index.jsx (renamed from app/javascript/flavours/glitch/features/follow_requests/index.js) | 16 |
2 files changed, 6 insertions, 13 deletions
diff --git a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.js b/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx index cbe7a1032..af8a534fa 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.js +++ b/app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx @@ -13,7 +13,6 @@ const messages = defineMessages({ reject: { id: 'follow_request.reject', defaultMessage: 'Reject' }, }); -export default @injectIntl class AccountAuthorize extends ImmutablePureComponent { static propTypes = { @@ -47,3 +46,5 @@ class AccountAuthorize extends ImmutablePureComponent { } } + +export default injectIntl(AccountAuthorize); diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.js b/app/javascript/flavours/glitch/features/follow_requests/index.jsx index 7b35e3ec9..a9a35f54b 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.js +++ b/app/javascript/flavours/glitch/features/follow_requests/index.jsx @@ -3,7 +3,6 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; -import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import Column from 'flavours/glitch/features/ui/components/column'; import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; import AccountAuthorizeContainer from './containers/account_authorize_container'; @@ -26,8 +25,6 @@ const mapStateToProps = state => ({ domain: state.getIn(['meta', 'domain']), }); -export default @connect(mapStateToProps) -@injectIntl class FollowRequests extends ImmutablePureComponent { static propTypes = { @@ -53,16 +50,8 @@ class FollowRequests extends ImmutablePureComponent { render () { const { intl, accountIds, hasMore, multiColumn, locked, domain, isLoading } = this.props; - if (!accountIds) { - return ( - <Column name='follow-requests'> - <LoadingIndicator /> - </Column> - ); - } - const emptyMessage = <FormattedMessage id='empty_column.follow_requests' defaultMessage="You don't have any follow requests yet. When you receive one, it will show up here." />; - const unlockedPrependMessage = locked ? null : ( + const unlockedPrependMessage = !locked && accountIds.size > 0 && ( <div className='follow_requests-unlocked_explanation'> <FormattedMessage id='follow_requests.unlocked_explanation' @@ -81,6 +70,7 @@ class FollowRequests extends ImmutablePureComponent { onLoadMore={this.handleLoadMore} hasMore={hasMore} isLoading={isLoading} + showLoading={isLoading && accountIds.size === 0} emptyMessage={emptyMessage} bindToDocument={!multiColumn} prepend={unlockedPrependMessage} @@ -98,3 +88,5 @@ class FollowRequests extends ImmutablePureComponent { } } + +export default connect(mapStateToProps)(injectIntl(FollowRequests)); |