-
- -
-
- Dashboard
-
-
+
diff --git a/src/components/ReactTable4/EditButtons.js b/src/components/ReactTable4/EditButtons.js
index c73997b..8f9f57e 100644
--- a/src/components/ReactTable4/EditButtons.js
+++ b/src/components/ReactTable4/EditButtons.js
@@ -5,12 +5,13 @@ import plus from "./plus.svg";
import more from "./more2.svg";
import DropDown from "./DropDown";
-export function EditButtons({ buttons }) {
+export function EditButtons({}) {
const [activeFilter, setActiveFilter] = useState(null);
+
return (
);
}
-EditButtons.defaultProps = {
- buttons: [
- {
- logo: plus,
- width: "w-3",
- height: "h-3",
- title: "ثبت جدید",
- backgroundColor: "#65A9FF",
- border: "border-b-4",
- borderColor: "#3686EC",
- padding: "4px 7px",
- // components: "d",
- },
- {
- logo: filter,
- width: "w-5",
- height: "h-5",
- title: null,
- backgroundColor: "#F3F8FF",
- border: null,
- borderColor: null,
- // components: "a",
- },
- {
- logo: more,
- width: "w-5",
- height: "h-5",
- title: null,
- textColor: null,
- backgroundColor: "#F3F8FF",
- border: null,
- borderColor: null,
- // components: ,
- },
- ],
-};
+EditButtons.defaultProps = {};
diff --git a/src/components/ReactTable4/MOCK_DATA.json b/src/components/ReactTable4/MOCK_DATA.json
index 3151d51..97a9b7f 100644
--- a/src/components/ReactTable4/MOCK_DATA.json
+++ b/src/components/ReactTable4/MOCK_DATA.json
@@ -1,52 +1,21 @@
[
{
- "name": "سامسونگ موبایل مدل 1",
- "order-date": "1399/09/27",
- "order-price": 25,
+ "name": "خسرو سهرابی",
+ "order-date": "1400/11/09",
+ "order-price": 910.325,
"order-number": "09120023100",
"user-job": "مهندس ساختمان",
"order-status": 1,
"order-level": 1,
- "history": "مهدی"
- },
- {
- "name": "ایفون جدید 13",
- "order-date": "1305/09/27",
- "order-price": 22,
- "order-number": "09120023100",
- "user-job": "مهندس ساختمان",
- "order-status": 2,
- "order-level": 2,
- "history": "tggg"
- },
- {
- "name": "مک بوک پرو",
- "order-date": "1399/09/27",
- "order-price": 75,
- "order-number": "09120023100",
- "user-job": "مهندس ساختمان",
- "order-status": 3,
- "order-level": 3,
- "history": "aaa"
- },
- {
- "name": "تبلت",
- "order-date": "1305/09/27",
- "order-price": 44,
- "order-number": "09120023100",
- "user-job": "مهندس ساختمان",
- "order-status": 4,
- "order-level": 4,
- "history": "ff"
- },
- {
- "name": "کتاب جدید",
- "order-date": "1305/09/27",
- "order-price": 13,
- "order-number": "09120023100",
- "user-job": "طناز",
- "order-status": 5,
- "order-level": 5,
- "history": "sfda"
+ "birth_place": "استان تهران شهر تهران",
+ "office_phone": "02144407010",
+ "education": "کارشناسی",
+ "behaviour": "بچه پرو و دریده شاخ اما کم آزار اهل رفاقت و مرام خلاق نوآور آشنا به صنایع خلاق",
+ "job": "فروشنده لوازم خانگی",
+ "address": "خیابان شریعتی نرسیده به خیابان دولت کوچه عباسی نبش تهیه غذای فارسی پلاک 4 واحد 3",
+ "field_study": "مدیریت صنعتی",
+ "birth_day": "1368/09/02",
+ "Criminal record": "4 سال حبس",
+ "uni": "تهران"
}
]
diff --git a/src/components/ReactTable4/NOTUSINGBasicTableDefaultCode.js b/src/components/ReactTable4/NOTUSINGBasicTableDefaultCode.js
deleted file mode 100644
index 968b271..0000000
--- a/src/components/ReactTable4/NOTUSINGBasicTableDefaultCode.js
+++ /dev/null
@@ -1,302 +0,0 @@
-import React, { useMemo } from "react";
-
-import {
- useTable,
- useSortBy,
- useGlobalFilter,
- useFilters,
- usePagination,
- useRowSelect,
- useColumnOrder,
-} from "react-table";
-
-import { COLUMNS } from "./columns";
-
-import { GlobalFilter } from "./GlobalFilter";
-
-import { Checkbox } from "./Checkbox";
-
-import MOCK_DATA from "./MOCK_DATA.json";
-
-const BasicTable = () => {
- const columns = React.useMemo(() => COLUMNS, []);
- const data = useMemo(() => MOCK_DATA, []);
-
- const {
- getTableProps,
- getTableBodyProps,
- headerGroups,
- footerGroups,
- rows,
- page,
- nextPage,
- previousPage,
- canNextPage,
- canPreviousPage,
- pageOptions,
- gotoPage,
- pageCount,
- setPageSize,
- prepareRow,
- allColumns,
- getToggleHideAllColumnsProps,
- setColumnOrder,
- selectedFlatRows,
- state,
- setGlobalFilter,
- } = useTable(
- {
- columns,
- data,
- // initialState: { pageIndex: 2 }
- },
- useColumnOrder,
- useFilters,
- useGlobalFilter,
- useSortBy,
- usePagination,
- useRowSelect,
- (hooks) => {
- hooks.visibleColumns.push((columns) => {
- return [
- {
- id: "selection",
- Header: ({ getToggleAllRowsSelectedProps }) => (
-
- ),
- Cell: ({ row }) => (
-
- ),
- },
- ...columns,
- ];
- });
- }
- );
-
- const changeOrder = () => {
- setColumnOrder([
- "name",
- "order-number",
- "user-job",
- "order-level",
- "order-status",
- "order-price",
- ]);
- };
-
- const { globalFilter, pageIndex, pageSize } = state;
- // const firstPageRows = rows.slice(0, 10);
-
- return (
- <>
-
- {/* search box */}
-
- {/* pagination */}
-
- {/* toggle columns */}
- {/*
-
- Toggle All
-
- {allColumns.map((column) => (
-
-
-
- ))}
-
*/}
-
- {/* Change Column Order */}
- {/* Change Column Order */}
-
-
-
- {headerGroups.map((headerGroup) => (
-
- {headerGroup.headers.map((column) => (
-
- {column.render("Header")}
-
- {column.isSorted
- ? column.isSortedDesc
- ? " 🔽"
- : " 🔼"
- : ""}
-
- {/* not using */}
- {/*
- {column.canFilter ? column.render('Filter') : null }
- */}
- |
- ))}
-
- ))}
-
-
-
- {/* not using */}
- {/* {rows.map((row) => {
- prepareRow(row)
- return(
-
- {row.cells.map((cell) => {
- return
- {cell.render('Cell')}
- |
- })}
-
- )
- })} */}
- {page.map((row) => {
- prepareRow(row);
- return (
-
- {row.cells.map((cell) => {
- return (
-
- {cell.render("Cell")}
- |
- );
- })}
-
- );
- })}
-
- {/* not using */}
- {/* {firstPageRows.map((row) => {
- prepareRow(row);
- return (
-
- {row.cells.map((cell) => {
- return (
-
- {cell.render("Cell")}
- |
- );
- })}
-
- );
- })} */}
-
-
- 10 ? "w-full" : "hidden"}`}
- >
- {footerGroups.map((footerGroup) => (
-
- {footerGroup.headers.map((column) => (
-
- {column.render("Footer")}
- |
- ))}
-
- ))}
-
-
-
-
-
- {JSON.stringify(
- {
- selectedFlatRows: selectedFlatRows.map((row) => row.original),
- },
- null,
- 2
- )}
-
-
-
-
-
- Page{" "}
-
- {pageIndex + 1} of {pageOptions.length}
-
- {""}
-
-
-
- | Go to Page:{" "}
- {
- const pageNumber = e.target.value
- ? Number(e.target.value) - 1
- : 0;
- gotoPage(pageNumber);
- }}
- style={{ width: "50px" }}
- />
-
-
-
-
- gotoPage(0)} disabled={!canPreviousPage}>
- {" "}
- {"<<"}{" "}
-
-
- previousPage()}
- disabled={!canPreviousPage}
- >
- Previous
-
- nextPage()}
- disabled={!canNextPage}
- >
- Next
-
-
- gotoPage(pageCount - 1)} disabled={!canNextPage}>
- {" "}
- {">>"}{" "}
-
-
- >
- );
-};
-
-export default BasicTable;
diff --git a/src/components/ReactTable4/index.js b/src/components/ReactTable4/index.js
index 6289bdd..3bdb3b7 100644
--- a/src/components/ReactTable4/index.js
+++ b/src/components/ReactTable4/index.js
@@ -2,7 +2,7 @@ import React, { useRef } from "react";
import BasicTable from "./BasicTable";
// import useDraggableScroll from "use-draggable-scroll";
-const ReactTable3 = ({ breadCrumbs, subTitle, title }) => {
+const ReactTable4 = ({ breadCrumbs, subTitle, title }) => {
return (
{/* breadCrumb */}
@@ -42,13 +42,13 @@ const ReactTable3 = ({ breadCrumbs, subTitle, title }) => {
{subTitle}