post payback

This commit is contained in:
2021-12-20 13:42:24 +07:00
parent c73f642b93
commit 5f062ed630
7 changed files with 609 additions and 216 deletions

View File

@@ -1,4 +1,4 @@
import React, { useState } from "react";
import React, { useState ,useEffect} from "react";
import {
Button,
Card,
@@ -31,56 +31,25 @@ export const Payback = observer(() => {
const [visibleModal, setVisibleModal] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false);
const [initialData, setInitialData] = useState({});
//const [confirmLoading, setConfirmLoading] = useState(false);
const [isLoading, setIsLoading] = useState(false);
// useEffect(() => {
// // const init = async () => {
// // try {
// // setIsLoading(true);
// // await store.membership.getData();
// // await store.role.getData();
// // setIsLoading(false);
// // } catch (e) {
// // setIsLoading(false);
// // }
// // };
//
// // init();
// }, []);
const dummyData = [
{
key: "1",
id: 1,
name: "John Doe",
picture:
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
amount: "Rp. 1.000.000",
},
{
key: "2",
id: 1,
name: "John Doe",
picture:
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
amount: "Rp. 1.000.000",
},
{
key: "3",
id: 1,
name: "John Doe",
picture:
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
amount: "Rp. 1.000.000",
},
{
key: "4",
id: 1,
name: "John Doe",
picture:
"https://presidenproperti.com/wp-content/uploads/2018/11/blog-ph.jpg",
amount: "Rp. 1.000.000",
},
];
useEffect(() => {
const init = async () => {
try {
setIsLoading(true);
await store.payback.getDataUser();
//await store.role.getData();
setIsLoading(false);
} catch (e) {
setIsLoading(false);
}
};
init();
}, []);
const columns = [
{
@@ -90,8 +59,8 @@ export const Payback = observer(() => {
},
{
title: "Picture",
dataIndex: "picture",
key: "picture",
dataIndex: "image_prove",
key: "image_prove",
render: (text, record) => (
<Image
src={record.picture}
@@ -210,7 +179,7 @@ export const Payback = observer(() => {
key="1"
hasEmpty
columns={columns}
dataSource={dummyData}
dataSource={store.payback.data}
bordered
// pagination={{
// pageSize: store.membership.pageSize,
@@ -245,7 +214,7 @@ export const Payback = observer(() => {
// current: store.membership.page,
// style: {marginBottom: "1rem", marginRight: "1rem"},
// }}
dataSource={dummyData}
dataSource={store.payback.data}
style={{ padding: 0 }}
renderItem={(item) => {
return (