feat: completing sub categories

This commit is contained in:
2021-12-16 20:31:59 +07:00
parent 1cb4ad5e09
commit d41681c217
5 changed files with 210 additions and 192 deletions

View File

@@ -65,18 +65,15 @@ export const Category = observer(() => {
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
}}
/>
<Button onClick={() => (store.category.visibleModalCategory = true)}>
<Button
onClick={() => (store.category.visibleModalCategory = true)}
>
<PlusSquareOutlined /> New
</Button>
</Col>
</Row>
<Tabs onChange={handleChangeTabPane} size="default" tabBarGutter="50">
<TabPane tab="Category" key="1">
<CategoryComponent/>
</TabPane>
))
</Tabs>
<CategoryComponent />
</Card>
</div>
);

View File

@@ -54,10 +54,10 @@ export const Product = observer(() => {
<Card>
<Row style={{ marginBottom: 20 }}>
<Col span={12}>
<Button>
{/* <Button>
<FilterOutlined />
Filter
</Button>
</Button> */}
</Col>
<Col span={12} style={{ textAlign: "right" }}>
<Search

View File

@@ -7,7 +7,6 @@ import { observer } from "mobx-react-lite";
import { LINKS } from "../../routes/app";
import { SubcategoryComponent } from "../../component/Subcategory";
const { TabPane } = Tabs;
const { Search } = Input;
export const Subcategory = observer(() => {
@@ -18,8 +17,7 @@ export const Subcategory = observer(() => {
const init = async () => {
try {
setIsLoading(true);
//await store.category.getData();
await store.subcategory.getData();
// await getData();
setIsLoading(false);
} catch (e) {
setIsLoading(false);
@@ -29,11 +27,10 @@ export const Subcategory = observer(() => {
init();
}, []);
const handleChangeTabPane = async (key) => {
store.product.filterCategory = key;
console.log(key);
const getData = async () => {
await store.category.getData();
await store.subcategory.getData();
};
const routeData = [
{
route: LINKS.HOME,
@@ -51,10 +48,10 @@ export const Subcategory = observer(() => {
<Card>
<Row style={{ marginBottom: 20 }}>
<Col span={12}>
<Button>
{/* <Button>
<FilterOutlined />
Filter
</Button>
</Button> */}
</Col>
<Col span={12} style={{ textAlign: "right" }}>
<Search
@@ -65,17 +62,14 @@ export const Subcategory = observer(() => {
marginBottom: store.ui.mediaQuery.isMobile ? 10 : 0,
}}
/>
<Button onClick={() => (store.subcategory.visibleModalSubcategory= true)}>
<Button
onClick={() => (store.subcategory.visibleModalSubcategory = true)}
>
<PlusSquareOutlined /> New
</Button>
</Col>
</Row>
<Tabs onChange={handleChangeTabPane} size="default" tabBarGutter="50">
<TabPane tab="Sub-Category" key="1">
<SubcategoryComponent/>
</TabPane>
))
</Tabs>
<SubcategoryComponent />
</Card>
</div>
);