refactor: checkbox ui component (#4665)

This commit is contained in:
Aaryan Khandelwal 2024-05-31 15:05:28 +05:30 committed by GitHub
parent a9d9cbcb72
commit bf4f97d7f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 43 additions and 23 deletions

View file

@ -80,7 +80,7 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
control={control}
name="property_change"
render={({ field: { value, onChange } }) => (
<Checkbox checked={value} onChange={() => onChange(!value)} className="mx-2" />
<Checkbox checked={value} onChange={() => onChange(!value)} containerClassName="mx-2" />
)}
/>
</div>
@ -99,12 +99,12 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
render={({ field: { value, onChange } }) => (
<Checkbox
checked={value}
intermediate={!value && watch("issue_completed")}
indeterminate={!value && watch("issue_completed")}
onChange={() => {
setValue("issue_completed", !value, { shouldDirty: true });
onChange(!value);
}}
className="mx-2"
containerClassName="mx-2"
/>
)}
/>
@ -120,7 +120,7 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
control={control}
name="issue_completed"
render={({ field: { value, onChange } }) => (
<Checkbox checked={value} onChange={() => onChange(!value)} className="mx-2" />
<Checkbox checked={value} onChange={() => onChange(!value)} containerClassName="mx-2" />
)}
/>
</div>
@ -137,7 +137,7 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
control={control}
name="comment"
render={({ field: { value, onChange } }) => (
<Checkbox checked={value} onChange={() => onChange(!value)} className="mx-2" />
<Checkbox checked={value} onChange={() => onChange(!value)} containerClassName="mx-2" />
)}
/>
</div>
@ -154,7 +154,7 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
control={control}
name="mention"
render={({ field: { value, onChange } }) => (
<Checkbox checked={value} onChange={() => onChange(!value)} className="mx-2" />
<Checkbox checked={value} onChange={() => onChange(!value)} containerClassName="mx-2" />
)}
/>
</div>