From 13bcfc13149ccbeab9609b11f42f8140527e49b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 9 Mar 2026 15:54:49 -0300 Subject: [PATCH] feat: enhance global search UI and positioning - Moved search bar to the left/center for better accessibility. - Increased search bar width to max-w-2xl. - Refined search results dropdown layout and styling. --- components/Layout.tsx | 233 +++++++++++++++++++++--------------------- 1 file changed, 115 insertions(+), 118 deletions(-) diff --git a/components/Layout.tsx b/components/Layout.tsx index 9f98354..07e86e9 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -194,14 +194,126 @@ export const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {/* Main Content */}
{/* Header */} -
-
+
+
-
+ {/* Search Bar - Moved to left/center and made wider */} +
+
+ {isSearching ? : } + setSearchQuery(e.target.value)} + onFocus={() => searchQuery.length >= 2 && setShowSearchResults(true)} + className="bg-transparent border-none outline-none text-sm ml-3 w-full text-zinc-700 dark:text-dark-text placeholder-zinc-400 dark:placeholder-dark-muted" + /> +
+ + {/* Search Results Dropdown */} + {showSearchResults && ( +
+
+ {/* Members Section */} + {searchResults.members.length > 0 && ( +
+
Membros
+ {searchResults.members.map(m => ( + + ))} +
+ )} + + {/* Teams Section */} + {searchResults.teams.length > 0 && ( +
+
Equipes
+ {searchResults.teams.map(t => ( + + ))} +
+ )} + + {/* Attendances Section */} + {searchResults.attendances.length > 0 && ( +
+
Atendimentos
+ {searchResults.attendances.map(a => ( + + ))} +
+ )} + + {searchResults.members.length === 0 && searchResults.teams.length === 0 && searchResults.attendances.length === 0 && ( +
+ Nenhum resultado encontrado para "{searchQuery}" +
+ )} +
+
+ )} +
+ +
{/* Dark Mode Toggle */} - {/* Search Bar */} -
-
- {isSearching ? : } - setSearchQuery(e.target.value)} - onFocus={() => searchQuery.length >= 2 && setShowSearchResults(true)} - className="bg-transparent border-none outline-none text-sm ml-2 w-full text-zinc-700 dark:text-dark-text placeholder-zinc-400 dark:placeholder-dark-muted" - /> -
- - {/* Search Results Dropdown */} - {showSearchResults && ( -
-
- {/* Members Section */} - {searchResults.members.length > 0 && ( -
-
Membros
- {searchResults.members.map(m => ( - - ))} -
- )} - - {/* Teams Section */} - {searchResults.teams.length > 0 && ( -
-
Equipes
- {searchResults.teams.map(t => ( - - ))} -
- )} - - {/* Attendances Section */} - {searchResults.attendances.length > 0 && ( -
-
Atendimentos
- {searchResults.attendances.map(a => ( - - ))} -
- )} - - {searchResults.members.length === 0 && searchResults.teams.length === 0 && searchResults.attendances.length === 0 && ( -
- Nenhum resultado encontrado para "{searchQuery}" -
- )} -
-
- )} -
- - {/* Close results when clicking outside */} - {showSearchResults &&
setShowSearchResults(false)} />} - {/* Notifications */}