kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'hide-network' into 'develop'
Support hidden stats Closes #569 See merge request soapbox-pub/soapbox-fe!531merge-requests/532/merge
commit
282c9d2bfe
|
@ -255,6 +255,7 @@ class Header extends ImmutablePureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const self = account.get('id') === me;
|
||||||
const info = this.makeInfo();
|
const info = this.makeInfo();
|
||||||
const menu = this.makeMenu();
|
const menu = this.makeMenu();
|
||||||
|
|
||||||
|
@ -286,18 +287,18 @@ class Header extends ImmutablePureComponent {
|
||||||
<span><FormattedMessage id='account.posts' defaultMessage='Posts' /></span>
|
<span><FormattedMessage id='account.posts' defaultMessage='Posts' /></span>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
|
|
||||||
<NavLink exact activeClassName='active' to={`/@${account.get('acct')}/following`} title={intl.formatNumber(account.get('following_count'))}>
|
{(self || !account.getIn(['pleroma', 'hide_follows'], false)) && <NavLink exact activeClassName='active' to={`/@${account.get('acct')}/following`} title={intl.formatNumber(account.get('following_count'))}>
|
||||||
<span>{shortNumberFormat(account.get('following_count'))}</span>
|
{account.getIn(['pleroma', 'hide_follows_count'], false) ? <span>•</span> : <span>{shortNumberFormat(account.get('following_count'))}</span>}
|
||||||
<span><FormattedMessage id='account.follows' defaultMessage='Follows' /></span>
|
<span><FormattedMessage id='account.follows' defaultMessage='Follows' /></span>
|
||||||
</NavLink>
|
</NavLink>}
|
||||||
|
|
||||||
<NavLink exact activeClassName='active' to={`/@${account.get('acct')}/followers`} title={intl.formatNumber(account.get('followers_count'))}>
|
{(self || !account.getIn(['pleroma', 'hide_followers'], false)) && <NavLink exact activeClassName='active' to={`/@${account.get('acct')}/followers`} title={intl.formatNumber(account.get('followers_count'))}>
|
||||||
<span>{shortNumberFormat(account.get('followers_count'))}</span>
|
{account.getIn(['pleroma', 'hide_followers_count'], false) ? <span>•</span> : <span>{shortNumberFormat(account.get('followers_count'))}</span>}
|
||||||
<span><FormattedMessage id='account.followers' defaultMessage='Followers' /></span>
|
<span><FormattedMessage id='account.followers' defaultMessage='Followers' /></span>
|
||||||
</NavLink>
|
</NavLink>}
|
||||||
|
|
||||||
{
|
{
|
||||||
account.get('id') === me &&
|
self &&
|
||||||
<div>
|
<div>
|
||||||
<NavLink
|
<NavLink
|
||||||
exact activeClassName='active' to={`/@${account.get('acct')}/favorites`}
|
exact activeClassName='active' to={`/@${account.get('acct')}/favorites`}
|
||||||
|
|
|
@ -26,6 +26,14 @@ import { isVerified } from 'soapbox/utils/accounts';
|
||||||
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
|
import { getSoapboxConfig } from 'soapbox/actions/soapbox';
|
||||||
import { getFeatures } from 'soapbox/utils/features';
|
import { getFeatures } from 'soapbox/utils/features';
|
||||||
|
|
||||||
|
const hidesNetwork = account => {
|
||||||
|
const pleroma = account.get('pleroma');
|
||||||
|
if (!pleroma) return false;
|
||||||
|
|
||||||
|
const { hide_followers, hide_follows, hide_followers_count, hide_follows_count } = pleroma.toJS();
|
||||||
|
return hide_followers && hide_follows && hide_followers_count && hide_follows_count;
|
||||||
|
};
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
heading: { id: 'column.edit_profile', defaultMessage: 'Edit profile' },
|
heading: { id: 'column.edit_profile', defaultMessage: 'Edit profile' },
|
||||||
metaFieldLabel: { id: 'edit_profile.fields.meta_fields.label_placeholder', defaultMessage: 'Label' },
|
metaFieldLabel: { id: 'edit_profile.fields.meta_fields.label_placeholder', defaultMessage: 'Label' },
|
||||||
|
@ -87,6 +95,7 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
map.set('fields', normalizeFields(map.get('fields'), props.maxFields));
|
map.set('fields', normalizeFields(map.get('fields'), props.maxFields));
|
||||||
map.set('stranger_notifications', strangerNotifications);
|
map.set('stranger_notifications', strangerNotifications);
|
||||||
map.set('accepts_email_list', acceptsEmailList);
|
map.set('accepts_email_list', acceptsEmailList);
|
||||||
|
map.set('hide_network', hidesNetwork(account));
|
||||||
unescapeParams(map, ['display_name', 'bio']);
|
unescapeParams(map, ['display_name', 'bio']);
|
||||||
});
|
});
|
||||||
this.state = initialState.toObject();
|
this.state = initialState.toObject();
|
||||||
|
@ -122,6 +131,10 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
header: state.header_file,
|
header: state.header_file,
|
||||||
locked: state.locked,
|
locked: state.locked,
|
||||||
accepts_email_list: state.accepts_email_list,
|
accepts_email_list: state.accepts_email_list,
|
||||||
|
hide_followers: state.hide_network,
|
||||||
|
hide_follows: state.hide_network,
|
||||||
|
hide_followers_count: state.hide_network,
|
||||||
|
hide_follows_count: state.hide_network,
|
||||||
}, this.getFieldParams().toJS());
|
}, this.getFieldParams().toJS());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,6 +250,13 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
checked={this.state.locked}
|
checked={this.state.locked}
|
||||||
onChange={this.handleCheckboxChange}
|
onChange={this.handleCheckboxChange}
|
||||||
/>
|
/>
|
||||||
|
<Checkbox
|
||||||
|
label={<FormattedMessage id='edit_profile.fields.hide_network_label' defaultMessage='Hide network' />}
|
||||||
|
hint={<FormattedMessage id='edit_profile.hints.hide_network' defaultMessage='Who you follow and who follows you will not be shown on your profile' />}
|
||||||
|
name='hide_network'
|
||||||
|
checked={this.state.hide_network}
|
||||||
|
onChange={this.handleCheckboxChange}
|
||||||
|
/>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
label={<FormattedMessage id='edit_profile.fields.bot_label' defaultMessage='This is a bot account' />}
|
label={<FormattedMessage id='edit_profile.fields.bot_label' defaultMessage='This is a bot account' />}
|
||||||
hint={<FormattedMessage id='edit_profile.hints.bot' defaultMessage='This account mainly performs automated actions and might not be monitored' />}
|
hint={<FormattedMessage id='edit_profile.hints.bot' defaultMessage='This account mainly performs automated actions and might not be monitored' />}
|
||||||
|
|
Ładowanie…
Reference in New Issue