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:
@@ -85,6 +85,13 @@ const PLAN_DISPLAY: Record<string, string> = {
|
||||
|
||||
// ── Switch toggle ─────────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* نسخهٔ uncontrolled سوییچ برای `react-hook-form`.
|
||||
*
|
||||
* `components/ui/Switch` کنترلشده است (`checked` + `onChange`) و با اسپردِ
|
||||
* `register()` — که `ref` و `onChange` نیتیو میدهد — جور در نمیآید. ظاهر هر دو از
|
||||
* یک کلاس `.switch` میآید، پس تفاوت دیداری ندارند.
|
||||
*/
|
||||
const SwitchToggle = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
|
||||
function SwitchToggle(props, ref) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user