feat: replace checkboxes with Switch component for better UI consistency
- Updated DoctorDetailPage, MySecretariesPage, RecordNumberSettingsPage, RepresentationsPage, ResourcePoolsPage, ResourceTypesPage, SecretariesPage, SecretaryDetailPage, SettingsPage, SkillsPage, SmsWalletPage, and TagsSettingsPage to use the new Switch component instead of native checkboxes. - Enhanced accessibility by ensuring the Switch component uses appropriate roles and labels. - Added tests for the new Switch component to ensure functionality and accessibility compliance. - Updated styles to accommodate the new Switch component design.
This commit is contained in:
@@ -8,6 +8,7 @@ import type { ApiResponse } from '../lib/api';
|
||||
import type { Secretary } from '../types';
|
||||
import { digitsOnly, formatDate, formatNumber, formatRial } from '../lib/utils';
|
||||
import PageHeader from '../components/ui/PageHeader';
|
||||
import Switch from '../components/ui/Switch';
|
||||
|
||||
/** یک ردیف label:value با همان تم کارتهای موجود. */
|
||||
function Row({ label, value }: { label: string; value: React.ReactNode }) {
|
||||
@@ -95,15 +96,11 @@ export default function SecretaryDetailPage() {
|
||||
</p>
|
||||
|
||||
<label style={{ display: 'inline-flex', alignItems: 'center', gap: 10, cursor: 'pointer', marginBottom: 14 }}>
|
||||
<span className="switch">
|
||||
<input
|
||||
type="checkbox"
|
||||
aria-label="محاسبه درآمد منشی از نوبتهای آنلاین"
|
||||
checked={enabled}
|
||||
onChange={(e) => setEnabled(e.target.checked)}
|
||||
/>
|
||||
<span className="switch-track"><span className="switch-thumb" /></span>
|
||||
</span>
|
||||
<Switch
|
||||
checked={enabled}
|
||||
onChange={setEnabled}
|
||||
ariaLabel="محاسبه درآمد منشی از نوبتهای آنلاین"
|
||||
/>
|
||||
<span style={{ fontSize: 13 }}>محاسبه درآمد از نوبتهای آنلاین فعال باشد</span>
|
||||
</label>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user