diff --git a/src/Pages/Coupon/View/AddForm.tsx b/src/Pages/Coupon/View/AddForm.tsx index a881e57..7fc08a4 100644 --- a/src/Pages/Coupon/View/AddForm.tsx +++ b/src/Pages/Coupon/View/AddForm.tsx @@ -4,7 +4,7 @@ import { Col, Row } from 'reactstrap'; import ValidationField from '../../../Components/ValidationField/ValidationField'; import { useFormikContext } from 'formik'; -import { DatePicker } from 'antd'; +import { DatePicker, Switch } from 'antd'; import { useTranslation } from 'react-i18next'; import { isEmpty } from '../../../Hooks/isEmpty'; import { useGetCategories } from '../../../api/Categories'; @@ -34,6 +34,11 @@ function Form() { } }, [values?.discount_type]) + const onChange = (checked: boolean) => { + console.log(`switch to ${checked}`); + setFieldValue("status",checked) + + }; return ( @@ -54,7 +59,14 @@ function Form() { {/* */} - + {/* */} +
+ + + +
diff --git a/src/Pages/Coupon/View/EditForm.tsx b/src/Pages/Coupon/View/EditForm.tsx index cf2bec9..090d5f5 100644 --- a/src/Pages/Coupon/View/EditForm.tsx +++ b/src/Pages/Coupon/View/EditForm.tsx @@ -4,7 +4,7 @@ import { Col, Row } from 'reactstrap'; import ValidationField from '../../../Components/ValidationField/ValidationField'; import { useFormikContext } from 'formik'; -import { DatePicker } from 'antd'; +import { DatePicker, Switch } from 'antd'; import { useTranslation } from 'react-i18next'; import { isEmpty } from '../../../Hooks/isEmpty'; import { useGetCategories } from '../../../api/Categories'; @@ -32,6 +32,11 @@ function Form() { } }, [values?.discount_type]) + const onChange = (checked: boolean) => { + console.log(`switch to ${checked}`); + setFieldValue("status",checked) + + }; return ( @@ -52,8 +57,14 @@ function Form() { {/* */} - + {/* */} +
+ + +