From 37ddd473427811b373af47b0976a312c09ac861d Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Tue, 14 Jul 2026 14:43:28 +0330 Subject: [PATCH] fix(subscription): sidebar layout, responsive cards, feature labels - Drop leaking mobile tab strip; settings sidebar is now desktop-only (hidden lg:block) and pinned right via grid lg:grid-cols-[280px_minmax(0,1fr)], matching the SettingsLayout pattern - Make plan cards responsive (flex 1 1 280px, min 250 / max 340) instead of fixed 300px width - Fix secretaries pill bidi rendering (rtl, single label) - Add Persian label for the 'insurance' plan feature Co-Authored-By: Claude Opus 4.8 --- .../layout/PurchaseSubscriptionSidebar.tsx | 172 +++++++----------- assets/admin/pages/SubscriptionPage.tsx | 25 +-- 2 files changed, 83 insertions(+), 114 deletions(-) diff --git a/assets/admin/components/layout/PurchaseSubscriptionSidebar.tsx b/assets/admin/components/layout/PurchaseSubscriptionSidebar.tsx index 3c5243d8..ded70f3b 100644 --- a/assets/admin/components/layout/PurchaseSubscriptionSidebar.tsx +++ b/assets/admin/components/layout/PurchaseSubscriptionSidebar.tsx @@ -5,11 +5,12 @@ import { menuForRole } from './SettingsLayout'; import { SearchHeaderP } from '../../pages/subscriptionIcons'; /** - * PurchaseSubscriptionSidebar — pixel-faithful port of clinic-pro-tauri's - * `PurchaseSubscriptionSidebar.jsx` (title + search + tab list, orange active - * pill #f17732). Unlike the Tauri original it does not switch content inline; - * each item is a real admin route (from SETTINGS_MENU / menuForRole), so the - * clinicpro routing architecture is preserved. `active` marks the open section. + * PurchaseSubscriptionSidebar — settings sub-navigation styled after + * clinic-pro-tauri's `PurchaseSubscriptionSidebar.jsx` (title + search + tab + * list, orange active pill #f17732). Desktop-only, like the rest of the + * clinicpro settings area (mobile nav is owned by the standalone settings list + * page). Each item is a real admin route (SETTINGS_MENU / menuForRole) so the + * routing architecture is preserved. `active` marks the open section. */ export default function PurchaseSubscriptionSidebar({ active }: { active: string }) { const primaryRole = useAuthStore((s) => s.primaryRole); @@ -20,109 +21,76 @@ export default function PurchaseSubscriptionSidebar({ active }: { active: string ); return ( -
- {/* Mobile/Tablet: horizontal scrollable tab strip */} -
+
+ تنظیمات +
+ +
+
+ + setQuery(e.target.value)} + placeholder="جستجو در تنظیمات" + aria-label="جستجو در تنظیمات" + style={{ + border: 'none', outline: 'none', background: 'transparent', + fontFamily: 'inherit', fontSize: 13, color: 'var(--text)', width: '100%', + textAlign: 'right', direction: 'rtl', + }} + /> +
+
+ +
- - {/* Desktop: Title + Search + vertical list */} -
-
- تنظیمات -
- -
-
- - setQuery(e.target.value)} - placeholder="جستجو در تنظیمات" - aria-label="جستجو در تنظیمات" - style={{ - border: 'none', outline: 'none', background: 'transparent', - fontFamily: 'inherit', fontSize: 13, color: 'var(--text)', width: '100%', - textAlign: 'right', direction: 'rtl', - }} - /> + {items.length === 0 && ( +
+ موردی یافت نشد
-
- - -
-
+ )} + + ); } diff --git a/assets/admin/pages/SubscriptionPage.tsx b/assets/admin/pages/SubscriptionPage.tsx index 9f78b6e0..4983d9b0 100644 --- a/assets/admin/pages/SubscriptionPage.tsx +++ b/assets/admin/pages/SubscriptionPage.tsx @@ -21,6 +21,7 @@ export const PLAN_FEATURE_LABELS: Record = { patient_records: 'پرونده بیمار', services: 'مدیریت سرویس‌ها', sms_panel: 'پنل پیامک', + insurance: 'مدیریت بیمه', }; /** Feature labels used on the plan cards — wording copied from clinic-pro-tauri. */ @@ -28,6 +29,7 @@ const CARD_FEATURE_LABELS: Record = { patient_records: 'مدیریت پرونده بیمار', services: 'مدیریت سرویس ها', sms_panel: 'پنل پیامک', + insurance: 'مدیریت بیمه', }; /** The plan highlighted as "most popular" in the UI (no backend flag exists). */ @@ -114,12 +116,12 @@ export default function SubscriptionPage() { return (
-
+
{/* ── Header: current plan (left) + title (right) ── */} @@ -137,7 +139,7 @@ export default function SubscriptionPage() { {plansLoading ? (
{[1, 2, 3].map((i) => ( -
+
))}
) : plans.length === 0 ? ( @@ -362,7 +364,7 @@ function PlanCard({
-
-
- منشی - {formatNumber(plan.max_secretaries)} -
+ + {formatNumber(plan.max_secretaries)} منشی +