This commit is contained in:
parent
dc9f393465
commit
137c5ce866
|
|
@ -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 (
|
||||
<Row xs={1} sm={1} md={1} lg={2} xl={2}>
|
||||
<Col>
|
||||
|
|
@ -54,7 +59,14 @@ function Form() {
|
|||
{/* <ValidationField name="itemable_type" label='coupon_item_type' type="Select" option={itemable_type} isDisabled={values?.coupon_type !== "specified"} isMulti/> */}
|
||||
<ValidationField name="product_attr" label='product_item' type="Search" option={SelectProductData} searchBy={"name"} isDisabled={values?.coupon_type !== "specified"}isMulti loading={ProductLoading} />
|
||||
<ValidationField name="category_attr" label='categories_item_name' type="Search" option={SelectCategoriesData} searchBy={"name"} isDisabled={values?.coupon_type !== "specified"}isMulti loading={CategoriesLoading} />
|
||||
<ValidationField name="status" type='Checkbox' label='status' />
|
||||
{/* <ValidationField name="status" type='Checkbox' label='status' /> */}
|
||||
<div className="ValidationField w-100" >
|
||||
<label className="text">
|
||||
{t(`status`)}
|
||||
</label>
|
||||
<Switch size='default' style={{width:"50px"}} onChange={onChange} />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<Row xs={1} sm={1} md={1} lg={2} xl={2}>
|
||||
|
|
@ -52,8 +57,14 @@ function Form() {
|
|||
{/* <ValidationField name="itemable_type" label='coupon_item_type' type="Select" option={itemable_type} isDisabled={values?.coupon_type !== "specified"} isMulti/> */}
|
||||
<ValidationField name="product_attr" label='product_item' type="Search" option={SelectProductData} searchBy={"name"} isDisabled={values?.coupon_type !== "specified"}isMulti />
|
||||
<ValidationField name="category_attr" label='categories_item' type="Search" option={SelectCategoriesData} searchBy={"name"} isDisabled={values?.coupon_type !== "specified"}isMulti />
|
||||
<ValidationField name="status" type='Checkbox' label='status' />
|
||||
{/* <ValidationField name="status" type='Checkbox' label='status' /> */}
|
||||
<div className="ValidationField w-100" >
|
||||
<label className="text">
|
||||
{t(`status`)}
|
||||
</label>
|
||||
<Switch defaultValue={values?.status === "active"} size='default' style={{width:"50px"}} onChange={onChange} />
|
||||
|
||||
</div>
|
||||
|
||||
</Col>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user