Skip to content

Commit 4c580df

Browse files
committed
feat: Implement UI/UX improvements for dropdowns and search bar
- Issue #374: Add clear (X) button and autofocus to Employee List search bar - Issue #376: Standardize dropdown menu styling with dark-mode theme Changes: - EmployeeList: Added clear button to search input, autoFocus on load - NetworkSwitcher: Updated select styling with bg-surface, consistent dark theme - Settings: Updated language dropdown with consistent dark theme styling - EmployeeList: Updated status dropdown with consistent dark theme styling
1 parent f95a307 commit 4c580df

3 files changed

Lines changed: 55 additions & 27 deletions

File tree

frontend/src/components/EmployeeList.tsx

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,40 @@ export const EmployeeList: React.FC<EmployeeListProps> = ({
207207
<div className="w-full card glass noise overflow-hidden p-0">
208208
<div className="flex flex-wrap justify-between items-center gap-3 p-6">
209209
<span className="font-bold text-lg">Employees</span>
210-
<input
211-
type="search"
212-
id="employee-search"
213-
aria-label="Search employees"
214-
placeholder="Search by name, email, or role…"
215-
value={searchQuery}
216-
onChange={(e) => setSearchQuery(e.target.value)}
217-
className="rounded border border-gray-300 bg-transparent px-3 py-1.5 text-sm placeholder:text-muted focus:outline-none focus:ring-2 focus:ring-accent"
218-
/>
210+
<div className="relative flex items-center">
211+
<input
212+
type="search"
213+
id="employee-search"
214+
aria-label="Search employees"
215+
placeholder="Search by name, email, or role…"
216+
value={searchQuery}
217+
onChange={(e) => setSearchQuery(e.target.value)}
218+
autoFocus
219+
className="rounded border border-gray-300 bg-transparent px-3 py-1.5 text-sm placeholder:text-muted focus:outline-none focus:ring-2 focus:ring-accent w-64"
220+
/>
221+
{searchQuery && (
222+
<button
223+
type="button"
224+
onClick={() => setSearchQuery('')}
225+
className="absolute right-2 text-muted hover:text-text"
226+
aria-label="Clear search"
227+
>
228+
<svg
229+
width="14"
230+
height="14"
231+
viewBox="0 0 24 24"
232+
fill="none"
233+
stroke="currentColor"
234+
strokeWidth="2"
235+
strokeLinecap="round"
236+
strokeLinejoin="round"
237+
>
238+
<line x1="18" y1="6" x2="6" y2="18" />
239+
<line x1="6" y1="6" x2="18" y2="18" />
240+
</svg>
241+
</button>
242+
)}
243+
</div>
219244
</div>
220245
<table className="w-full table-fixed text-left border-collapse">
221246
<thead>
@@ -255,9 +280,7 @@ export const EmployeeList: React.FC<EmployeeListProps> = ({
255280
</thead>
256281
<tbody className="divide-y divide-gray-200">
257282
{isLoading ? (
258-
Array.from({ length: SKELETON_ROW_COUNT }, (_, i) => (
259-
<EmployeeSkeletonRow key={i} />
260-
))
283+
Array.from({ length: SKELETON_ROW_COUNT }, (_, i) => <EmployeeSkeletonRow key={i} />)
261284
) : sortedEmployees.length === 0 ? (
262285
<tr>
263286
<td colSpan={6} className="p-6 text-center text-gray-500">
@@ -266,10 +289,7 @@ export const EmployeeList: React.FC<EmployeeListProps> = ({
266289
</tr>
267290
) : (
268291
sortedEmployees.map((employee) => (
269-
<tr
270-
key={employee.id}
271-
className="cursor-pointer transition-colors hover:bg-white/5"
272-
>
292+
<tr key={employee.id} className="cursor-pointer transition-colors hover:bg-white/5">
273293
<td className="p-6">
274294
<div className="flex items-center gap-3">
275295
<Avatar
@@ -449,10 +469,14 @@ export const EmployeeList: React.FC<EmployeeListProps> = ({
449469
onChange={(e) =>
450470
setNewEmployee({ ...newEmployee, status: e.target.value as 'Active' | 'Inactive' })
451471
}
452-
className="w-full mb-4 px-3 py-2 border rounded"
472+
className="w-full mb-4 px-3 py-2 border border-hi rounded bg-surface text-text appearance-none"
453473
>
454-
<option value="Active">Active</option>
455-
<option value="Inactive">Inactive</option>
474+
<option value="Active" className="bg-surface text-text">
475+
Active
476+
</option>
477+
<option value="Inactive" className="bg-surface text-text">
478+
Inactive
479+
</option>
456480
</select>
457481
<div className="flex justify-end gap-2">
458482
<button

frontend/src/components/NetworkSwitcher.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ export const NetworkSwitcher: React.FC = () => {
1919
title="Switch Stellar network"
2020
className={[
2121
'text-[10px] font-mono font-bold uppercase tracking-widest',
22-
'px-2 py-1 rounded border bg-transparent cursor-pointer',
23-
'focus:outline-none transition-colors',
22+
'px-2 py-1 rounded border bg-surface border-hi text-text cursor-pointer',
23+
'focus:outline-none transition-colors appearance-none',
2424
isTestnet
2525
? 'border-yellow-500/50 text-yellow-500 hover:border-yellow-400'
26-
: 'border-(--accent)/50 text-(--accent) hover:border-(--accent)',
26+
: 'border-accent/50 text-accent hover:border-accent',
2727
].join(' ')}
2828
>
29-
<option value="TESTNET" className="bg-(--bg) text-(--text)">
29+
<option value="TESTNET" className="bg-surface text-text">
3030
Testnet
3131
</option>
32-
<option value="MAINNET" className="bg-(--bg) text-(--text)">
32+
<option value="MAINNET" className="bg-surface text-text">
3333
Mainnet
3434
</option>
3535
</select>

frontend/src/pages/Settings.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ export default function Settings() {
2424
<select
2525
value={i18n.language}
2626
onChange={handleChangeLanguage}
27-
className="w-full bg-black/20 border border-hi rounded-xl p-4 text-text outline-none focus:border-accent/50 focus:bg-accent/5 transition-all"
27+
className="w-full bg-surface border border-hi rounded-xl p-4 text-text outline-none focus:border-accent/50 focus:bg-accent/5 transition-all appearance-none"
2828
>
29-
<option value="en">{t('settings.languageEnglish')}</option>
30-
<option value="es">{t('settings.languageSpanish')}</option>
29+
<option value="en" className="bg-surface text-text">
30+
{t('settings.languageEnglish')}
31+
</option>
32+
<option value="es" className="bg-surface text-text">
33+
{t('settings.languageSpanish')}
34+
</option>
3135
</select>
3236
</div>
3337
</div>

0 commit comments

Comments
 (0)