From e05d01788f19729ddca7d0ac40416ae0197625b3 Mon Sep 17 00:00:00 2001 From: usopp Date: Fri, 20 Dec 2024 00:11:48 +0100 Subject: [PATCH 1/3] style(notifications): better notification item style --- .../notifications/delete-notification.tsx | 11 ++- .../notifications/show-notifications.tsx | 90 ++++++++++--------- .../notifications/update-notification.tsx | 8 +- 3 files changed, 63 insertions(+), 46 deletions(-) diff --git a/apps/dokploy/components/dashboard/settings/notifications/delete-notification.tsx b/apps/dokploy/components/dashboard/settings/notifications/delete-notification.tsx index 468db8510..4bb197b29 100644 --- a/apps/dokploy/components/dashboard/settings/notifications/delete-notification.tsx +++ b/apps/dokploy/components/dashboard/settings/notifications/delete-notification.tsx @@ -11,7 +11,7 @@ import { } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; -import { TrashIcon } from "lucide-react"; +import { Trash2 } from "lucide-react"; import React from "react"; import { toast } from "sonner"; @@ -24,8 +24,13 @@ export const DeleteNotification = ({ notificationId }: Props) => { return ( - diff --git a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx index c22f7b720..d742500f2 100644 --- a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx +++ b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx @@ -40,48 +40,58 @@ export const ShowNotifications = () => { ) : (
-
- {data?.map((notification, index) => ( -
-
- {notification.notificationType === "slack" && ( - - )} - {notification.notificationType === "telegram" && ( - - )} - {notification.notificationType === "discord" && ( - - )} - {notification.notificationType === "email" && ( - - )} - - {notification.name} - -
- -
- - -
-
- ))} -
-
- +
+ {data?.map((notification, index) => ( +
+
+ {notification.notificationType === "slack" && ( +
+ +
+ )} + {notification.notificationType === "telegram" && ( +
+ +
+ )} + {notification.notificationType === "discord" && ( +
+ +
+ )} + {notification.notificationType === "email" && ( +
+ +
+ )} +
+ + {notification.name} + + + {notification.notificationType[0].toUpperCase() + notification.notificationType.slice(1)} notification + +
+
+
+ + +
+ ))} +
+ +
+
+
)} diff --git a/apps/dokploy/components/dashboard/settings/notifications/update-notification.tsx b/apps/dokploy/components/dashboard/settings/notifications/update-notification.tsx index 9bdf35f14..cfa2e0bab 100644 --- a/apps/dokploy/components/dashboard/settings/notifications/update-notification.tsx +++ b/apps/dokploy/components/dashboard/settings/notifications/update-notification.tsx @@ -26,7 +26,7 @@ import { Input } from "@/components/ui/input"; import { Switch } from "@/components/ui/switch"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; -import { Mail, PenBoxIcon } from "lucide-react"; +import { Mail, Pen } from "lucide-react"; import { useEffect, useState } from "react"; import { FieldErrors, useFieldArray, useForm } from "react-hook-form"; import { toast } from "sonner"; @@ -218,8 +218,10 @@ export const UpdateNotification = ({ notificationId }: Props) => { return ( - From 77336a21f9889588b0b99f63c1b95afa4d726512 Mon Sep 17 00:00:00 2001 From: usopp Date: Fri, 20 Dec 2024 00:21:51 +0100 Subject: [PATCH 2/3] chore: lint --- .../dashboard/settings/notifications/show-notifications.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx index d742500f2..28aeb8c05 100644 --- a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx +++ b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx @@ -72,7 +72,7 @@ export const ShowNotifications = () => { {notification.name} - {notification.notificationType[0].toUpperCase() + notification.notificationType.slice(1)} notification + {notification.notificationType && notification.notificationType[0].toUpperCase() + notification.notificationType.slice(1)} notification
From ed8be62ff30dcaeeea34ec815e15f74e45fa46a4 Mon Sep 17 00:00:00 2001 From: usopp Date: Fri, 20 Dec 2024 00:24:44 +0100 Subject: [PATCH 3/3] chore: lint --- .../dashboard/settings/notifications/show-notifications.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx index 28aeb8c05..10ea7304e 100644 --- a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx +++ b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx @@ -72,7 +72,7 @@ export const ShowNotifications = () => { {notification.name} - {notification.notificationType && notification.notificationType[0].toUpperCase() + notification.notificationType.slice(1)} notification + {notification.notificationType?.[0]?.toUpperCase() + notification.notificationType?.slice(1)} notification