diff --git a/build.zip b/build.zip new file mode 100644 index 0000000..9798c2b Binary files /dev/null and b/build.zip differ diff --git a/src/App.js b/src/App.js index e4a30c3..2817e42 100644 --- a/src/App.js +++ b/src/App.js @@ -66,66 +66,66 @@ function App() { return (
- {/* - - - - - - - - - - - - - - */} - - - - - - - - - - - - - - - - - - - - - - - + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} - - -
+ {/* */} + {/* */} + {/*
-
- - - - - - - - - - +
*/} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} {/* */} - + {/* */} {/* */}
diff --git a/src/components/ReactTable5/BasicTable.js b/src/components/ReactTable5/BasicTable.js index 8d422d7..0010d41 100644 --- a/src/components/ReactTable5/BasicTable.js +++ b/src/components/ReactTable5/BasicTable.js @@ -1,23 +1,15 @@ import React, { useMemo, useState, useRef } from "react"; import "./index.scss"; -import Tabbar from "./Tabbar"; import MOCK_DATA2 from "./MOCK_DATA2.json"; import { GlobalFilter } from "./GlobalFilter"; import { COLUMNS } from "./COLUMNS"; -import { Pagination } from "./Pagination"; -import { GoToPage } from "./GoToPage"; -import ShowMoreRows from "./ShowMoreRows"; -import { Settings } from "./Settings"; -// import { Checkbox } from "./Checkbox"; -// import { FilterFileType } from "./FilterFileType"; import grid from "./grid.svg"; import list from "./list.svg"; -// import image1 from "./images/image1.svg"; import RenderRowSubComponent from "./RenderRowSubComponent"; import EditRow from "./EditRow"; @@ -91,18 +83,7 @@ export const SelectColumnFilter = ({ ); }; -const BasicTable = ({ - settingsIcon, - thead, - goToPage, - showMore, - filterBarDefault, - addTab, - tabs, - delTab, - setActivateTab, - activeTab, -}) => { +const BasicTable = ({ addTab, activeTab }) => { const data = useMemo(() => MOCK_DATA2, []); // console.log(data); @@ -118,14 +99,12 @@ const BasicTable = ({ : [...refChekedItems.current, id] ); }; - // eslint-disable-next-line react-hooks/exhaustive-deps + const columns = React.useMemo( () => COLUMNS({ toggelChekedItems, refChekedItems }), [] ); - // console.log(columns[0]); - const defaultColumn = useMemo(() => { return {}; }, []); @@ -137,25 +116,11 @@ const BasicTable = ({ getTableProps, getTableBodyProps, headerGroups, - // footerGroups, rows, page, - nextPage, - previousPage, - canNextPage, - canPreviousPage, - pageOptions, - gotoPage, - pageCount, - setPageSize, prepareRow, - allColumns, - getToggleHideAllColumnsProps, - // setColumnOrder, - // selectedFlatRows, state, setGlobalFilter, - // resetResizing, } = useTable( { columns, @@ -171,24 +136,12 @@ const BasicTable = ({ useRowSelect ); - const { globalFilter, pageIndex, pageSize } = state; + const { globalFilter } = state; const [activeList, setActiveList] = useState(false); - // console.log(filtering); return (
- {/* {filtering &&
mahdi
} */} - {/*
- {listView.map((list, i) => ( - setActiveList(false)} - /> - ))} -
{" "} */}
{/* select View list */}
@@ -237,111 +190,16 @@ const BasicTable = ({
- - {/* */}
- {filterBarDefault && ( -
- {/* right box */} - - - - {/*
- -
*/} - {/* left box */} - {activeTab === 0 ? ( -
- {/* search box */} - - {/* pagination */} -
- {/* go to page */} - - {/* vertical line */} -
- {/* arrows */} - -
- {/* settings icon */} - {settingsIcon && ( - - )} -
- ) : null} -
- )} - {/* {activeList === true ?
listView
:
gridView
} */} - {/* table LIST */} {activeTab === 0 ? ( <> - {activeList === true && ( + {activeList === false && ( // table - {thead && ( - - {headerGroups.map((headerGroup, index) => ( - - {headerGroup.headers.map((column) => ( - - ))} - - ))} - - )} {cell.render("Cell")} @@ -390,12 +245,6 @@ const BasicTable = ({ {row.isExpanded ? (
- {column.render("Header")} - - {column.isSorted - ? column.isSortedDesc - ? " 🔽" - : " 🔼" - : ""} - -
- {/* {RenderRowSubComponent({ - row: row.original, - columns, - addTab, - })} */} - {/* {RenderRowSubComponent({ row: row.values })} */} )} {/* GRID LIST */} - {activeList === false && ( + {activeList === true && (
- {/* {console.log(row.values)} */}
{row.original.Checkbox}
)} - {/* bottom table */} - {goToPage && ( - - )} - {showMore && ( - - )} ) : ( setActiveList(false) }, - // { icon: list, click: () => setActiveList(true) }, - // ], -}; +BasicTable.defaultProps = {}; diff --git a/src/components/ReactTable5/COLUMNS.js b/src/components/ReactTable5/COLUMNS.js index efbc3da..d0fe529 100644 --- a/src/components/ReactTable5/COLUMNS.js +++ b/src/components/ReactTable5/COLUMNS.js @@ -17,8 +17,8 @@ export const COLUMNS = ({ toggelChekedItems, refChekedItems }) => [ Header: "ایکن فایل", accessor: "filePic", disableSortBy: true, - className: "bg-blue-500 w-10", - Cell: ({ value }) => , + className: "w-16", + Cell: ({ value }) => , }, { Header: "نام فایل", diff --git a/src/components/ReactTable5/MOCK_DATA2.json b/src/components/ReactTable5/MOCK_DATA2.json index c02f4e6..c87bc70 100644 --- a/src/components/ReactTable5/MOCK_DATA2.json +++ b/src/components/ReactTable5/MOCK_DATA2.json @@ -1,7 +1,7 @@ [ { "id": 1, - "filePic": "https://www.google.com/images/branding/googlelogo/1x/googlelogo_light_color_272x92dp.png", + "filePic": "https://img.icons8.com/external-xnimrodx-lineal-color-xnimrodx/2x/external-jpg-graphic-design-xnimrodx-lineal-color-xnimrodx.png", "fileName": "تهران شهری برای آیندگان", "fileType": 1, "fileSize": "23.5KB", @@ -9,7 +9,7 @@ }, { "id": 2, - "filePic": "picture", + "filePic": "https://img.icons8.com/stickers/2x/png.png", "fileName": "عکس سال 99 نوروز", "fileType": 2, "fileSize": "69.5KB", @@ -17,7 +17,7 @@ }, { "id": 3, - "filePic": "picture", + "filePic": "https://img.icons8.com/color/452/folder-invoices--v1.png", "fileName": "دری به سوی بی نهایت", "fileType": 3, "fileSize": "1.5MB", @@ -25,7 +25,7 @@ }, { "id": 4, - "filePic": "picture", + "filePic": "https://img.icons8.com/external-xnimrodx-lineal-color-xnimrodx/2x/external-jpg-graphic-design-xnimrodx-lineal-color-xnimrodx.png", "fileName": "فایل اکسل دانش آموزان", "fileType": 4, "fileSize": "20MB", @@ -33,7 +33,7 @@ }, { "id": 5, - "filePic": "picture", + "filePic": "https://img.icons8.com/external-xnimrodx-blue-xnimrodx/2x/external-video-advertising-xnimrodx-blue-xnimrodx-3.png", "fileName": "صحرای بدون شن", "fileType": 5, "fileSize": "150MB", @@ -41,7 +41,7 @@ }, { "id": 6, - "filePic": "picture", + "filePic": "https://img.icons8.com/color/2x/mp3.png", "fileName": "فایل ایلاستریتور موارد اصلاحی طرح", "fileType": 6, "fileSize": "150MB", @@ -49,7 +49,7 @@ }, { "id": 7, - "filePic": "picture", + "filePic": "https://img.icons8.com/external-xnimrodx-blue-xnimrodx/2x/external-video-advertising-xnimrodx-blue-xnimrodx-3.png", "fileName": "تهران شهری برای آیندگان", "fileType": 1, "fileSize": "23.5KB", @@ -57,7 +57,7 @@ }, { "id": 8, - "filePic": "picture", + "filePic": "https://img.icons8.com/external-xnimrodx-lineal-color-xnimrodx/2x/external-jpg-graphic-design-xnimrodx-lineal-color-xnimrodx.png", "fileName": "عکس سال 99 نوروز", "fileType": 2, "fileSize": "69.5KB", @@ -65,7 +65,7 @@ }, { "id": 9, - "filePic": "picture", + "filePic": "https://img.icons8.com/color/452/folder-invoices--v1.png", "fileName": "دری به سوی بی نهایت", "fileType": 3, "fileSize": "1.5MB", @@ -73,10 +73,10 @@ }, { "id": 10, - "filePic": "picture", + "filePic": "https://img.icons8.com/stickers/2x/png.png", "fileName": "فایل اکسل دانش آموزان", "fileType": 4, "fileSize": "20MB", "fileDate": "1397/04/20" } -] \ No newline at end of file +]