Use neutral badge for drafts

This commit is contained in:
tusooa 2023-04-06 12:35:51 -04:00
parent b3236e707c
commit aa59adc81f
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
5 changed files with 25 additions and 4 deletions

View File

@ -703,6 +703,13 @@ option {
color: white; color: white;
color: var(--badgeNotificationText, white); color: var(--badgeNotificationText, white);
} }
&.badge-neutral {
background-color: $fallback--cGreen;
background-color: var(--badgeNeutral, $fallback--cGreen);
color: white;
color: var(--badgeNeutralText, white);
}
} }
.alert { .alert {

View File

@ -56,6 +56,7 @@ export const ROOT_ITEMS = {
route: 'chats', route: 'chats',
icon: 'comments', icon: 'comments',
label: 'nav.chats', label: 'nav.chats',
badgeStyle: 'notification',
badgeGetter: 'unreadChatCount', badgeGetter: 'unreadChatCount',
criteria: ['chats'] criteria: ['chats']
}, },
@ -63,6 +64,7 @@ export const ROOT_ITEMS = {
route: 'friend-requests', route: 'friend-requests',
icon: 'user-plus', icon: 'user-plus',
label: 'nav.friend_requests', label: 'nav.friend_requests',
badgeStyle: 'notification',
criteria: ['lockedUser'], criteria: ['lockedUser'],
badgeGetter: 'followRequestCount' badgeGetter: 'followRequestCount'
}, },
@ -76,6 +78,7 @@ export const ROOT_ITEMS = {
route: 'announcements', route: 'announcements',
icon: 'bullhorn', icon: 'bullhorn',
label: 'nav.announcements', label: 'nav.announcements',
badgeStyle: 'notification',
badgeGetter: 'unreadAnnouncementCount', badgeGetter: 'unreadAnnouncementCount',
criteria: ['announcements'] criteria: ['announcements']
}, },
@ -83,6 +86,7 @@ export const ROOT_ITEMS = {
route: 'drafts', route: 'drafts',
icon: 'file-pen', icon: 'file-pen',
label: 'nav.drafts', label: 'nav.drafts',
badgeStyle: 'neutral',
badgeGetter: 'draftCount' badgeGetter: 'draftCount'
} }
} }

View File

@ -35,7 +35,8 @@
<slot /> <slot />
<div <div
v-if="item.badgeGetter && getters[item.badgeGetter]" v-if="item.badgeGetter && getters[item.badgeGetter]"
class="badge badge-notification" class="badge"
:class="[`badge-${item.badgeStyle}`]"
> >
{{ getters[item.badgeGetter] }} {{ getters[item.badgeGetter] }}
</div> </div>

View File

@ -19,6 +19,7 @@
<div <div
v-if="item.badgeGetter && getters[item.badgeGetter]" v-if="item.badgeGetter && getters[item.badgeGetter]"
class="alert-dot" class="alert-dot"
:class="[`alert-dot-${item.badgeStyle}`]"
/> />
</router-link> </router-link>
</span> </span>
@ -42,8 +43,16 @@
position: absolute; position: absolute;
right: calc(50% - 0.75em); right: calc(50% - 0.75em);
top: calc(50% - 0.5em); top: calc(50% - 0.5em);
background-color: $fallback--cRed;
background-color: var(--badgeNotification, $fallback--cRed); &.alert-dot-notification {
background-color: $fallback--cRed;
background-color: var(--badgeNotification, $fallback--cRed);
}
&.alert-dot-neutral {
background-color: $fallback--cGreen;
background-color: var(--badgeNeutral, $fallback--cGreen);
}
} }
.pinned-item { .pinned-item {

View File

@ -225,7 +225,7 @@
/> {{ $t('nav.drafts') }} /> {{ $t('nav.drafts') }}
<span <span
v-if="draftCount" v-if="draftCount"
class="badge badge-notification" class="badge badge-neutral"
> >
{{ draftCount }} {{ draftCount }}
</span> </span>