From 0668fea3b75ad157e618259375b17c341c4de7c2 Mon Sep 17 00:00:00 2001 From: Ankit Matth Date: Mon, 23 Oct 2023 17:01:41 +0530 Subject: [PATCH 1/2] Revamp Icon Effects --- frontend/src/assets/checkmark.svg | 4 +- .../src/conversation/ConversationBubble.tsx | 129 ++++++++++++++---- frontend/tailwind.config.cjs | 3 + 3 files changed, 103 insertions(+), 33 deletions(-) diff --git a/frontend/src/assets/checkmark.svg b/frontend/src/assets/checkmark.svg index 9ed02cbd..499000e8 100644 --- a/frontend/src/assets/checkmark.svg +++ b/frontend/src/assets/checkmark.svg @@ -1,3 +1 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 37b93f2e..dc02447c 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -37,8 +37,13 @@ const ConversationBubble = forwardRef< // Reset copied to false after a few seconds setTimeout(() => { setCopied(false); - }, 2000); + }, 3000); }; + const [isCopyHovered, setIsCopyHovered] = useState(false); + const [isLikeHovered, setIsLikeHovered] = useState(false); + const [isDislikeHovered, setIsDislikeHovered] = useState(false); + const [isLikeClicked, setIsLikeClicked] = useState(false); + const [isDislikeClicked, setIsDislikeClicked] = useState(false); let bubble; @@ -55,7 +60,10 @@ const ConversationBubble = forwardRef< ); } else { bubble = ( -
+
- {copied ? ( - - ) : ( - { - handleCopyClick(message); +
+
- )} + > + {copied ? ( + setIsCopyHovered(true)} + onMouseLeave={() => setIsCopyHovered(false)} + /> + ) : ( + { + handleCopyClick(message); + }} + onMouseEnter={() => setIsCopyHovered(true)} + onMouseLeave={() => setIsCopyHovered(false)} + > + )} +
+
- handleFeedback?.('LIKE')} - > +
+
+ { + handleFeedback?.('LIKE'); + setIsLikeClicked(true); + setIsDislikeClicked(false); + }} + onMouseEnter={() => setIsLikeHovered(true)} + onMouseLeave={() => setIsLikeHovered(false)} + > +
+
- handleFeedback?.('DISLIKE')} - > +
+
+ { + handleFeedback?.('DISLIKE'); + setIsDislikeClicked(true); + setIsLikeClicked(false); + }} + onMouseEnter={() => setIsDislikeHovered(true)} + onMouseLeave={() => setIsDislikeHovered(false)} + > +
+
diff --git a/frontend/tailwind.config.cjs b/frontend/tailwind.config.cjs index b76b0222..437f4a09 100644 --- a/frontend/tailwind.config.cjs +++ b/frontend/tailwind.config.cjs @@ -28,6 +28,9 @@ module.exports = { 'purple-30': '#7D54D1', 'blue-4000': 'rgba(0, 125, 255, 0.36)', 'blue-5000': 'rgba(0, 125, 255)', + 'green-2000': '#0FFF50', + 'light-gray': '#edeef0', + 'white-3000': '#ffffff', }, }, }, From 7a2e6e640dcddadf927d132c8c90a1ed6b9fc976 Mon Sep 17 00:00:00 2001 From: Ankit Matth <146843890+Ankit-Matth@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:48:25 +0530 Subject: [PATCH 2/2] [making required changes] - Update ConversationBubble.tsx --- .../src/conversation/ConversationBubble.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index dc02447c..7fb377b2 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -162,7 +162,7 @@ const ConversationBubble = forwardRef<
{copied ? ( @@ -199,16 +199,16 @@ const ConversationBubble = forwardRef< style={{ backgroundColor: isLikeHovered ? isLikeClicked - ? '#dfe3f5' - : '#edeef0' + ? '#7D54D1' + : '#EEEEEE' : isLikeClicked - ? '#dfe3f5' + ? '#7D54D1' : '#ffffff', }} >