MoreFollows: hide if not federating
This commit is contained in:
parent
89ac03e07a
commit
61282f0963
|
@ -1,6 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
|
import { getFeatures } from 'soapbox/utils/features';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
following: {
|
following: {
|
||||||
|
@ -14,7 +16,16 @@ const messages = defineMessages({
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export default @injectIntl
|
const mapStateToProps = state => {
|
||||||
|
const instance = state.get('instance');
|
||||||
|
|
||||||
|
return {
|
||||||
|
features: getFeatures(instance),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default @connect(mapStateToProps)
|
||||||
|
@injectIntl
|
||||||
class MoreFollows extends React.PureComponent {
|
class MoreFollows extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -22,6 +33,7 @@ class MoreFollows extends React.PureComponent {
|
||||||
count: PropTypes.number,
|
count: PropTypes.number,
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
|
features: PropTypes.object.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
@ -34,6 +46,13 @@ class MoreFollows extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { features } = this.props;
|
||||||
|
|
||||||
|
// If the instance isn't federating, there are no remote followers
|
||||||
|
if (!features.federating) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='morefollows-indicator'>
|
<div className='morefollows-indicator'>
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in New Issue