post payback
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user