Skip to content

Commit a030a19

Browse files
authored
improve frontend home page UI. delete tab (#179)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Style** - Adjusted vertical spacing on the homepage to improve the presentation of key sections. - Updated the prompt form layout by widening its display area, reducing the text input height, and refining the button appearance. - **Refactor** - Simplified the navigation bar by removing dynamic tab updates and animation effects. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent de72da7 commit a030a19

File tree

3 files changed

+48
-89
lines changed

3 files changed

+48
-89
lines changed

frontend/src/app/(main)/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default function HomePage() {
7575
/>
7676
</div>
7777

78-
<div className="w-full mb-24">
78+
<div className="w-full mb-24 mt-24">
7979
<ProjectsSection />
8080
</div>
8181
</motion.div>

frontend/src/components/root/nav.tsx

+44-85
Original file line numberDiff line numberDiff line change
@@ -100,43 +100,43 @@ const FloatingNavbar = forwardRef<NavbarRef, FloatingNavbarProps>(
100100
return index >= 0 ? index : 0; // Default to first tab if path not found
101101
};
102102

103-
const [activeTab, setActiveTab] = useState(findActiveTabIndex());
104-
const [isVisible, setIsVisible] = useState(true);
103+
// const [activeTab, setActiveTab] = useState(findActiveTabIndex());
104+
// const [isVisible, setIsVisible] = useState(true);
105105

106106
// Update active tab when pathname changes
107-
useEffect(() => {
108-
const newActiveTab = findActiveTabIndex();
109-
if (newActiveTab !== activeTab) {
110-
setActiveTab(newActiveTab);
111-
}
112-
}, [pathname]);
107+
// useEffect(() => {
108+
// const newActiveTab = findActiveTabIndex();
109+
// if (newActiveTab !== activeTab) {
110+
// setActiveTab(newActiveTab);
111+
// }
112+
// }, [pathname]);
113113

114114
// Expose the activeTab value to parent components through the ref
115-
useImperativeHandle(ref, () => ({
116-
activeTab,
117-
setActiveTab: (index) => handleTabChange(index),
118-
}));
115+
// useImperativeHandle(ref, () => ({
116+
// activeTab,
117+
// setActiveTab: (index) => handleTabChange(index),
118+
// }));
119119

120-
// Handle tab change locally (for animation purposes)
121-
const handleTabChange = (index: number) => {
122-
if (index !== activeTab) {
123-
setIsVisible(false);
124-
setTimeout(() => {
125-
setActiveTab(index);
126-
setIsVisible(true);
127-
}, animationDuration);
128-
}
129-
};
120+
// // Handle tab change locally (for animation purposes)
121+
// const handleTabChange = (index: number) => {
122+
// if (index !== activeTab) {
123+
// setIsVisible(false);
124+
// setTimeout(() => {
125+
// setActiveTab(index);
126+
// setIsVisible(true);
127+
// }, animationDuration);
128+
// }
129+
// };
130130

131131
// Toggle theme function
132132
const toggleTheme = () => {
133133
setTheme(theme === 'dark' ? 'light' : 'dark');
134134
};
135135

136136
// Ensure content is visible on initial render
137-
useEffect(() => {
138-
setIsVisible(true);
139-
}, []);
137+
// useEffect(() => {
138+
// setIsVisible(true);
139+
// }, []);
140140

141141
// Using the same animation variants as in page.tsx
142142
const containerVariants = {
@@ -163,22 +163,22 @@ const FloatingNavbar = forwardRef<NavbarRef, FloatingNavbarProps>(
163163
},
164164
};
165165

166-
const handleTabClick = (
167-
e: React.MouseEvent,
168-
index: number,
169-
label: string,
170-
path: string
171-
) => {
172-
if (label === 'Pricing') {
173-
e.preventDefault();
174-
alert('Coming Soon');
175-
} else if (label === 'Codefox Journey') {
176-
e.preventDefault();
177-
alert('Coming Soon');
178-
} else {
179-
handleTabChange(index);
180-
}
181-
};
166+
// const handleTabClick = (
167+
// e: React.MouseEvent,
168+
// index: number,
169+
// label: string,
170+
// path: string
171+
// ) => {
172+
// if (label === 'Pricing') {
173+
// e.preventDefault();
174+
// alert('Coming Soon');
175+
// } else if (label === 'Codefox Journey') {
176+
// e.preventDefault();
177+
// alert('Coming Soon');
178+
// } else {
179+
// handleTabChange(index);
180+
// }
181+
// };
182182

183183
return (
184184
<>
@@ -241,61 +241,20 @@ const FloatingNavbar = forwardRef<NavbarRef, FloatingNavbarProps>(
241241
<SunMoon size={20} />
242242
</button>
243243

244-
<div
245-
className={`bg-gray-100 dark:bg-gray-800 rounded-full px-2 py-1 shadow-md ${tabsContainerClassName}`}
246-
>
247-
<div className="flex relative z-10">
248-
{tabs.map((tab, index) => (
249-
<Link
250-
href={tab.path}
251-
key={index}
252-
onClick={(e) =>
253-
handleTabClick(e, index, tab.label, tab.path)
254-
}
255-
className="focus:outline-none"
256-
>
257-
<div
258-
className={`relative px-4 py-2 font-medium text-sm rounded-full transition-all duration-300 ${
259-
activeTab === index
260-
? `text-white ${activeTabClassName}`
261-
: `text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-white ${inactiveTabClassName}`
262-
}`}
263-
>
264-
{/* Animated background for active tab */}
265-
<AnimatePresence>
266-
{activeTab === index && (
267-
<motion.span
268-
className="absolute inset-0 bg-primary-500 dark:bg-primary-600 rounded-full -z-10"
269-
layoutId="activeTabBackground"
270-
initial={{ opacity: 0 }}
271-
animate={{ opacity: 1 }}
272-
exit={{ opacity: 0 }}
273-
transition={{
274-
duration: animationDuration / 1000,
275-
}}
276-
/>
277-
)}
278-
</AnimatePresence>
279-
{tab.label}
280-
</div>
281-
</Link>
282-
))}
283-
</div>
284-
</div>
285-
286244
{/* Authentication Buttons */}
287245
{!isAuthorized && (
288246
<div className="flex items-center space-x-4 transition-transform duration-300">
289247
<button
290248
onClick={() => setShowSignIn(true)}
291-
className="px-4 py-2 rounded-md border border-primary-500 text-primary-500 dark:text-primary-400
249+
className="px-4 py-1 rounded-sm border border-primary-500 text-primary-500 dark:text-primary-400
292250
hover:bg-primary-500 hover:text-white transition-colors"
293251
>
294252
Sign In
295253
</button>
254+
296255
<button
297256
onClick={() => setShowSignUp(true)}
298-
className="px-4 py-2 rounded-md bg-primary-500 text-white hover:bg-primary-600 transition-colors"
257+
className="px-4 py-1 rounded-sm bg-primary-500 text-white hover:bg-primary-600 transition-colors"
299258
>
300259
Sign Up
301260
</button>

frontend/src/components/root/prompt-form.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export const PromptForm = forwardRef<PromptFormRef, PromptFormProps>(
179179
};
180180

181181
return (
182-
<div className="relative w-full max-w-2xl mx-auto">
182+
<div className="relative w-full max-w-4xl mx-auto">
183183
{/* Main content area with textarea */}
184184
<AnimatedInputBorder borderWidth={200} borderHeight={30}>
185185
<div className="flex flex-col">
@@ -191,7 +191,7 @@ export const PromptForm = forwardRef<PromptFormRef, PromptFormProps>(
191191
placeholder=""
192192
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"
193193
disabled={isLoading || isRegenerating}
194-
rows={4}
194+
rows={3}
195195
style={{ paddingBottom: '48px' }} // Extra padding at bottom to avoid text touching buttons
196196
/>
197197

@@ -315,7 +315,7 @@ export const PromptForm = forwardRef<PromptFormRef, PromptFormProps>(
315315
{/* Submit button */}
316316
<Button
317317
className={cn(
318-
'bg-gradient-to-r from-primary-500 to-primary-600 hover:from-primary-600 hover:to-primary-700 text-white shadow-md hover:shadow-lg transition-all px-5 py-3 h-10 rounded-full',
318+
'bg-gradient-to-r from-primary-500 to-primary-600 hover:from-primary-600 hover:to-primary-700 text-white shadow-md hover:shadow-lg transition-all px-5 py-3 h-10 rounded-sm',
319319
(isLoading || isRegenerating) &&
320320
'opacity-80 cursor-not-allowed'
321321
)}

0 commit comments

Comments
 (0)