Perbaikan Project PPOB
This commit is contained in:
@@ -1,65 +1,65 @@
|
||||
import React, {useState} from "react";
|
||||
import {Button, Drawer, Layout, Menu, Popover, Typography} from "antd";
|
||||
import {MenuList} from "./MenuList";
|
||||
import {Link, useHistory} from "react-router-dom";
|
||||
import React, { useState } from "react";
|
||||
import { Button, Drawer, Layout, Menu, Popover, Typography } from "antd";
|
||||
import { MenuList } from "./MenuList";
|
||||
import { Link, useHistory } from "react-router-dom";
|
||||
import {
|
||||
AlipayOutlined,
|
||||
DatabaseOutlined,
|
||||
FileAddOutlined,
|
||||
FileProtectOutlined,
|
||||
FileSyncOutlined,
|
||||
HomeOutlined,
|
||||
LogoutOutlined,
|
||||
MenuOutlined,
|
||||
PayCircleOutlined,
|
||||
ProfileOutlined,
|
||||
ShoppingCartOutlined,
|
||||
UserOutlined
|
||||
AlipayOutlined,
|
||||
DatabaseOutlined,
|
||||
FileAddOutlined,
|
||||
FileProtectOutlined,
|
||||
FileSyncOutlined,
|
||||
HomeOutlined,
|
||||
LogoutOutlined,
|
||||
MenuOutlined,
|
||||
PayCircleOutlined,
|
||||
ProfileOutlined,
|
||||
ShoppingCartOutlined,
|
||||
UserOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import {AppRoute, LINKS} from "../../routes/app";
|
||||
import {useStore} from "../../utils/useStore";
|
||||
import {observer} from "mobx-react-lite";
|
||||
import {useMediaQuery} from "react-responsive";
|
||||
import { AppRoute, LINKS } from "../../routes/app";
|
||||
import { useStore } from "../../utils/useStore";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { useMediaQuery } from "react-responsive";
|
||||
|
||||
const {Text, Paragraph} = Typography;
|
||||
const {Header, Content, Sider} = Layout;
|
||||
const {SubMenu} = Menu;
|
||||
const { Text, Paragraph } = Typography;
|
||||
const { Header, Content, Sider } = Layout;
|
||||
const { SubMenu } = Menu;
|
||||
|
||||
export const DesktopLayout = observer(() => {
|
||||
let history = useHistory();
|
||||
const xl = useMediaQuery({minWidth: 1024});
|
||||
const store = useStore();
|
||||
const [clicked, setClicked] = useState(false);
|
||||
let history = useHistory();
|
||||
const xl = useMediaQuery({ minWidth: 1024 });
|
||||
const store = useStore();
|
||||
const [clicked, setClicked] = useState(false);
|
||||
|
||||
return (
|
||||
<Layout
|
||||
theme={"light"}
|
||||
className={"transparent"}
|
||||
hasSider={store.ui.mediaQuery.isDesktop}
|
||||
style={{
|
||||
paddingLeft: xl ? "calc(70vw - 1024px)" : "0",
|
||||
display: "flex",
|
||||
// minWidth: 1024,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
position: "relative",
|
||||
}}
|
||||
return (
|
||||
<Layout
|
||||
theme={"light"}
|
||||
className={"transparent"}
|
||||
hasSider={store.ui.mediaQuery.isDesktop}
|
||||
style={{
|
||||
paddingLeft: xl ? "calc(70vw - 1024px)" : "0",
|
||||
display: "flex",
|
||||
// minWidth: 1024,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
{store.ui.mediaQuery.isDesktop && (
|
||||
<Sider
|
||||
className={"transparent"}
|
||||
width={240}
|
||||
style={{
|
||||
overflowX: "hidden",
|
||||
bottom: 0,
|
||||
justifyContent: "flex-start",
|
||||
paddingTop: 20,
|
||||
paddingLeft: 20,
|
||||
position: "fixed",
|
||||
top: 0,
|
||||
zIndex: 10,
|
||||
}}
|
||||
>
|
||||
{store.ui.mediaQuery.isDesktop && (
|
||||
<Sider
|
||||
className={"transparent"}
|
||||
width={240}
|
||||
style={{
|
||||
overflowX: "hidden",
|
||||
bottom: 0,
|
||||
justifyContent: "flex-start",
|
||||
paddingTop: 20,
|
||||
paddingLeft: 20,
|
||||
position: "fixed",
|
||||
top: 0,
|
||||
zIndex: 10,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
paddingLeft: 20,
|
||||
@@ -118,20 +118,23 @@ export const DesktopLayout = observer(() => {
|
||||
}}
|
||||
>
|
||||
<Menu>
|
||||
<Menu.Item key="home">
|
||||
<Link to={LINKS.HOME}>
|
||||
<HomeOutlined/>
|
||||
{store.authentication.userData.role !== "Admin Partner" && (
|
||||
<Menu.Item key="home">
|
||||
<Link to={LINKS.HOME}>
|
||||
<HomeOutlined />
|
||||
<span>Beranda</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
{store.authentication.userData.role !== "Retail" && (
|
||||
<Menu.Item key="membership">
|
||||
<Link to={LINKS.MEMBERSHIP}>
|
||||
<FileProtectOutlined/>
|
||||
<span>Keanggotaan</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Retail" ||
|
||||
(store.authentication.userData.role !== "Admin Partner" && (
|
||||
<Menu.Item key="membership">
|
||||
<Link to={LINKS.MEMBERSHIP}>
|
||||
<FileProtectOutlined />
|
||||
<span>Keanggotaan</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
))}
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<SubMenu
|
||||
key="config"
|
||||
@@ -141,14 +144,14 @@ export const DesktopLayout = observer(() => {
|
||||
>
|
||||
<Menu.Item key="partner">
|
||||
<Link to={LINKS.PARTNER}>
|
||||
<HomeOutlined/>
|
||||
<span>Rekanan</span>
|
||||
<HomeOutlined />
|
||||
<span>Rekanan</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="commision">
|
||||
<Link to={LINKS.COMMISSION}>
|
||||
<HomeOutlined/>
|
||||
<span>Komisi</span>
|
||||
<HomeOutlined />
|
||||
<span>Komisi</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="supplier">
|
||||
@@ -167,23 +170,23 @@ export const DesktopLayout = observer(() => {
|
||||
>
|
||||
<Menu.Item key="product">
|
||||
<Link to={LINKS.PRODUCT}>
|
||||
<DatabaseOutlined/>
|
||||
<span>Produk</span>
|
||||
<DatabaseOutlined />
|
||||
<span>Produk</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<Menu.Item key="category">
|
||||
<Link to={LINKS.CATEGORY}>
|
||||
<FileAddOutlined/>
|
||||
<span>Kategori</span>
|
||||
<FileAddOutlined />
|
||||
<span>Kategori</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<Menu.Item key="sub-category">
|
||||
<Link to={LINKS.SUBCATEGORY}>
|
||||
<FileSyncOutlined/>
|
||||
<span>Sub Kategori</span>
|
||||
<FileSyncOutlined />
|
||||
<span>Sub Kategori</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
@@ -192,46 +195,49 @@ export const DesktopLayout = observer(() => {
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="product">
|
||||
<Link to={LINKS.PRODUCT}>
|
||||
<DatabaseOutlined/>
|
||||
<span>Produk</span>
|
||||
<DatabaseOutlined />
|
||||
<span>Produk</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role === "Retail" && (
|
||||
<Menu.Item key="transaction">
|
||||
<Link to={LINKS.TRANSACTION}>
|
||||
<ShoppingCartOutlined/>
|
||||
{store.authentication.userData.role === "Retail" ||
|
||||
(store.authentication.userData.role === "Admin Partner" && (
|
||||
<Menu.Item key="transaction">
|
||||
<Link to={LINKS.TRANSACTION}>
|
||||
<ShoppingCartOutlined />
|
||||
<span>Transaksi</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
<SubMenu
|
||||
key="payback-main"
|
||||
icon={<ProfileOutlined/>}
|
||||
title="Pembayaran"
|
||||
>
|
||||
{store.authentication.userData.role !== "Retail" && (
|
||||
<Menu.Item key="payback-to-user">
|
||||
<Link to={LINKS.PAYBACK}>
|
||||
<PayCircleOutlined/>
|
||||
<span>Konfirmasi</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="payback-from-user">
|
||||
<Link to={LINKS.PAYBACK_CREATED}>
|
||||
<AlipayOutlined/>
|
||||
<span>Dibuat oleh Saya</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
</SubMenu>
|
||||
</Menu.Item>
|
||||
))}
|
||||
{store.authentication.userData.role !== "Admin Partner" && (
|
||||
<SubMenu
|
||||
key="payback-main"
|
||||
icon={<ProfileOutlined />}
|
||||
title="Pembayaran"
|
||||
>
|
||||
{store.authentication.userData.role !== "Retail" && (
|
||||
<Menu.Item key="payback-to-user">
|
||||
<Link to={LINKS.PAYBACK}>
|
||||
<PayCircleOutlined />
|
||||
<span>Konfirmasi</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="payback-from-user">
|
||||
<Link to={LINKS.PAYBACK_CREATED}>
|
||||
<AlipayOutlined />
|
||||
<span>Dibuat oleh Saya</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
</SubMenu>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="profile">
|
||||
<Link to={LINKS.PROFILE}>
|
||||
<UserOutlined/>
|
||||
<span>Profil</span>
|
||||
<UserOutlined />
|
||||
<span>Profil</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
@@ -354,45 +360,46 @@ export const DesktopLayout = observer(() => {
|
||||
autoAdjustOverflow={true}
|
||||
placement="bottomRight"
|
||||
content={
|
||||
<Menu
|
||||
type={"line"}
|
||||
inlineIndent={0}
|
||||
theme="light"
|
||||
style={{
|
||||
backgroundColor: "transparent",
|
||||
borderRightWidth: 0,
|
||||
}}
|
||||
mode="inline"
|
||||
<Menu
|
||||
type={"line"}
|
||||
inlineIndent={0}
|
||||
theme="light"
|
||||
style={{
|
||||
backgroundColor: "transparent",
|
||||
borderRightWidth: 0,
|
||||
}}
|
||||
mode="inline"
|
||||
>
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item>
|
||||
<Link to={LINKS.PROFILE}>
|
||||
<UserOutlined />
|
||||
<span>Profile</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
<Menu.Item
|
||||
onClick={() => {
|
||||
store.authentication.logout();
|
||||
history.push("/login");
|
||||
}}
|
||||
>
|
||||
{store.authentication.userData.role !== "Admin" && <Menu.Item>
|
||||
<Link to={LINKS.PROFILE}>
|
||||
<UserOutlined/>
|
||||
<span>Profile</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
}
|
||||
<Menu.Item
|
||||
onClick={() => {
|
||||
store.authentication.logout();
|
||||
history.push("/login");
|
||||
}}
|
||||
>
|
||||
<LogoutOutlined/>
|
||||
<span>Sign out</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
<LogoutOutlined />
|
||||
<span>Sign out</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
title={
|
||||
<Text>
|
||||
{store.user.data.username}
|
||||
<Paragraph
|
||||
style={{fontWeight: 400, marginTop: '0.5rem'}}
|
||||
type={"secondary-dark"}
|
||||
strong
|
||||
>
|
||||
{store.authentication.userData.username}
|
||||
</Paragraph>
|
||||
</Text>
|
||||
<Text>
|
||||
{store.user.data.username}
|
||||
<Paragraph
|
||||
style={{ fontWeight: 400, marginTop: "0.5rem" }}
|
||||
type={"secondary-dark"}
|
||||
strong
|
||||
>
|
||||
{store.authentication.userData.username}
|
||||
</Paragraph>
|
||||
</Text>
|
||||
}
|
||||
trigger="click"
|
||||
visible={clicked}
|
||||
@@ -455,45 +462,45 @@ export const DesktopLayout = observer(() => {
|
||||
autoAdjustOverflow={true}
|
||||
placement="bottomRight"
|
||||
content={
|
||||
<Menu
|
||||
type={"line"}
|
||||
inlineIndent={0}
|
||||
theme="light"
|
||||
style={{
|
||||
backgroundColor: "transparent",
|
||||
borderRightWidth: 0,
|
||||
}}
|
||||
mode="inline"
|
||||
<Menu
|
||||
type={"line"}
|
||||
inlineIndent={0}
|
||||
theme="light"
|
||||
style={{
|
||||
backgroundColor: "transparent",
|
||||
borderRightWidth: 0,
|
||||
}}
|
||||
mode="inline"
|
||||
>
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="profile">
|
||||
<Link to={LINKS.PROFILE}>
|
||||
<UserOutlined />
|
||||
<span>Profile</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
<Menu.Item
|
||||
key={"logout"}
|
||||
onClick={() => {
|
||||
store.authentication.logout();
|
||||
history.push("/login");
|
||||
}}
|
||||
>
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="profile">
|
||||
<Link to={LINKS.PROFILE}>
|
||||
<UserOutlined/>
|
||||
<span>Profile</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
<Menu.Item
|
||||
key={"logout"}
|
||||
onClick={() => {
|
||||
store.authentication.logout();
|
||||
history.push("/login");
|
||||
}}
|
||||
>
|
||||
<LogoutOutlined/>
|
||||
<span>Sign out</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
<LogoutOutlined />
|
||||
<span>Sign out</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
title={
|
||||
<Text>
|
||||
<Paragraph
|
||||
style={{fontWeight: 400, marginTop: '0.5rem'}}
|
||||
type={"secondary-dark"}
|
||||
strong
|
||||
>
|
||||
{store.authentication.userData.username}
|
||||
</Paragraph>
|
||||
<Paragraph
|
||||
style={{ fontWeight: 400, marginTop: "0.5rem" }}
|
||||
type={"secondary-dark"}
|
||||
strong
|
||||
>
|
||||
{store.authentication.userData.username}
|
||||
</Paragraph>
|
||||
</Text>
|
||||
}
|
||||
trigger="click"
|
||||
|
@@ -1,34 +1,33 @@
|
||||
import React, {useEffect, useState} from "react";
|
||||
import {Menu} from "antd";
|
||||
import {Link} from "react-router-dom";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Menu } from "antd";
|
||||
import { Link } from "react-router-dom";
|
||||
import {
|
||||
AppstoreOutlined,
|
||||
DatabaseOutlined,
|
||||
FileAddOutlined,
|
||||
FileProtectOutlined,
|
||||
FileSyncOutlined,
|
||||
HomeOutlined,
|
||||
MenuUnfoldOutlined,
|
||||
MoneyCollectOutlined,
|
||||
ProfileOutlined,
|
||||
ProjectOutlined,
|
||||
ShoppingCartOutlined,
|
||||
UserOutlined,
|
||||
AppstoreOutlined,
|
||||
DatabaseOutlined,
|
||||
FileAddOutlined,
|
||||
FileProtectOutlined,
|
||||
FileSyncOutlined,
|
||||
HomeOutlined,
|
||||
MenuUnfoldOutlined,
|
||||
MoneyCollectOutlined,
|
||||
ProfileOutlined,
|
||||
ProjectOutlined,
|
||||
ShoppingCartOutlined,
|
||||
UserOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import {observer} from "mobx-react-lite";
|
||||
import {useStore} from "../../utils/useStore";
|
||||
import {LINKS} from "../../routes/app";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { useStore } from "../../utils/useStore";
|
||||
import { LINKS } from "../../routes/app";
|
||||
|
||||
const {SubMenu} = Menu;
|
||||
const { SubMenu } = Menu;
|
||||
|
||||
export const MenuList = observer((props) => {
|
||||
const store = useStore();
|
||||
useEffect(() => {
|
||||
}, []);
|
||||
const store = useStore();
|
||||
useEffect(() => {}, []);
|
||||
|
||||
const [setKeys, setSetKeys] = useState(["dashboard"]);
|
||||
const [setKeys, setSetKeys] = useState(["dashboard"]);
|
||||
|
||||
return (
|
||||
return (
|
||||
<Menu
|
||||
defaultOpenKeys={["sub4"]}
|
||||
theme="light"
|
||||
@@ -47,20 +46,23 @@ export const MenuList = observer((props) => {
|
||||
overflowedIndicator={0}
|
||||
forceSubMenuRender={true}
|
||||
>
|
||||
<Menu.Item key="home">
|
||||
<Link to={LINKS.HOME}>
|
||||
<HomeOutlined />
|
||||
<span>Beranda</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
{store.authentication.userData.role !== "Retail" && (
|
||||
<Menu.Item key="membership">
|
||||
<Link to={LINKS.MEMBERSHIP}>
|
||||
<FileProtectOutlined />
|
||||
<span>Keanggotaan</span>
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<Menu.Item key="home">
|
||||
<Link to={LINKS.HOME}>
|
||||
<HomeOutlined />
|
||||
<span>Beranda</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Retail" &&
|
||||
store.authentication.userData.role !== "Admin Partner" && (
|
||||
<Menu.Item key="membership">
|
||||
<Link to={LINKS.MEMBERSHIP}>
|
||||
<FileProtectOutlined />
|
||||
<span>Keanggotaan</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<SubMenu key="config" icon={<MenuUnfoldOutlined />} title="Config">
|
||||
<Menu.Item key="partner">
|
||||
@@ -109,6 +111,14 @@ export const MenuList = observer((props) => {
|
||||
)}
|
||||
</SubMenu>
|
||||
)}
|
||||
{store.authentication.userData.role === "Admin Partner" && (
|
||||
<Menu.Item key="retail">
|
||||
<Link to={LINKS.PRODUCT}>
|
||||
<DatabaseOutlined />
|
||||
<span>Produk</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role === "Supervisor" && (
|
||||
<Menu.Item key="retail">
|
||||
<Link to={LINKS.PRODUCT}>
|
||||
@@ -117,37 +127,45 @@ export const MenuList = observer((props) => {
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role === "Retail" && (
|
||||
<Menu.Item key="transaction">
|
||||
<Link to={LINKS.TRANSACTION}>
|
||||
<ShoppingCartOutlined />
|
||||
<span>Transaksi</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
<SubMenu key="payback-main" icon={<ProfileOutlined />} title="Pembayaran">
|
||||
{store.authentication.userData.role !== "Retail" && (
|
||||
<Menu.Item key="payback-to-user">
|
||||
<Link to={LINKS.PAYBACK}>
|
||||
<FileProtectOutlined/>
|
||||
<span>Konfirmasi</span>
|
||||
{store.authentication.userData.role === "Retail" ||
|
||||
(store.authentication.userData.role === "Admin Partner" && (
|
||||
<Menu.Item key="transaction">
|
||||
<Link to={LINKS.TRANSACTION}>
|
||||
<ShoppingCartOutlined />
|
||||
<span>Transaksi</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="payback-from-user">
|
||||
<Link to={LINKS.PAYBACK_CREATED}>
|
||||
<FileProtectOutlined/>
|
||||
))}
|
||||
{store.authentication.userData.role !== "Retail" &&
|
||||
store.authentication.userData.role !== "Admin Partner" && (
|
||||
<SubMenu
|
||||
key="payback-main"
|
||||
icon={<ProfileOutlined />}
|
||||
title="Pembayaran"
|
||||
>
|
||||
{store.authentication.userData.role !== "Retail" && (
|
||||
<Menu.Item key="payback-to-user">
|
||||
<Link to={LINKS.PAYBACK}>
|
||||
<FileProtectOutlined />
|
||||
<span>Konfirmasi</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="payback-from-user">
|
||||
<Link to={LINKS.PAYBACK_CREATED}>
|
||||
<FileProtectOutlined />
|
||||
<span>Dibuat oleh Saya</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
</SubMenu>
|
||||
)}
|
||||
</SubMenu>
|
||||
{store.authentication.userData.role !== "Admin" && (
|
||||
<Menu.Item key="profile">
|
||||
<Link to={LINKS.PROFILE}>
|
||||
<UserOutlined/>
|
||||
<span>Profil</span>
|
||||
<UserOutlined />
|
||||
<span>Profil</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)}
|
||||
|
@@ -38,7 +38,7 @@ export const Commission = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.COMMISSION,
|
||||
|
@@ -36,7 +36,7 @@ export const Partner = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.PARTNER,
|
||||
|
@@ -51,7 +51,7 @@ export const Supplier = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.SUPPLIER,
|
||||
|
@@ -1,25 +1,123 @@
|
||||
import React from "react";
|
||||
import {Button, PageHeader} from "antd";
|
||||
import {store} from "../../utils/useStore";
|
||||
import {observer} from "mobx-react-lite";
|
||||
import { Button, PageHeader, Card, Row, Col, List } from "antd";
|
||||
import { store } from "../../utils/useStore";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { FilterOutlined, TransactionOutlined } from "@ant-design/icons";
|
||||
|
||||
export const Home = observer(() => {
|
||||
return <div className={["ppob-container"].join(" ")}>
|
||||
<PageHeader
|
||||
style={{
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
height: 40,
|
||||
backgroundColor: "transparent",
|
||||
}}
|
||||
title={"Home"}
|
||||
return (
|
||||
<div>
|
||||
{store.ui.mediaQuery.isDesktop && (
|
||||
<Row
|
||||
style={{
|
||||
marginTop: 30,
|
||||
marginLeft: 30,
|
||||
}}
|
||||
>
|
||||
</PageHeader>
|
||||
<Button onClick={() => {
|
||||
store.ui.setTestValue();
|
||||
}}>{store.ui.testValue}</Button>
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aut recusandae velit! Consequatur corporis,
|
||||
eum fuga, harum incidunt laboriosam minus necessitatibus neque non nostrum pariatur tempore. Dignissimos impedit
|
||||
rem tempora!
|
||||
<Card
|
||||
className={"shadow"}
|
||||
style={{
|
||||
marginLeft: 20,
|
||||
height: 200,
|
||||
marginBottom: 10,
|
||||
width: "30%",
|
||||
}}
|
||||
>
|
||||
<PageHeader title={<span>Total Transaksi</span>}>
|
||||
<span>Total Transaksi : 25 Transaksi</span>
|
||||
</PageHeader>
|
||||
</Card>
|
||||
<Card
|
||||
className={"shadow"}
|
||||
style={{
|
||||
marginLeft: 20,
|
||||
height: 200,
|
||||
marginBottom: 10,
|
||||
width: "30%",
|
||||
}}
|
||||
>
|
||||
<PageHeader title={<span>Total Keuntungan</span>}>
|
||||
<span>Rp.30.000.000</span>
|
||||
</PageHeader>
|
||||
</Card>
|
||||
<Card
|
||||
className={"shadow"}
|
||||
hoverable
|
||||
style={{
|
||||
marginLeft: 20,
|
||||
height: 200,
|
||||
marginBottom: 10,
|
||||
width: "30%",
|
||||
}}
|
||||
>
|
||||
<PageHeader title={<span>Saldo</span>}>
|
||||
<span>Rp.200.000.000 </span>
|
||||
</PageHeader>
|
||||
</Card>
|
||||
</Row>
|
||||
)}
|
||||
{store.ui.mediaQuery.isMobile && (
|
||||
<div style={{ marginTop: 10 }}>
|
||||
<Card
|
||||
className={"shadow"}
|
||||
style={{
|
||||
marginLeft: 20,
|
||||
height: 200,
|
||||
marginBottom: 10,
|
||||
marginRight: 20,
|
||||
}}
|
||||
>
|
||||
<PageHeader title={<span>Total Transaksi</span>}>
|
||||
<span>Total Transaksi :</span>
|
||||
</PageHeader>
|
||||
</Card>
|
||||
<Card
|
||||
className={"shadow"}
|
||||
style={{
|
||||
marginLeft: 20,
|
||||
height: 200,
|
||||
marginBottom: 10,
|
||||
marginRight: 20,
|
||||
}}
|
||||
>
|
||||
<PageHeader title={<span>Total Keuntungan</span>}>
|
||||
<span>Rp.30.000.000</span>
|
||||
</PageHeader>
|
||||
</Card>
|
||||
<Card
|
||||
className={"shadow"}
|
||||
hoverable
|
||||
style={{
|
||||
marginLeft: 20,
|
||||
height: 200,
|
||||
marginBottom: 10,
|
||||
marginRight: 20,
|
||||
}}
|
||||
>
|
||||
<PageHeader title={<span>Saldo</span>}>
|
||||
<span>Rp.200.000.000 </span>
|
||||
</PageHeader>
|
||||
</Card>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
// return <div className={["ppob-container"].join(" ")}>
|
||||
// <PageHeader
|
||||
// style={{
|
||||
// padding: 0,
|
||||
// margin: 0,
|
||||
// height: 40,
|
||||
// backgroundColor: "transparent",
|
||||
// }}
|
||||
// title={"Home"}
|
||||
// >
|
||||
// </PageHeader>
|
||||
// <Button onClick={() => {
|
||||
// store.ui.setTestValue();
|
||||
// }}>{store.ui.testValue}</Button>
|
||||
// Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aut recusandae velit! Consequatur corporis,
|
||||
// eum fuga, harum incidunt laboriosam minus necessitatibus neque non nostrum pariatur tempore. Dignissimos impedit
|
||||
// rem tempora!
|
||||
// </div>
|
||||
});
|
||||
|
@@ -174,7 +174,7 @@ export const Membership = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.MEMBERSHIP,
|
||||
|
@@ -163,7 +163,7 @@ export const Payback = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.PAYBACK,
|
||||
@@ -175,15 +175,23 @@ export const Payback = observer(() => {
|
||||
modalLoader.setLoading(true);
|
||||
try {
|
||||
const response = await store.payback.confirmPayback(id, type);
|
||||
if (response.body.status !== 201) {
|
||||
message.error(
|
||||
response?.body?.message || `Failed ${capitalize(type)} Payback`
|
||||
);
|
||||
} else {
|
||||
message.success(
|
||||
response?.body?.message || `Success ${capitalize(type)} Payback`
|
||||
);
|
||||
}
|
||||
console.log(response)
|
||||
response.body.statusCode !== 201 && response.body.statusCode !== 200
|
||||
? message.error(
|
||||
response?.body?.message || `Failed ${capitalize(type)} Payback`
|
||||
)
|
||||
: message.success(
|
||||
response?.body?.message || `Success ${capitalize(type)} Payback`
|
||||
);
|
||||
// if (response.body.status !== 201 ) {
|
||||
// message.error(
|
||||
// response?.body?.message || `Failed ${capitalize(type)} Payback`
|
||||
// );
|
||||
// } else {
|
||||
// message.success(
|
||||
// response?.body?.message || `Success ${capitalize(type)} Payback`
|
||||
// );
|
||||
// }
|
||||
} catch (e) {
|
||||
console.error(e, "apa errornya");
|
||||
message.error(
|
||||
@@ -200,10 +208,10 @@ export const Payback = observer(() => {
|
||||
<div>
|
||||
<Row style={{ marginBottom: 20 }}>
|
||||
<Col span={12}>
|
||||
<Button>
|
||||
{/* <Button>
|
||||
<FilterOutlined />
|
||||
Filter
|
||||
</Button>
|
||||
</Button> */}
|
||||
</Col>
|
||||
<Col span={12} style={{ textAlign: "right" }}>
|
||||
{/* <Search
|
||||
|
@@ -80,7 +80,7 @@ export const PaybackCreated = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.PAYBACK_CREATED,
|
||||
|
@@ -37,7 +37,7 @@ export const Category = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.CATEGORY,
|
||||
|
@@ -30,6 +30,7 @@ export const Product = observer(() => {
|
||||
store.supplier.getData(),
|
||||
store.category.getData(),
|
||||
store.product.getDataSubCategories(),
|
||||
store.product.getProductPartner()
|
||||
]);
|
||||
await store.product.getData();
|
||||
modalLoader.setLoading(false);
|
||||
@@ -53,7 +54,7 @@ export const Product = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.PRODUCT,
|
||||
|
@@ -18,7 +18,7 @@ export const ProductDetail = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.PRODUCT,
|
||||
|
@@ -41,7 +41,7 @@ export const Subcategory = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.SUBCATEGORY,
|
||||
|
@@ -138,12 +138,12 @@ export const Profile = observer(() => {
|
||||
<div>
|
||||
<Title strong level={3}>History User Transaction</Title>
|
||||
|
||||
<Button style={{marginBottom: '1rem'}} onClick={() => {
|
||||
{/* <Button style={{marginBottom: '1rem'}} onClick={() => {
|
||||
console.log('clicked filter')
|
||||
}}>
|
||||
<FilterOutlined/>
|
||||
Filter
|
||||
</Button>
|
||||
</Button> */}
|
||||
<Table
|
||||
columns={columns}
|
||||
bordered
|
||||
|
@@ -46,7 +46,7 @@ export const Transaction = observer(() => {
|
||||
const routeData = [
|
||||
{
|
||||
route: LINKS.HOME,
|
||||
name: "Home",
|
||||
name: "Beranda",
|
||||
},
|
||||
{
|
||||
route: LINKS.TRANSACTION,
|
||||
|
Reference in New Issue
Block a user