feat(frontend): Close notification slider over on click, fix types, delete dead code
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
:key="notification.id"
|
||||
:to="notification.clickTarget"
|
||||
class="px-3 py-2.5 rounded-md hover:bg-elevated/50 flex items-center gap-3 relative -mx-3 first:-mt-3 last:-mb-3"
|
||||
@click="handleNotificationClick(notification)"
|
||||
@click="onNotificationClick(notification)"
|
||||
>
|
||||
<UChip
|
||||
:color="notification.type === 'ERROR' ? 'error' : notification.type === 'WARNING' ? 'warning' : 'primary'"
|
||||
@@ -54,7 +54,7 @@
|
||||
{{ notification.type }}
|
||||
</UBadge>
|
||||
<UBadge color="neutral" variant="subtle" size="xs">
|
||||
{{ notification.targetGroup }}
|
||||
{{ notification.role }}
|
||||
</UBadge>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { formatTimeAgo } from '@vueuse/core'
|
||||
import type { NotificationDto } from '~/.api-client'
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean]
|
||||
@@ -86,4 +87,9 @@ watch(isOpen, async (newValue) => {
|
||||
await fetchNotifications()
|
||||
}
|
||||
})
|
||||
|
||||
function onNotificationClick(notification: NotificationDto) {
|
||||
handleNotificationClick(notification)
|
||||
emit('update:modelValue', false)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user