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',