From b38cee06f719998797d4af0b20b49fd011861ef9 Mon Sep 17 00:00:00 2001 From: joh748 Date: Wed, 9 Oct 2024 01:16:19 +1300 Subject: [PATCH 1/4] change css --- .../src/components/gemini/LuckyAdviser.jsx | 103 +++++++++--------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/frontend/src/components/gemini/LuckyAdviser.jsx b/frontend/src/components/gemini/LuckyAdviser.jsx index 3258b5e..062efa4 100644 --- a/frontend/src/components/gemini/LuckyAdviser.jsx +++ b/frontend/src/components/gemini/LuckyAdviser.jsx @@ -7,7 +7,7 @@ function LuckyAdviser() { const [inputValue, setInputValue] = useState(''); const [promptResponses, setPromptResponses] = useState([]); const [loading, setLoading] = useState(false); - const [showResponses, setShowResponses] = useState(true); // State to manage response box visibility + const [showResponses, setShowResponses] = useState(true); // Create axios instance with base URL and authorization token const axiosInstance = axios.create({ @@ -15,7 +15,8 @@ function LuckyAdviser() { headers: { Authorization: `Bearer ${localStorage.getItem("token")}` }, }); - const getResponseForGivenPrompt = async () => { + const getResponseForGivenPrompt = async (e) => { + e.preventDefault(); if (!inputValue.trim()) { console.error("Input value is required."); return; @@ -64,57 +65,55 @@ function LuckyAdviser() { setShowResponses(false); // Close the response box }; - return ( -
-
-
- setInputValue(e.target.value)} - placeholder="Ask Me Something You Want" - className="border border-gray-300 rounded-md p-2 w-full focus:outline-none focus:ring-2 focus:ring-violet-600" - /> + return ( +
+
+ +
+