11<script setup lang="ts">
2- import {
3- Sheet ,
4- SheetContent ,
5- SheetHeader ,
6- SheetTitle ,
7- SheetTrigger ,
8- } from " @/components/shadcn/sheet" ;
9-
10- import { archiveAllNotifications } from " ./graphql/notification.query" ;
2+ import { Sheet , SheetContent , SheetHeader , SheetTitle , SheetTrigger } from ' @/components/shadcn/sheet' ;
3+ import { useMutation } from ' @vue/apollo-composable' ;
114// eslint-disable-next-line @typescript-eslint/consistent-type-imports -- false positive :(
12- import { Importance , NotificationType } from " ~/composables/gql/graphql" ;
13- import { useMutation } from " @vue/apollo-composable " ;
5+ import { Importance , NotificationType } from ' ~/composables/gql/graphql' ;
6+ import { archiveAllNotifications } from ' ./graphql/notification.query ' ;
147
15- const { mutate : archiveAll, loading : loadingArchiveAll } = useMutation (
16- archiveAllNotifications
17- );
8+ const { mutate : archiveAll, loading : loadingArchiveAll } = useMutation (archiveAllNotifications );
189const { teleportTarget, determineTeleportTarget } = useTeleport ();
1910const importance = ref <Importance | undefined >(undefined );
2011 </script >
@@ -27,10 +18,7 @@ const importance = ref<Importance | undefined>(undefined);
2718 </SheetTrigger >
2819
2920 <!-- We remove the horizontal padding from the container to keep the NotificationList's scrollbar in the right place -->
30- <SheetContent
31- :to =" teleportTarget"
32- class =" w-full sm:max-w-[540px] h-screen px-0"
33- >
21+ <SheetContent :to =" teleportTarget" class =" w-full sm:max-w-[540px] h-screen px-0" >
3422 <div class =" flex flex-col h-full gap-3" >
3523 <SheetHeader class =" ml-1 px-6" >
3624 <SheetTitle >Notifications</SheetTitle >
@@ -39,10 +27,8 @@ const importance = ref<Importance | undefined>(undefined);
3927 <!-- min-h-0 prevents the flex container from expanding beyond its containing bounds. -->
4028 <!-- this is necessary because flex items have a default min-height: auto, -->
4129 <!-- which means they won't shrink below the height of their content, even if you use flex-1 or other flex properties. -->
42- <Tabs default-value =" unread" class =" flex-1 flex flex-col min-h-0" >
43- <div
44- class =" flex flex-row justify-between items-center flex-wrap gap-2 px-6"
45- >
30+ <Tabs default-value =" unread" class =" flex-1 flex flex-col min-h-0" activation-mode =" manual" >
31+ <div class =" flex flex-row justify-between items-center flex-wrap gap-2 px-6" >
4632 <TabsList class =" ml-[1px]" >
4733 <TabsTrigger value =" unread" > Unread </TabsTrigger >
4834 <TabsTrigger value =" archived" > Archived </TabsTrigger >
@@ -59,13 +45,14 @@ const importance = ref<Importance | undefined>(undefined);
5945 </Button >
6046
6147 <Select
62- @update:model-value =" (val) => {importance = val as Importance}"
48+ @update:model-value ="
49+ (val) => {
50+ importance = val as Importance;
51+ }
52+ "
6353 >
6454 <SelectTrigger class =" bg-secondary border-0 h-auto" >
65- <SelectValue
66- class =" text-muted-foreground"
67- placeholder =" Filter"
68- />
55+ <SelectValue class =" text-muted-foreground" placeholder =" Filter" />
6956 </SelectTrigger >
7057 <SelectContent :to =" teleportTarget" >
7158 <SelectGroup >
@@ -79,17 +66,11 @@ const importance = ref<Importance | undefined>(undefined);
7966 </div >
8067
8168 <TabsContent value =" unread" class =" flex-1 min-h-0 mt-3" >
82- <NotificationsList
83- :importance =" importance"
84- :type =" NotificationType.Unread"
85- />
69+ <NotificationsList :importance =" importance" :type =" NotificationType.Unread" />
8670 </TabsContent >
8771
8872 <TabsContent value =" archived" class =" flex-1 min-h-0 mt-3" >
89- <NotificationsList
90- :importance =" importance"
91- :type =" NotificationType.Archive"
92- />
73+ <NotificationsList :importance =" importance" :type =" NotificationType.Archive" />
9374 </TabsContent >
9475 </Tabs >
9576 </div >
0 commit comments