feat: update PurchaseSubscriptionSidebar for mobile visibility and styling adjustments

This commit is contained in:
hamed
2026-07-21 10:50:17 +03:30
parent 087683e877
commit 512dbdaba0
3 changed files with 12 additions and 4 deletions
@@ -19,4 +19,12 @@ describe('PurchaseSubscriptionSidebar — settings menu', () => {
expect(screen.getByRole('link', { name: 'پرسنل' })).toHaveAttribute('aria-current', 'page');
expect(screen.getByRole('link', { name: 'مدیریت منشی' })).not.toHaveAttribute('aria-current');
});
// regression: the settings menu must stay visible on mobile (was `hidden lg:block`,
// which dropped the whole menu below the lg breakpoint → no settings nav on phones).
it('is not hidden on mobile', () => {
renderWithProviders(<PurchaseSubscriptionSidebar active="staff" />, { route: '/admin/staff' });
const nav = screen.getByRole('complementary', { name: 'منوی تنظیمات' });
expect(nav.className).not.toMatch(/\bhidden\b/);
});
});
@@ -46,8 +46,8 @@ export default function PurchaseSubscriptionSidebar({ active }: { active: string
<aside
dir="rtl"
aria-label="منوی تنظیمات"
className="hidden lg:block"
style={{ alignSelf: 'start', position: 'sticky', top: 'calc(var(--topbar-h) + 16px)' }}
className="settings-subnav lg:sticky"
style={{ alignSelf: 'start', top: 'calc(var(--topbar-h) + 16px)' }}
>
<div style={{
fontSize: 16, fontWeight: 800, color: 'var(--text-2)', textAlign: 'right',
+2 -2
View File
@@ -907,8 +907,8 @@ html, body { max-width: 100%; overflow-x: hidden; }
.save-bar.ok { border-color: var(--success); border-color: color-mix(in oklch, var(--success) 45%, var(--border)); }
@media (max-width: 900px) {
.settings-layout { grid-template-columns: 1fr; }
.settings-nav { position: static; }
.settings-layout { grid-template-columns: minmax(0, 1fr); }
.settings-nav { position: static; min-width: 0; }
.settings-nav-list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.settings-nav-item { flex-shrink: 0; width: auto; }
.settings-nav-item .dot { display: none; }