11<script setup lang="ts">
2+ import { Markdown } from ' @/helpers/markdown' ;
23import {
34 ArchiveBoxIcon ,
45 CheckBadgeIcon ,
@@ -14,15 +15,14 @@ import {
1415 archiveNotification as archiveMutation ,
1516 deleteNotification as deleteMutation ,
1617} from ' ./graphql/notification.query' ;
17- import { Markdown } from ' @/helpers/markdown' ;
1818
1919const props = defineProps <NotificationFragmentFragment >();
2020
2121const descriptionMarkup = computedAsync (async () => {
2222 try {
2323 return await Markdown .parse (props .description );
2424 } catch (e ) {
25- console .error (e )
25+ console .error (e );
2626 return props .description ;
2727 }
2828}, ' ' );
@@ -32,17 +32,17 @@ const icon = computed<{ component: Component; color: string } | null>(() => {
3232 case ' INFO' :
3333 return {
3434 component: CheckBadgeIcon ,
35- color: ' text-green-500 ' ,
35+ color: ' text-unraid-green ' ,
3636 };
3737 case ' WARNING' :
3838 return {
3939 component: ExclamationTriangleIcon ,
40- color: ' text-yellow-500 ' ,
40+ color: ' text-yellow-accent ' ,
4141 };
4242 case ' ALERT' :
4343 return {
4444 component: ShieldExclamationIcon ,
45- color: ' text-red-500 ' ,
45+ color: ' text-unraid-red ' ,
4646 };
4747 }
4848 return null ;
@@ -66,66 +66,57 @@ const mutationError = computed(() => {
6666 </script >
6767
6868<template >
69- <div class =" group/item relative w-full py-4 pl-1 flex flex-col gap-2" >
70- <header
71- class =" w-full flex flex-row items-baseline justify-between gap-2 -translate-y-1 group-hover/item:font-medium group-focus/item:font-medium"
72- >
73- <h3
74- class =" text-muted-foreground text-[0.875rem] tracking-wide flex flex-row items-baseline gap-2 uppercase"
75- >
69+ <!-- fixed width hack ensures alignment with other elements regardless of scrollbar presence or width -->
70+ <div class =" group/item relative py-5 flex flex-col gap-2 text-base w-[487px]" >
71+ <header class =" w-full flex flex-row items-baseline justify-between gap-2 -translate-y-1" >
72+ <h3 class =" tracking-normal flex flex-row items-baseline gap-2 uppercase font-bold" >
7673 <!-- the `translate` compensates for extra space added by the `svg` element when rendered -->
7774 <component
7875 :is =" icon.component"
7976 v-if =" icon"
80- class =" size-5 shrink-0 translate-y-1.5 "
77+ class =" size-5 shrink-0 translate-y-1"
8178 :class =" icon.color"
8279 />
8380 <span >{{ title }}</span >
8481 </h3 >
8582
8683 <div class =" shrink-0 flex flex-row items-baseline justify-end gap-2 mt-1" >
87- <p class =" text-12px opacity-75 " >{{ formattedTimestamp }}</p >
84+ <p class =" text-gray-500 text-sm " >{{ formattedTimestamp }}</p >
8885 </div >
8986 </header >
9087
91- <h4 class =" group-hover/item: font-medium group-focus/item:font-medium " >
88+ <h4 class =" font-bold " >
9289 {{ subject }}
9390 </h4 >
9491
95- <div
96- class =" w-full flex flex-row items-center justify-between gap-2 opacity-75 group-hover/item:opacity-100 group-focus/item:opacity-100"
97- >
98- <div class =" text-secondary-foreground" v-html =" descriptionMarkup" />
92+ <div class =" w-full flex flex-row items-center justify-between gap-2" >
93+ <div class =" " v-html =" descriptionMarkup" />
9994 </div >
10095
10196 <p v-if =" mutationError" class =" text-red-600" >Error: {{ mutationError }}</p >
10297
103- <div class =" flex justify-end items-baseline gap-2 " >
98+ <div class =" flex justify-end items-baseline gap-4 " >
10499 <a v-if =" link" :href =" link" >
105- <Button type =" button" variant =" outline" size = " xs " >
106- <LinkIcon class =" size-3 mr-1 text-muted-foreground/80 " />
107- <span class =" text-sm text-muted-foreground mt-0.5 " >View</span >
100+ <Button type =" button" variant =" outline" >
101+ <LinkIcon class =" size-4 mr-2 " />
102+ <span class =" text-sm" >View</span >
108103 </Button >
109104 </a >
110105 <Button
111106 v-if =" type === NotificationType.Unread"
112107 :disabled =" archive.loading"
113- class =" relative z-20 rounded"
114- size =" xs"
115108 @click =" archive.mutate"
116109 >
117- <ArchiveBoxIcon class =" size-3 mr-1 " />
118- <span class =" text-sm mt-0.5 " >Archive</span >
110+ <ArchiveBoxIcon class =" size-4 mr-2 " />
111+ <span class =" text-sm" >Archive</span >
119112 </Button >
120113 <Button
121114 v-if =" type === NotificationType.Archive"
122115 :disabled =" deleteNotification.loading"
123- class =" relative z-20 rounded"
124- size =" xs"
125116 @click =" deleteNotification.mutate"
126117 >
127- <TrashIcon class =" size-3 mr-1 " />
128- <span class =" text-sm mt-0.5 " >Delete</span >
118+ <TrashIcon class =" size-4 mr-2 " />
119+ <span class =" text-sm" >Delete</span >
129120 </Button >
130121 </div >
131122 </div >
0 commit comments