From 8eba5314d72b5074df37faf964db50959194b230 Mon Sep 17 00:00:00 2001 From: Lim Zi Yang Date: Sat, 17 Feb 2024 17:16:09 +0800 Subject: [PATCH 1/3] refactor: update toast timeout to 3s --- frontend/src/components/ui/toaster.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/ui/toaster.tsx b/frontend/src/components/ui/toaster.tsx index e2233852..336d1c2f 100644 --- a/frontend/src/components/ui/toaster.tsx +++ b/frontend/src/components/ui/toaster.tsx @@ -14,7 +14,7 @@ export function Toaster() { const { toasts } = useToast() return ( - + {toasts.map(function ({ id, title, description, action, ...props }) { return ( From 34a5a348acb6174c8bba53f581730e54a2efdd5c Mon Sep 17 00:00:00 2001 From: Lim Zi Yang Date: Sat, 17 Feb 2024 17:17:29 +0800 Subject: [PATCH 2/3] feat: add success toast and update success colors --- frontend/src/components/ui/toast.tsx | 2 ++ frontend/src/styles/globals.css | 8 ++++---- frontend/tailwind.config.ts | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/ui/toast.tsx b/frontend/src/components/ui/toast.tsx index a8224775..991ffbe5 100644 --- a/frontend/src/components/ui/toast.tsx +++ b/frontend/src/components/ui/toast.tsx @@ -30,6 +30,8 @@ const toastVariants = cva( default: "border bg-background text-foreground", destructive: "destructive group border-destructive bg-destructive text-destructive-foreground", + success: + "success group border-success bg-success text-success-foreground", }, }, defaultVariants: { diff --git a/frontend/src/styles/globals.css b/frontend/src/styles/globals.css index 373d36b8..44189963 100644 --- a/frontend/src/styles/globals.css +++ b/frontend/src/styles/globals.css @@ -35,8 +35,8 @@ --ring: 215 20.2% 65.1%; - --success: 130, 80%, 60%; - --success-foreground: 0, 0%, 20%; + --success: 131.9, 54.26%, 43.73%; + --success-foreground: 0 25% 90%; --radius: 0.5rem; } @@ -73,8 +73,8 @@ --ring: 217.2 32.6% 17.5%; - --success: 130, 80%, 40%; - --success-foreground: 0, 0%, 80%; + --success: 131.9, 54.26%, 43.73%; + --success-foreground: 0 85.7% 97.3%; } } diff --git a/frontend/tailwind.config.ts b/frontend/tailwind.config.ts index 03688246..91fd0108 100644 --- a/frontend/tailwind.config.ts +++ b/frontend/tailwind.config.ts @@ -31,6 +31,10 @@ const config = { DEFAULT: "hsl(var(--destructive))", foreground: "hsl(var(--destructive-foreground))", }, + success: { + DEFAULT: "hsl(var(--success))", + foreground: "hsl(var(--success-foreground))", + }, muted: { DEFAULT: "hsl(var(--muted))", foreground: "hsl(var(--muted-foreground))", From 4e29c65d2616360e987f92d19b8157aa6c98216f Mon Sep 17 00:00:00 2001 From: Lim Zi Yang Date: Sun, 18 Feb 2024 15:38:43 +0800 Subject: [PATCH 3/3] feat: update toast to be success variant --- .../service-catalog/[pipelineId]/_hooks/use-service-request.ts | 1 + .../service-catalog/create-service/_hooks/use-create-service.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/src/app/(authenticated)/service-catalog/[pipelineId]/_hooks/use-service-request.ts b/frontend/src/app/(authenticated)/service-catalog/[pipelineId]/_hooks/use-service-request.ts index 6d0b5413..90862d44 100644 --- a/frontend/src/app/(authenticated)/service-catalog/[pipelineId]/_hooks/use-service-request.ts +++ b/frontend/src/app/(authenticated)/service-catalog/[pipelineId]/_hooks/use-service-request.ts @@ -74,6 +74,7 @@ const useServiceRequest = ({ pipelineId }: UseServiceRequestOptions) => { title: "Request Submission Successful", description: "Please check the dashboard for the status of the request.", + variant: "success", }) console.log("Response: ", data) }) diff --git a/frontend/src/app/(authenticated)/service-catalog/create-service/_hooks/use-create-service.ts b/frontend/src/app/(authenticated)/service-catalog/create-service/_hooks/use-create-service.ts index a4a05c46..afd3784b 100644 --- a/frontend/src/app/(authenticated)/service-catalog/create-service/_hooks/use-create-service.ts +++ b/frontend/src/app/(authenticated)/service-catalog/create-service/_hooks/use-create-service.ts @@ -136,6 +136,7 @@ const useCreateService = ({ router }: UseCreateServiceProps) => { toast({ title: "Service Creation Successful", description: "Redirecting to service catalog...", + variant: "success", }) setSubmitted(true) setTimeout(() => router.push("/service-catalog"), 1500)