From a35426c5c814dc8b52e5dadc208cb3a9ee1f76cb Mon Sep 17 00:00:00 2001 From: Amirhossein Khalili Date: Sun, 15 Mar 2026 02:01:54 +0800 Subject: [PATCH] fix(components): improve components design and user experience --- src/components/FilterBar.tsx | 33 ++++++++++++++--------- src/components/Navbar.tsx | 6 ++--- src/components/Pagination.tsx | 42 ++++++++++++++++------------- src/components/Sidebar.tsx | 8 +++++- src/components/ui/TextAreaInput.tsx | 2 +- src/components/ui/input.tsx | 2 +- 6 files changed, 55 insertions(+), 38 deletions(-) diff --git a/src/components/FilterBar.tsx b/src/components/FilterBar.tsx index 4fc49d7..964edfb 100644 --- a/src/components/FilterBar.tsx +++ b/src/components/FilterBar.tsx @@ -1,4 +1,6 @@ import { Search, ArrowUpDown } from 'lucide-react'; +import { Select } from './ui/Select'; +import { Input } from './ui/input'; interface FilterBarProps { searchQuery: string; @@ -9,32 +11,37 @@ interface FilterBarProps { searchPlaceholder: string; } -export default function FilterBar({ searchQuery, setSearchQuery, ordering, setOrdering, orderingOptions, searchPlaceholder }: FilterBarProps) { +export default function FilterBar({ + searchQuery, + setSearchQuery, + ordering, + setOrdering, + orderingOptions, + searchPlaceholder +}: FilterBarProps) { + return (
- + setSearchQuery(e.target.value)} placeholder={searchPlaceholder || "Search..."} - className="w-full pl-10 pr-4 py-2.5 rounded-xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 text-slate-900 dark:text-white outline-none focus:ring-2 focus:ring-blue-500 transition-shadow" + className="w-full pl-10 pr-4 rtl:pl-4 rtl:pr-10 py-2.5 rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 text-slate-900 dark:text-white outline-none focus:ring-2 focus:ring-blue-500 transition-shadow" />
+
- + onChange={setOrdering} + options={orderingOptions} + className="w-full sm:w-max" + buttonClassName="whitespace-nowrap min-w-[150px]" + />
); diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 1f3cda8..28a0b93 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -104,7 +104,7 @@ export function Navbar() { return ( <> -
+
navigate("/")} @@ -196,7 +196,7 @@ export function Navbar() {
{showLogoutModal && ( -
setShowLogoutModal(false)}> +
setShowLogoutModal(false)}>
e.stopPropagation()}>

{t.confirmLogoutTitle || "Confirm Logout"} @@ -210,7 +210,7 @@ export function Navbar() { onClick={() => setShowLogoutModal(false)} className="dark:text-white" > - {t.cancel || "Cancel"} + {t.actions?.cancel || "Cancel"} + {t.pagination?.page || 'Page'} {toPersianNum(currentPage)} {t.pagination?.of || 'of'} {toPersianNum(totalPages)} - +

+
); }; diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index f8da475..0065c7a 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -6,7 +6,8 @@ import { PanelLeftClose, PanelLeftOpen, PanelRightClose, - PanelRightOpen + PanelRightOpen, + Briefcase, } from 'lucide-react'; import { useTranslation } from '../hooks/useTranslation'; @@ -31,6 +32,11 @@ export const Sidebar = () => { icon: Users, label: t.sidebar?.clients || 'Clients' }, + { + path: '/projects', + icon: Briefcase, + label: t.sidebar?.projects || 'Projects' + }, ]; return ( diff --git a/src/components/ui/TextAreaInput.tsx b/src/components/ui/TextAreaInput.tsx index bae52b5..42d6da0 100644 --- a/src/components/ui/TextAreaInput.tsx +++ b/src/components/ui/TextAreaInput.tsx @@ -6,7 +6,7 @@ const TextAreaInput = React.forwardRef( ({ className, ...props }, ref) => { return (