diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-21 12:56:23 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-21 12:56:23 +0300 |
commit | 84623c73b826d22d9b7b3103796bc754e7433b96 (patch) | |
tree | b9827d5b9ddbdc68b7a0bf355b5c4120b5b30be4 | |
parent | ea230c4754aca6bf11545cbf12e8784b88bb8ef5 (diff) | |
download | commercel-ui-84623c73b826d22d9b7b3103796bc754e7433b96.tar.gz |
feat: add Contractor Panel
-rw-r--r-- | src/containers/ContractorPanel.tsx | 31 | ||||
-rw-r--r-- | src/index.tsx | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/containers/ContractorPanel.tsx b/src/containers/ContractorPanel.tsx new file mode 100644 index 0000000..02e11ba --- /dev/null +++ b/src/containers/ContractorPanel.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { useHistory } from 'react-router-dom'; +import Button from '../components/Button'; +import { patch, baseURL } from '../requests'; +import { PanelProps } from './Service/ServiceContext'; + + +const ContractorPanel: React.FC<PanelProps> = ({ item, mutate }) => { + const history = useHistory(); + + return ( + <div className="lg:m-4 p-4 flex flex-col lg:pl-16 lg:border-l"> + <div className="grid lg:grid-cols-2"> + <Button route={`/waybills?contractorId=${item._id}`} variant="outlined"> + Показать накладные + </Button> + <Button route="/waybills/add"> + Новая накладная + </Button> + <Button route={`/transfers?contractorId=${item._id}`} variant="outlined"> + Показать переводы + </Button> + <Button route="/transfers/add"> + Новый перевод + </Button> + </div> + </div> + ); +}; + +export default ContractorPanel; diff --git a/src/index.tsx b/src/index.tsx index 71caf35..ffc7ae4 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -14,12 +14,14 @@ import services from './services'; import WaybillForm from './containers/WaybillForm'; import WaybillPanel from './containers/WaybillPanel'; import ContractorForm from './containers/ContractorForm'; +import ContractorPanel from './containers/ContractorPanel'; import ProductForm from './containers/ProductForm'; import TransferForm from './containers/TransferForm'; import TransfersUpload from './containers/TransfersUpload'; services[0].Form = ProductForm; services[1].Form = ContractorForm; +services[1].Panel = ContractorPanel; services[2].Form = WaybillForm; services[2].Panel = WaybillPanel; services[3].Form = TransferForm; |