[feature] Option to hide followers/following (#2788)

This commit is contained in:
tobi 2024-04-02 11:42:24 +02:00 committed by GitHub
commit f05874be30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 322 additions and 83 deletions

View file

@ -65,6 +65,7 @@ function UserProfileForm({ data: profile }) {
- file avatar
- file header
- bool enable_rss
- bool hide_collections
- string custom_css (if enabled)
- string theme
*/
@ -98,6 +99,7 @@ function UserProfileForm({ data: profile }) {
locked: useBoolInput("locked", { source: profile }),
discoverable: useBoolInput("discoverable", { source: profile}),
enableRSS: useBoolInput("enable_rss", { source: profile }),
hideCollections: useBoolInput("hide_collections", { source: profile }),
fields: useFieldArrayInput("fields_attributes", {
defaultValue: profile?.source?.fields,
length: instanceConfig.maxPinnedFields
@ -208,6 +210,10 @@ function UserProfileForm({ data: profile }) {
field={form.enableRSS}
label="Enable RSS feed of Public posts"
/>
<Checkbox
field={form.hideCollections}
label="Hide who you follow / are followed by"
/>
<div className="form-section-docs">
<h3>Advanced</h3>

View file

@ -98,9 +98,9 @@
<dt>Posts</dt>
<dd>{{- .account.StatusesCount -}}</dd>
<dt>Followed by</dt>
<dd>{{- .account.FollowersCount -}}</dd>
<dd>{{- if .account.HideCollections -}}<i>hidden</i>{{- else -}}{{- .account.FollowersCount -}}{{- end -}}</dd>
<dt>Following</dt>
<dd>{{- .account.FollowingCount -}}</dd>
<dd>{{- if .account.HideCollections -}}<i>hidden</i>{{- else -}}{{- .account.FollowingCount -}}{{- end -}}</dd>
</dl>
</section>
<div class="statuses-wrapper" role="region" aria-label="Posts by {{ .account.Username -}}">