master
mahdi andalib 3 years ago
parent 7bce25ae94
commit 7de6da9874
  1. 11
      src/App.js
  2. 2
      src/components/FolderTree/index.js
  3. 20
      src/components/GridListTable/index.js
  4. 78
      src/components/ReactTable5/BasicTable.js
  5. 3
      src/components/ReactTable5/COLUMNS.js
  6. 4
      src/components/ReactTable5/index.js

@ -58,6 +58,7 @@ import UploadFile from "./components/UploadFile";
import BarChartApex from "./components/BarChartApex"; import BarChartApex from "./components/BarChartApex";
import SemiDonut from "./components/SemiDonut"; import SemiDonut from "./components/SemiDonut";
import FolderTree from "./components/FolderTree"; import FolderTree from "./components/FolderTree";
import GridListTable from "./components/GridListTable";
// import Digikala from "./components/Digikala/ImageSlider"; // import Digikala from "./components/Digikala/ImageSlider";
@ -88,7 +89,7 @@ function App() {
{/* <Toast /> */} {/* <Toast /> */}
{/* <ProductSuggestion /> */} {/* <ProductSuggestion /> */}
{/* <ProductImage /> */} {/* <ProductImage /> */}
<ProductTab /> {/* <ProductTab /> */}
{/* <ProductStatusCard /> */} {/* <ProductStatusCard /> */}
{/* <AdvertisementDesign1 /> */} {/* <AdvertisementDesign1 /> */}
{/* <AdvertisementDesign2 /> */} {/* <AdvertisementDesign2 /> */}
@ -103,7 +104,7 @@ function App() {
{/* <ReactTable2 /> */} {/* <ReactTable2 /> */}
{/* <ReactTable3 /> */} {/* <ReactTable3 /> */}
{/* <ReactTable4 /> */} {/* <ReactTable4 /> */}
<ReactTable5 /> {/* <ReactTable5 /> */}
{/* <Digikala /> */} {/* <Digikala /> */}
{/* <HeaderDesign1 /> {/* <HeaderDesign1 />
<div className="flex"> <div className="flex">
@ -123,8 +124,10 @@ function App() {
{/* <UploadFile /> */} {/* <UploadFile /> */}
{/* <BarChartApex /> */} {/* <BarChartApex /> */}
{/* <SemiDonut /> */} {/* <SemiDonut /> */}
<FolderTree /> {/* <FolderTree /> */}
<SidebarDesign2 className="w-1/5" /> <GridListTable />
{/* <SidebarDesign2 className="w-1/5" /> */}
</div> </div>
</Provider> </Provider>
); );

