From bdc00fe2676924a68a837536e286417f928a5228 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Mon, 27 Jul 2026 16:58:03 +0330 Subject: [PATCH] refactor: update UserDetailPage styles and introduce avatar gradient utility - Refactored role metadata styles in UserDetailPage for consistency with design tokens. - Replaced hardcoded avatar colors with a utility function to generate gradients based on user ID. - Improved InfoCard component styles for better hover effects and accessibility. - Removed deprecated color classes and adjusted background gradients for various components. - Updated theme token tests to reflect the removal of deferred files and ensure compliance with design standards. - Added new avatarColors utility file to manage avatar gradient definitions. --- .../components/schedule/ScheduleSection.tsx | 74 +++++++------- assets/admin/lib/avatarColors.ts | 15 +++ assets/admin/pages/DoctorDetailPage.tsx | 96 +++++++++---------- assets/admin/pages/UserDetailPage.tsx | 84 ++++++++-------- assets/admin/test/theme-tokens.test.ts | 21 ++-- docs/admin-ui/ui-design-spec.md | 10 +- 6 files changed, 153 insertions(+), 147 deletions(-) create mode 100644 assets/admin/lib/avatarColors.ts diff --git a/assets/admin/components/schedule/ScheduleSection.tsx b/assets/admin/components/schedule/ScheduleSection.tsx index a5692c65..80571180 100644 --- a/assets/admin/components/schedule/ScheduleSection.tsx +++ b/assets/admin/components/schedule/ScheduleSection.tsx @@ -169,7 +169,7 @@ function PersianDateInput({ value, onChange, minDate, placeholder }: {
); @@ -352,7 +352,7 @@ function SlotEditor({ slots, onChange }: {
))} @@ -511,7 +511,7 @@ function NoLocationsNotice({ clinicUuid }: { clinicUuid?: string | null }) { : ['ابتدا آدرس مطب را ثبت کنید', 'برنامه کاری نیاز به حداقل یک مکان نوبت دارد']; return (
-
+
@@ -627,9 +627,9 @@ export function WeeklyScheduleTab({ doctorUuid, clinicUuid, addresses, readOnly return (
{totalSlots > 0 && ( -
- - +
+ + مجموع {totalSlots} نوبت در هفته
@@ -638,7 +638,7 @@ export function WeeklyScheduleTab({ doctorUuid, clinicUuid, addresses, readOnly const activeSessions = (scheduleMap[day.key]?.sessions ?? []).filter(s => s.active); const daySlots = activeSessions.reduce((sum, s) => sum + calcSlotCount(s), 0); return ( -
+
{day.label}
{activeSessions.length > 0 ? activeSessions.map((s, i) => ( @@ -665,9 +665,9 @@ export function WeeklyScheduleTab({ doctorUuid, clinicUuid, addresses, readOnly
{/* ─ خلاصه کل هفته */} {totalSlots > 0 && ( -
- - +
+ + مجموع {totalSlots} نوبت در هفته
@@ -675,7 +675,7 @@ export function WeeklyScheduleTab({ doctorUuid, clinicUuid, addresses, readOnly {/* ─ روش نوبت‌دهی */}
-
+
روش نوبت‌دهی
@@ -694,11 +694,11 @@ export function WeeklyScheduleTab({ doctorUuid, clinicUuid, addresses, readOnly className={`text-right p-3 rounded-lg border transition-colors ${ selected ? 'border-[var(--primary)] bg-[var(--primary)]/5' - : 'border-[var(--border)] dark:border-[var(--border)] bg-[var(--surface)] dark:bg-[var(--bg)]' + : 'border-[var(--border)] bg-[var(--surface)]' } ${modeLocked ? 'opacity-70 cursor-not-allowed' : 'hover:border-[var(--primary)]'}`} >
- + {lbl}

{desc}

@@ -712,7 +712,7 @@ export function WeeklyScheduleTab({ doctorUuid, clinicUuid, addresses, readOnly نوع نوبت‌دهی ثبت شده و دیگر قابل تغییر نیست.

) : ( -

+

⚠️ توجه: نوع نوبت‌دهی پس از اولین ثبت به‌هیچ‌عنوان قابل تغییر نیست. پیش از ذخیره با دقت انتخاب کنید.

)} @@ -745,7 +745,7 @@ export function WeeklyScheduleTab({ doctorUuid, clinicUuid, addresses, readOnly {/* ─ نوبت‌دهی آنلاین */}
{/* header + toggle */} -