Skip to content

Commit 5f68847

Browse files
committed
fix: improve search bar and header in Tasks page
- Header title centered and positioned like Today page - Title hides with animation on mobile when search opens - Title always visible on large screens - Search bar stays pill-shaped when focused - Removed green border from search input
1 parent 9bc0d28 commit 5f68847

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

src/pages/bottomNav/Tasks.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,29 @@ export function Tasks() {
470470
</button>
471471
</div>
472472

473-
{/* Center: Title */}
474-
<h1 className="absolute left-1/2 -translate-x-1/2 text-lg font-bold text-gray-900 dark:text-white">
475-
Tasks
473+
{/* Center: Title - Large screens always visible */}
474+
<h1 className="absolute inset-x-0 hidden justify-center sm:flex">
475+
<span className="text-lg font-bold text-gray-900 dark:text-white">Tasks</span>
476476
</h1>
477477

478+
{/* Center: Title - Mobile only with animation */}
479+
<div className="absolute inset-x-0 flex justify-center sm:hidden">
480+
<AnimatePresence mode="wait">
481+
{!isSearchOpen && (
482+
<motion.h1
483+
key="tasks-title-mobile"
484+
initial={{ opacity: 0, y: -8 }}
485+
animate={{ opacity: 1, y: 0 }}
486+
exit={{ opacity: 0, y: -8 }}
487+
transition={{ duration: 0.2 }}
488+
className="text-lg font-bold text-gray-900 dark:text-white"
489+
>
490+
Tasks
491+
</motion.h1>
492+
)}
493+
</AnimatePresence>
494+
</div>
495+
478496
{/* Right: Action Icons */}
479497
<div className="flex items-center gap-1">
480498
{/* Search with expandable pill input */}
@@ -493,7 +511,7 @@ export function Tasks() {
493511
placeholder="Search..."
494512
value={searchQuery}
495513
onChange={(e) => setSearchQuery(e.target.value)}
496-
className={`absolute right-0 h-10 rounded-full border border-gray-200 bg-gray-100 pl-4 pr-10 text-sm text-gray-900 transition-all duration-300 ease-out placeholder:text-gray-400 focus:rounded-full focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/30 dark:border-gray-700 dark:bg-gray-800/50 dark:text-white ${
514+
className={`absolute right-0 h-10 rounded-full border border-gray-200 bg-gray-100 pl-4 pr-10 text-sm text-gray-900 transition-all duration-300 ease-out placeholder:text-gray-400 focus:rounded-full focus:border-transparent focus:outline-none focus:ring-0 dark:border-gray-700 dark:bg-gray-800/50 dark:text-white ${
497515
isSearchOpen ? 'w-48 opacity-100' : 'pointer-events-none w-10 opacity-0'
498516
}`}
499517
autoFocus={isSearchOpen}

0 commit comments

Comments
 (0)