From 6efc52f3bd62d2c9537fdd5d11077541ff7c644e Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Tue, 19 Dec 2023 13:32:12 +0700 Subject: [PATCH] fix: added dialog confirmation when delete thread --- uikit/src/button/styles.scss | 4 +- web/screens/Chat/ThreadList/index.tsx | 54 ++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/uikit/src/button/styles.scss b/uikit/src/button/styles.scss index 481508841..2b1e239a5 100644 --- a/uikit/src/button/styles.scss +++ b/uikit/src/button/styles.scss @@ -1,6 +1,6 @@ .btn { @apply inline-flex items-center justify-center whitespace-nowrap rounded-lg font-semibold transition-colors; - @apply focus-visible:ring-ring cursor-pointer focus-visible:outline-none focus-visible:ring-1; + @apply cursor-pointer focus:outline-none focus-visible:outline-none focus-visible:ring-0; @apply disabled:pointer-events-none disabled:opacity-50; &-primary { @@ -28,7 +28,7 @@ } &-ghost { - @apply hover:bg-primary hover:text-primary-foreground; + @apply hover:bg-secondary hover:text-secondary-foreground; } &-sm { diff --git a/web/screens/Chat/ThreadList/index.tsx b/web/screens/Chat/ThreadList/index.tsx index 5b5a8d91d..96af66cec 100644 --- a/web/screens/Chat/ThreadList/index.tsx +++ b/web/screens/Chat/ThreadList/index.tsx @@ -1,5 +1,16 @@ import { useEffect } from 'react' +import { + Modal, + ModalTrigger, + ModalClose, + ModalFooter, + ModalContent, + ModalHeader, + ModalTitle, + Button, +} from '@janhq/uikit' + import { motion as m } from 'framer-motion' import { useAtomValue } from 'jotai' import { @@ -107,15 +118,40 @@ export default function ThreadList() { Clean thread -
deleteThread(thread.id)} - > - - - Delete thread - -
+ + +
+ + + Delete thread + +
+
+ + + Delete Thread + +

Are you sure you want to delete Thread?

+ +
+ + + + + + +
+
+
+
{/* {messages.length > 0 && (