-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16265 from guerler/add_activities
Adjust notifications activity item
- Loading branch information
Showing
4 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
client/src/components/ActivityBar/Items/NotificationItem.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
import { computed } from "vue"; | ||
import { storeToRefs } from "pinia"; | ||
import { useNotificationsStore } from "@/stores/notificationsStore"; | ||
import ActivityItem from "components/ActivityBar/ActivityItem.vue"; | ||
const { totalUnreadCount } = storeToRefs(useNotificationsStore()); | ||
export interface Props { | ||
id: string; | ||
title: string; | ||
icon: string; | ||
isActive: boolean; | ||
to: string; | ||
} | ||
defineProps<Props>(); | ||
const emit = defineEmits<{ | ||
(e: "click"): void; | ||
}>(); | ||
const tooltip = computed(() => | ||
totalUnreadCount.value > 0 | ||
? `You have ${totalUnreadCount.value} unread notifications` | ||
: "You have no unread notifications" | ||
); | ||
</script> | ||
|
||
<template> | ||
<ActivityItem | ||
:id="id" | ||
:icon="icon" | ||
:indicator="!!totalUnreadCount" | ||
:is-active="isActive" | ||
:title="title" | ||
:tooltip="tooltip" | ||
:to="to" | ||
@click="emit('click')" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters