feat(admin): collapsible sidebar and responsive data tables with custom scroll
Deploy Canina / deploy (push) Successful in 33s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 8s

This commit is contained in:
parsa committed 2026-09-23 23:45:18 +03:30
1 parent b98c6bb457
commit 8a3adacd38
7 files changed
+171 -49

No files matched your search

+3 -3
View File
@@ -710,9 +710,9 @@ export default function Orders() {
</div>
{/* Orders Table */}
<div className="bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden">
<div className="overflow-x-auto">
<table className="w-full text-right">
<div className="bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden w-full">
<div className="overflow-x-auto custom-scrollbar w-full select-none cursor-grab active:cursor-grabbing pb-2">
<table className="w-full text-right min-w-[1050px]">
<thead className="bg-gray-50 text-gray-500 text-xs uppercase tracking-wider border-b border-gray-200 select-none">
<tr>
<th className="py-4 px-6 font-bold">شماره / کد پیگیری</th>
@@ -595,8 +595,8 @@ export default function Transactions() {
هیچ تراکنشی با فیلترهای مشخص شده یافت نشد.
</div>
) : (
<div className="overflow-x-auto">
<table className="w-full text-right border-collapse">
<div className="overflow-x-auto custom-scrollbar w-full select-none cursor-grab active:cursor-grabbing pb-2">
<table className="w-full text-right border-collapse min-w-[1100px]">
<thead>
<tr className="bg-gray-50/80 border-b border-gray-200 text-[11px] font-black text-gray-500">
<th className="p-4">کاربر خریدار</th>
+26 -26
View File
@@ -378,21 +378,21 @@ export default function Users() {
</div>
{/* Users Table */}
<div className="bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden">
<div className="overflow-x-auto">
<table className="w-full text-right font-vazir text-xs">
<thead className="bg-gray-50 text-gray-500 border-b border-gray-200">
<div className="bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden w-full">
<div className="overflow-x-auto custom-scrollbar w-full select-none cursor-grab active:cursor-grabbing pb-2">
<table className="w-full text-right font-vazir text-xs min-w-[1050px]">
<thead className="bg-gray-50 text-gray-500 border-b border-gray-200 sticky top-0 z-10">
<tr>
<th className="py-4 px-6 font-bold">کاربر</th>
<th className="py-4 px-6 font-bold">شماره موبایل</th>
<th className="py-4 px-6 font-bold">نوع حساب</th>
<th className="py-4 px-6 font-bold">مجموع خرید (LTV)</th>
<th className="py-4 px-6 font-bold text-center">سفارشات</th>
<th className="py-4 px-6 font-bold text-center">❤️ مهربانی</th>
<th className="py-4 px-6 font-bold text-center">دیدگاه‌ها</th>
<th className="py-4 px-6 font-bold">کیف پول</th>
<th className="py-4 px-6 font-bold">تاریخ عضویت</th>
<th className="py-4 px-6 font-bold text-center">عملیات</th>
<th className="py-4 px-6 font-bold whitespace-nowrap">کاربر</th>
<th className="py-4 px-6 font-bold whitespace-nowrap">شماره موبایل</th>
<th className="py-4 px-6 font-bold whitespace-nowrap">نوع حساب</th>
<th className="py-4 px-6 font-bold whitespace-nowrap">مجموع خرید (LTV)</th>
<th className="py-4 px-6 font-bold text-center whitespace-nowrap">سفارشات</th>
<th className="py-4 px-6 font-bold text-center whitespace-nowrap">❤️ مهربانی</th>
<th className="py-4 px-6 font-bold text-center whitespace-nowrap">دیدگاه‌ها</th>
<th className="py-4 px-6 font-bold whitespace-nowrap">کیف پول</th>
<th className="py-4 px-6 font-bold whitespace-nowrap">تاریخ عضویت</th>
<th className="py-4 px-6 font-bold text-center whitespace-nowrap">عملیات</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-100 text-xs font-vazir">
@@ -418,21 +418,21 @@ export default function Users() {
return (
<tr key={user.id} className="hover:bg-gray-50/70 transition-colors">
<td className="py-4 px-6 font-bold text-gray-900 flex items-center gap-2">
<div className="w-8 h-8 rounded-full bg-purple-100 text-purple-700 flex items-center justify-center font-black text-xs">
<td className="py-4 px-6 font-bold text-gray-900 flex items-center gap-2 whitespace-nowrap">
<div className="w-8 h-8 rounded-full bg-purple-100 text-purple-700 flex items-center justify-center font-black text-xs shrink-0">
{fullName.charAt(0)}
</div>
<div>
<div className="whitespace-nowrap">
<div>{fullName}</div>
{isMainAdmin && (
<span className="text-[10px] text-purple-600 font-black">حساب اصلی مدیریت</span>
)}
</div>
</td>
<td className="py-4 px-6 font-mono text-gray-700" dir="ltr">
<td className="py-4 px-6 font-mono text-gray-700 whitespace-nowrap" dir="ltr">
{user.mobile || '---'}
</td>
<td className="py-4 px-6">
<td className="py-4 px-6 whitespace-nowrap">
<span
className={`px-2.5 py-1 rounded-full text-[10px] font-bold ${
user.role === 'User_Wholesale'
@@ -453,27 +453,27 @@ export default function Users() {
: 'مشتری'}
</span>
</td>
<td className="py-4 px-6 font-mono font-bold text-emerald-700">
<td className="py-4 px-6 font-mono font-bold text-emerald-700 whitespace-nowrap">
{spent > 0 ? `${spent.toLocaleString('fa-IR')} ت` : '۰'}
</td>
<td className="py-4 px-6 font-bold text-gray-800">
<td className="py-4 px-6 font-bold text-gray-800 whitespace-nowrap text-center">
<span className="bg-gray-100 px-2 py-0.5 rounded-md font-mono">
{user.ordersCount || 0}
</span>
</td>
<td className="py-4 px-6 font-mono font-bold text-rose-600">
<td className="py-4 px-6 font-mono font-bold text-rose-600 whitespace-nowrap text-center">
{charity > 0 ? `${charity.toLocaleString('fa-IR')} ت` : '---'}
</td>
<td className="py-4 px-6 font-bold text-purple-600 font-mono">
<td className="py-4 px-6 font-bold text-purple-600 font-mono whitespace-nowrap text-center">
{user.reviewsCount || 0}
</td>
<td className="py-4 px-6 font-mono font-bold text-gray-800">
<td className="py-4 px-6 font-mono font-bold text-gray-800 whitespace-nowrap">
{balance > 0 ? `${balance.toLocaleString('fa-IR')} ت` : '۰'}
</td>
<td className="py-4 px-6 text-gray-500 text-xs font-medium">
<td className="py-4 px-6 text-gray-500 text-xs font-medium whitespace-nowrap">
{user.createdAt ? new Date(user.createdAt).toLocaleDateString('fa-IR') : '---'}
</td>
<td className="py-4 px-6 text-center">
<td className="py-4 px-6 text-center whitespace-nowrap">
<div className="flex justify-center items-center gap-1.5">
<button
onClick={() => setViewUser(user)}