From 98b536348dd2a1d0e4e5b637cd8269eb3b4449d6 Mon Sep 17 00:00:00 2001 From: ZHallen122 Date: Thu, 13 Mar 2025 08:21:15 -0400 Subject: [PATCH] update ui --- frontend/src/app/(main)/page.tsx | 2 +- frontend/src/components/root/nav.tsx | 129 +++++++------------ frontend/src/components/root/prompt-form.tsx | 6 +- 3 files changed, 48 insertions(+), 89 deletions(-) diff --git a/frontend/src/app/(main)/page.tsx b/frontend/src/app/(main)/page.tsx index accf5439..804cbf91 100644 --- a/frontend/src/app/(main)/page.tsx +++ b/frontend/src/app/(main)/page.tsx @@ -75,7 +75,7 @@ export default function HomePage() { /> -
+
diff --git a/frontend/src/components/root/nav.tsx b/frontend/src/components/root/nav.tsx index e24b805a..3f1a4271 100644 --- a/frontend/src/components/root/nav.tsx +++ b/frontend/src/components/root/nav.tsx @@ -100,33 +100,33 @@ const FloatingNavbar = forwardRef( return index >= 0 ? index : 0; // Default to first tab if path not found }; - const [activeTab, setActiveTab] = useState(findActiveTabIndex()); - const [isVisible, setIsVisible] = useState(true); + // const [activeTab, setActiveTab] = useState(findActiveTabIndex()); + // const [isVisible, setIsVisible] = useState(true); // Update active tab when pathname changes - useEffect(() => { - const newActiveTab = findActiveTabIndex(); - if (newActiveTab !== activeTab) { - setActiveTab(newActiveTab); - } - }, [pathname]); + // useEffect(() => { + // const newActiveTab = findActiveTabIndex(); + // if (newActiveTab !== activeTab) { + // setActiveTab(newActiveTab); + // } + // }, [pathname]); // Expose the activeTab value to parent components through the ref - useImperativeHandle(ref, () => ({ - activeTab, - setActiveTab: (index) => handleTabChange(index), - })); + // useImperativeHandle(ref, () => ({ + // activeTab, + // setActiveTab: (index) => handleTabChange(index), + // })); - // Handle tab change locally (for animation purposes) - const handleTabChange = (index: number) => { - if (index !== activeTab) { - setIsVisible(false); - setTimeout(() => { - setActiveTab(index); - setIsVisible(true); - }, animationDuration); - } - }; + // // Handle tab change locally (for animation purposes) + // const handleTabChange = (index: number) => { + // if (index !== activeTab) { + // setIsVisible(false); + // setTimeout(() => { + // setActiveTab(index); + // setIsVisible(true); + // }, animationDuration); + // } + // }; // Toggle theme function const toggleTheme = () => { @@ -134,9 +134,9 @@ const FloatingNavbar = forwardRef( }; // Ensure content is visible on initial render - useEffect(() => { - setIsVisible(true); - }, []); + // useEffect(() => { + // setIsVisible(true); + // }, []); // Using the same animation variants as in page.tsx const containerVariants = { @@ -163,22 +163,22 @@ const FloatingNavbar = forwardRef( }, }; - const handleTabClick = ( - e: React.MouseEvent, - index: number, - label: string, - path: string - ) => { - if (label === 'Pricing') { - e.preventDefault(); - alert('Coming Soon'); - } else if (label === 'Codefox Journey') { - e.preventDefault(); - alert('Coming Soon'); - } else { - handleTabChange(index); - } - }; + // const handleTabClick = ( + // e: React.MouseEvent, + // index: number, + // label: string, + // path: string + // ) => { + // if (label === 'Pricing') { + // e.preventDefault(); + // alert('Coming Soon'); + // } else if (label === 'Codefox Journey') { + // e.preventDefault(); + // alert('Coming Soon'); + // } else { + // handleTabChange(index); + // } + // }; return ( <> @@ -241,61 +241,20 @@ const FloatingNavbar = forwardRef( -
-
- {tabs.map((tab, index) => ( - - handleTabClick(e, index, tab.label, tab.path) - } - className="focus:outline-none" - > -
- {/* Animated background for active tab */} - - {activeTab === index && ( - - )} - - {tab.label} -
- - ))} -
-
- {/* Authentication Buttons */} {!isAuthorized && (
+ diff --git a/frontend/src/components/root/prompt-form.tsx b/frontend/src/components/root/prompt-form.tsx index a9817f81..6cc2fe6c 100644 --- a/frontend/src/components/root/prompt-form.tsx +++ b/frontend/src/components/root/prompt-form.tsx @@ -179,7 +179,7 @@ export const PromptForm = forwardRef( }; return ( -
+
{/* Main content area with textarea */}
@@ -191,7 +191,7 @@ export const PromptForm = forwardRef( placeholder="" className="w-full min-h-[200px] py-6 px-6 pr-12 text-lg border border-transparent rounded-lg focus:outline-none focus:ring-0 bg-white dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 resize-none font-normal" disabled={isLoading || isRegenerating} - rows={4} + rows={3} style={{ paddingBottom: '48px' }} // Extra padding at bottom to avoid text touching buttons /> @@ -315,7 +315,7 @@ export const PromptForm = forwardRef( {/* Submit button */}