diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 4ceddbff..d9defb9e 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -289,7 +289,7 @@ export default function Conversation() { className="relative right-[38px] bottom-[24px] -mr-[30px] animate-spin cursor-pointer self-end bg-transparent" > ) : ( -
+
(false); const [isShareModalOpen, setShareModalState] = useState(false); + const [isHovered, setIsHovered] = useState(false); const [deleteModalState, setDeleteModalState] = useState('INACTIVE'); const menuRef = useRef(null); @@ -79,20 +81,24 @@ export default function ConversationTile({ return (
{ + setOpen(false); + setIsHovered(true); + }} + onMouseLeave={() => { + setIsHovered(false); + }} onClick={() => { - selectConversation(conversation.id); + conversationId !== conversation.id && + selectConversation(conversation.id); }} className={`my-auto mx-4 mt-4 flex h-9 cursor-pointer items-center justify-between gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${ - conversationId === conversation.id + conversationId === conversation.id || isOpen ? 'bg-gray-100 dark:bg-[#28292E]' : '' }`} > -
+
)}
- {conversationId === conversation.id && ( + {(conversationId === conversation.id || isHovered || isOpen) && (
{isEdit ? (
@@ -120,34 +126,41 @@ export default function ConversationTile({ alt="Edit" className="mr-2 h-4 w-4 cursor-pointer text-white hover:opacity-50" id={`img-${conversation.id}`} - onClick={(event) => { + onClick={(event: SyntheticEvent) => { event.stopPropagation(); handleSaveConversation({ - id: conversationId, + id: conversation.id, name: conversationName, }); }} /> Exit { + onClick={(event: SyntheticEvent) => { event.stopPropagation(); onClear(); }} />
) : ( - )} {isOpen && ( -
+
diff --git a/frontend/src/conversation/SharedConversation.tsx b/frontend/src/conversation/SharedConversation.tsx index 78d49a79..cbe80717 100644 --- a/frontend/src/conversation/SharedConversation.tsx +++ b/frontend/src/conversation/SharedConversation.tsx @@ -262,7 +262,7 @@ export const SharedConversation = () => { className="relative right-[38px] bottom-[24px] -mr-[30px] animate-spin cursor-pointer self-end bg-transparent filter dark:invert" > ) : ( -
+
event.stopPropagation()} className={`${ modalState === 'ACTIVE' ? 'visible' : 'hidden' } fixed top-0 left-0 z-30 h-screen w-screen bg-gray-alpha`} diff --git a/frontend/src/modals/ShareConversationModal.tsx b/frontend/src/modals/ShareConversationModal.tsx index 870c032c..e26cbd38 100644 --- a/frontend/src/modals/ShareConversationModal.tsx +++ b/frontend/src/modals/ShareConversationModal.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { SyntheticEvent, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; import { @@ -117,7 +117,10 @@ export const ShareConversationModal = ({ }; return ( -
+
event.stopPropagation()} + className="z-100 fixed top-0 left-0 flex h-screen w-screen items-center justify-center bg-gray-alpha bg-opacity-50 text-chinese-black dark:text-silver" + >