@ -10,7 +10,7 @@ const FolderTree = ({ items }) => {
const [activeDropdown, setActiveDropdown] = useState(null); const [activeDropdown, setActiveDropdown] = useState(null);
return ( return (
<div className="bg-white w-72 p-4 mx-auto"> <div className="w-fit p-4">
{items.map((item, index) => ( {items.map((item, index) => (
<div> <div>
{/* level1 */} {/* level1 */}

@ -0,0 +1,20 @@
import React from "react";
import FolderTree from "../FolderTree";
import ReactTable5 from "../ReactTable5";
const GridListTable = () => {
return (
<section className="flex flex-row">
{/* right */}
<div className="w-3/12" style={{ backgroundColor: "#FBFBFB" }}>
<FolderTree />
</div>
{/* left */}
<div className="w-9/12">
<ReactTable5 />
</div>
</section>
);
};
export default GridListTable;

@ -113,6 +113,10 @@ const BasicTable = ({
[] []
); );
// console.log("mahdi tannaz");
// console.log(columns[0]);
// console.log("mahdi tannaz");
const defaultColumn = useMemo(() => { const defaultColumn = useMemo(() => {
return {}; return {};
}, []); }, []);
@ -163,7 +167,7 @@ const BasicTable = ({
const [activeList, setActiveList] = useState(false); const [activeList, setActiveList] = useState(false);
return ( return (
<div className="bg-white p-4 rounded"> <div className="bg-white p-4">
{/* {filtering && <section>TANNAZ</section>} */} {/* {filtering && <section>TANNAZ</section>} */}
{/* <div className="flex flex-row items-center"> {/* <div className="flex flex-row items-center">
{listView.map((list, i) => ( {listView.map((list, i) => (
@ -175,39 +179,41 @@ const BasicTable = ({
/> />
))} ))}
</div>{" "} */} </div>{" "} */}
<div className="mb-3 flex flex-row items-center gap-x-5"> <div className="mb-7 flex flex-row items-center justify-between">
{/* select View list */} {/* select View list */}
<div className="flex flex-row items-center gap-x-2"> <div className="flex flex-row items-center gap-x-5">
<img <div className="flex flex-row items-center gap-x-2">
src={list} <img
className="cursor-pointer" src={list}
onClick={() => setActiveList(false)} className="cursor-pointer"
/> onClick={() => setActiveList(false)}
<img />
src={grid} <img
className="cursor-pointer" src={grid}
onClick={() => setActiveList(true)} className="cursor-pointer"
onClick={() => setActiveList(true)}
/>
</div>
{headerGroups.map((headerGroup) =>
headerGroup.headers.map((column) =>
column.Filter ? (
<div className="mt-2 sm:mt-0" key={column.id}>
{column.render("Filter")}
</div>
) : null
)
)}
<ButtonNewDesign
bgColor={"bg-blue-500"}
icon={null}
border={"border-0"}
borderRadius={"rounded"}
fontSize={"text-xs"}
padding={"p-2"}
text={"انتخاب چند فایل"}
/> />
</div> </div>
{headerGroups.map((headerGroup) => <div className="w-4/12 ">
headerGroup.headers.map((column) =>
column.Filter ? (
<div className="mt-2 sm:mt-0" key={column.id}>
{column.render("Filter")}
</div>
) : null
)
)}
<ButtonNewDesign
bgColor={"bg-blue-500"}
icon={null}
border={"border-0"}
borderRadius={"rounded"}
fontSize={"text-xs"}
padding={"p-2"}
text={"انتخاب چند فایل"}
/>
<div className="flex-1 ">
<GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} /> <GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} />
</div> </div>
@ -282,7 +288,7 @@ const BasicTable = ({
{/* table LIST */} {/* table LIST */}
{activeTab == 0 ? ( {activeTab == 0 ? (
<> <>
{activeList === false && ( {activeList === true && (
// table // table
<table <table
{...getTableProps()} {...getTableProps()}
@ -332,7 +338,7 @@ const BasicTable = ({
// //
> >
{row.cells.map((cell, index) => { {row.cells.map((cell, index) => {
// console.log(row.cells); console.log(row.cells);
return ( return (
<td <td
{...cell.getCellProps({ {...cell.getCellProps({
@ -370,7 +376,7 @@ const BasicTable = ({
addTab={addTab} addTab={addTab}
row={row.original} row={row.original}
/> />
{/* {console.log(row.original)} */} {console.log(row.original)}
</td> </td>
</tr> </tr>
) : null} ) : null}
@ -381,7 +387,7 @@ const BasicTable = ({
</table> </table>
)} )}
{/* GRID LIST */} {/* GRID LIST */}
{activeList === true && ( {activeList === false && (
<div <div
{...getTableBodyProps()} {...getTableBodyProps()}
className="flex flex-row flex-wrap gap-4 items-center justify-center" className="flex flex-row flex-wrap gap-4 items-center justify-center"
@ -395,6 +401,8 @@ const BasicTable = ({
key={index} key={index}
style={{ backgroundColor: "#F3F3F3" }} style={{ backgroundColor: "#F3F3F3" }}
> >
{/* {console.log(row.values)} */}
<div className="bg-red-500"> {row.original.Checkbox}</div>
<img <img
src={row.original.filePic} src={row.original.filePic}
alt={row.original.filePic} alt={row.original.filePic}

@ -7,7 +7,8 @@ import { FileType } from "./FileType";
export const COLUMNS = ({ setFiltering, filtering, addTab }) => [ export const COLUMNS = ({ setFiltering, filtering, addTab }) => [
{ {
Header: "چک باکس", Header: "checkBox",
// accessor: "checkBox",
accessor: () => Checkbox({ setFiltering, filtering, addTab }), accessor: () => Checkbox({ setFiltering, filtering, addTab }),
className: "w-7", className: "w-7",
}, },

@ -32,7 +32,7 @@ const ReactTable5 = ({ breadCrumbs, breadCrumb }) => {
}; };
return ( return (
<div className="my-10 w-11/12 mx-auto"> <div className="w-full">
{/* breadCrumb */} {/* breadCrumb */}
<div className="flex flex-row items-center"> <div className="flex flex-row items-center">
{breadCrumb && {breadCrumb &&
@ -57,7 +57,7 @@ const ReactTable5 = ({ breadCrumbs, breadCrumb }) => {
</div> </div>
))} ))}
</div> </div>
<div className="my-7"> <div className="">
<TitleSubtitle titleShow={false} subTitleShow={false} /> <TitleSubtitle titleShow={false} subTitleShow={false} />
</div> </div>
<BasicTable <BasicTable

Loading…
Cancel
Save