From 54a2cc28761a36a7596d1e266df8f58fa5e9be5a Mon Sep 17 00:00:00 2001 From: addiii4 Date: Tue, 3 Sep 2024 06:52:26 +1000 Subject: [PATCH 1/2] Fixed close button vanishing when scrolling --- src/App.jsx | 2 -- src/components/ChatbotButton.jsx | 36 ++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 496fe47..a710d85 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,6 +1,4 @@ import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' import { ChakraProvider } from '@chakra-ui/react'; import ChatbotButton from './components/ChatbotButton'; import './App.css' diff --git a/src/components/ChatbotButton.jsx b/src/components/ChatbotButton.jsx index 670a4e0..8a8ef13 100644 --- a/src/components/ChatbotButton.jsx +++ b/src/components/ChatbotButton.jsx @@ -25,7 +25,13 @@ const ChatbotButton = () => { return ( {!isOpen && ( - } /> + } + /> )} {isOpen && ( { display="flex" flexDirection="column" > + } + onClick={toggleChat} + colorScheme="red" + size="sm" + borderRadius="full" + width="1" + mr="0" + /> - - } - onClick={toggleChat} - colorScheme="red" - size="sm" - borderRadius="full" - /> - + {isInitialLoaded && ( {messages.map((message, index) => ( { Date: Wed, 2 Oct 2024 11:42:53 +1000 Subject: [PATCH 2/2] Changed button to work now --- src/components/ChatbotButton.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ChatbotButton.jsx b/src/components/ChatbotButton.jsx index 8a8ef13..7bc0735 100644 --- a/src/components/ChatbotButton.jsx +++ b/src/components/ChatbotButton.jsx @@ -53,8 +53,7 @@ const ChatbotButton = () => { colorScheme="red" size="sm" borderRadius="full" - width="1" - mr="0" + width="1" />