Add user options to hide instance favicon and name

This commit is contained in:
eris 2022-08-01 23:03:04 +00:00 committed by Sam Therapy
parent 79e3dc099b
commit 78382a27ea
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
9 changed files with 49 additions and 10 deletions

View file

@ -80,7 +80,16 @@ export default {
})
},
logo () { return this.$store.state.instance.logo },
mergedConfig () {
return this.$store.getters.mergedConfig
},
sitename () { return this.$store.state.instance.name },
hideSiteFavicon () {
return this.mergedConfig.hideSiteFavicon
},
hideSiteName () {
return this.mergedConfig.hideSiteName
},
hideSitename () { return this.$store.state.instance.hideSitename },
logoLeft () { return this.$store.state.instance.logoLeft },
currentUser () { return this.$store.state.users.currentUser },

View file

@ -109,6 +109,11 @@
}
}
.svg-inline--fa {
color: $fallback--link;
color: var(--topBarLink, $fallback--link);
}
.nav-icon {
margin-left: 0.7em;
width: 2em;
@ -123,6 +128,7 @@
font-weight: bolder;
color: $fallback--text;
color: var(--selectedMenuText, $fallback--text);
--lightText: var(--selectedMenuLightText, $fallback--lightText);
}
}
@ -130,11 +136,6 @@
&-logout {
margin-left: 2em;
}
.svg-inline--fa {
color: $fallback--link;
color: var(--topBarLink, $fallback--link);
}
}
.left {

View file

@ -13,11 +13,12 @@
active-class="home"
>
<img
v-if="!hideSiteFavicon"
class="favicon"
src="/favicon.png"
>
<span
v-if="!hideSitename"
v-if="!hideSiteName"
class="site-name"
>
{{ sitename }}

View file

@ -52,7 +52,12 @@ const MobileNav = {
unseenNotificationsCount () {
return this.unseenNotifications.length
},
hideSitename () { return this.$store.state.instance.hideSitename },
mergedConfig () {
return this.$store.getters.mergedConfig
},
hideSiteName () {
return this.mergedConfig.hideSiteName
},
sitename () { return this.$store.state.instance.name },
isChat () {
return this.$route.name === 'chat'

View file

@ -23,8 +23,16 @@
class="alert-dot"
/>
</button>
<NavigationPins class="pins" />
</div> <div class="item right">
<router-link
v-if="!hideSiteName"
class="site-name"
:to="{ name: 'root' }"
active-class="home"
>
{{ sitename }}
</router-link>
</div>
<div class="item right">
<button
v-if="currentUser"
class="button-unstyled mobile-nav-button"

View file

@ -25,6 +25,16 @@
<div class="setting-item">
<h2>{{ $t('nav.timeline') }}</h2>
<ul class="setting-list">
<li>
<BooleanSetting path="hideSiteFavicon">
{{ $t('settings.hide_site_favicon') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="hideSiteName">
{{ $t('settings.hide_site_name') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="stopGifs">
{{ $t('settings.stop_gifs') }}

View file

@ -507,6 +507,8 @@
"preload_images": "Preload images",
"use_one_click_nsfw": "Open NSFW attachments with just one click",
"hide_post_stats": "Hide post statistics (e.g. the number of favorites)",
"hide_site_favicon": "Hide instance favicon in top panel",
"hide_site_name": "Hide instance name in top panel",
"hide_user_stats": "Hide user statistics (e.g. the number of followers)",
"hide_filtered_statuses": "Hide all filtered posts",
"hide_wordfiltered_statuses": "Hide word-filtered statuses",

View file

@ -40,6 +40,8 @@ export const defaultState = {
muteBotStatuses: undefined, // instance default
collapseMessageWithSubject: undefined, // instance default
padEmoji: true,
hideSiteFavicon: undefined, // instance default
hideSiteName: undefined, // instance default
swapReacts: true,
hideAttachments: false,
hideAttachmentsInConv: false,

View file

@ -68,7 +68,8 @@ const defaultState = {
hideWordFilteredPosts: false,
hidePostStats: false,
hideBotIndication: false,
hideSitename: false,
hideSiteFavicon: false,
hideSiteName: false,
hideUserStats: false,
muteBotStatuses: false,
modalOnRepeat: false,