update 8 files

master
mahdi 3 years ago
parent a73908986a
commit bf6b7f464d
  1. 8
      src/App.js
  2. 12
      src/components/FolderTree/index.js
  3. 4
      src/components/GridListTable/index.js
  4. 22
      src/components/ReactTable5/BasicTable.js
  5. 8
      src/components/ReactTable5/EditRow.js
  6. 31
      src/components/ReactTable5/ViewEdit.js

@ -181,13 +181,13 @@ function App() {
{/* <ReactTable3 /> */} {/* <ReactTable3 /> */}
{/* ----------------------------$$$ start---------------------------- */} {/* ----------------------------$$$ start---------------------------- */}
<BreadCrumb /> {/* <BreadCrumb /> */}
{/* <SearchBox /> */} {/* <SearchBox /> */}
{/* <TitleSubtitle /> */} {/* <TitleSubtitle /> */}
{/* <FolderTree /> */} {/* <FolderTree /> */}
{/* ----------------------------$$$ end---------------------------- */} {/* ----------------------------$$$ end---------------------------- */}
{/* <ReactTable4 /> */} <ReactTable4 />
{/* <ReactTable5 /> */} {/* <ReactTable5 /> */}
{/* ----------------------------$$$ start---------------------------- */} {/* ----------------------------$$$ start---------------------------- */}
@ -209,7 +209,7 @@ function App() {
{/* <FileManager /> */} {/* <FileManager /> */}
{/* <GridListTable /> */} <GridListTable />
{/* <PopupCard /> */} {/* <PopupCard /> */}
@ -265,7 +265,7 @@ function App() {
{/* <DateRangePicker /> */} {/* <DateRangePicker /> */}
{/* ----------------------------$$$ end---------------------------- */} {/* ----------------------------$$$ end---------------------------- */}
{/* <FormInput /> */} <FormInput />
{/* <LeafletMap /> */} {/* <LeafletMap /> */}

@ -1,8 +1,5 @@
import React, { useState } from "react"; import React, { useState } from "react";
import folder from "./images/folder.svg";
import selectedFolder from "./images/selectedFolder.svg";
import arrow from "./images/arrow.svg"; import arrow from "./images/arrow.svg";
import selectedArrow from "./images/selectedArrow.svg"; import selectedArrow from "./images/selectedArrow.svg";
@ -16,7 +13,7 @@ const FolderState = ({ items }) => {
return ( return (
<> <>
<div <div
className={`z-0 absolute w-3/12 right-0 py-2 bg-blue-100 transition-all border-r-4 border-blue-600`} className={`z-0 absolute w-[265px] right-0 py-2 bg-blue-300 transition-all border-r-4 border-blue-600`}
style={{ top: top - 10 }} style={{ top: top - 10 }}
> >
&nbsp; &nbsp;
@ -35,9 +32,11 @@ const FolderTree = ({ items, pid, selected, setSelected, setTop }) => {
const [expands, setExpand] = useState( const [expands, setExpand] = useState(
items.filter((item) => item.exapnd).map((item) => item.id) items.filter((item) => item.exapnd).map((item) => item.id)
); );
if (!pid) pid = null; if (!pid) pid = null;
return ( return (
<div className={"w-fit pr-3 "}> <div className={"w-fit pr-3"}>
{items {items
.filter((item) => item.pid === pid) .filter((item) => item.pid === pid)
.map((item, index) => { .map((item, index) => {
@ -47,7 +46,7 @@ const FolderTree = ({ items, pid, selected, setSelected, setTop }) => {
<div <div
key={index} key={index}
className={ className={
"flex flex-row items-center cursor-pointer py-1 " "flex flex-row items-center cursor-pointer py-2"
// + (selected === item.id ? "bg-blue-200" : "") // + (selected === item.id ? "bg-blue-200" : "")
} }
onClick={(e) => { onClick={(e) => {
@ -71,7 +70,6 @@ const FolderTree = ({ items, pid, selected, setSelected, setTop }) => {
src={expand ? opened : icon1} src={expand ? opened : icon1}
className="z-10 w-7 transition-all duration-700" className="z-10 w-7 transition-all duration-700"
/> />
<span <span
className={ className={
"z-10 mr-2 " + "z-10 mr-2 " +

@ -6,11 +6,11 @@ const GridListTable = () => {
return ( return (
<section className="flex flex-row"> <section className="flex flex-row">
{/* right */} {/* right */}
<div className="w-3/12" style={{ backgroundColor: "#FBFBFB" }}> <div className="w-[265px] " style={{ backgroundColor: "#FBFBFB" }}>
<FolderTree /> <FolderTree />
</div> </div>
{/* left */} {/* left */}
<div className="w-9/12"> <div className="flex-1">
<ReactTable5 /> <ReactTable5 />
</div> </div>
</section> </section>

@ -26,6 +26,7 @@ import {
useExpanded, useExpanded,
} from "react-table"; } from "react-table";
import ButtonNewDesign from "../ButtonNewDesign"; import ButtonNewDesign from "../ButtonNewDesign";
import Button from "../Button";
export const SelectColumnFilter = ({ export const SelectColumnFilter = ({
column: { filterValue, setFilter, preFilteredRows, id, render }, column: { filterValue, setFilter, preFilteredRows, id, render },
@ -168,14 +169,8 @@ const BasicTable = ({ addTab, activeTab }) => {
) : null ) : null
) )
)} )}
<ButtonNewDesign <Button
bgColor={"bg-blue-500"} className={"bg-blue-500 rounded text-xs p-3 text-white"}
icon={null}
border={"border-0"}
borderRadius={"rounded"}
fontSize={"text-xs"}
paddingX={"p-3"}
paddingY={"p-3"}
text={ text={
chekedItems.length < page.length ? "انتخاب همه" : "حذف انتخاب" chekedItems.length < page.length ? "انتخاب همه" : "حذف انتخاب"
} }
@ -188,7 +183,7 @@ const BasicTable = ({ addTab, activeTab }) => {
}} }}
/> />
</div> </div>
<div className="w-4/12 "> <div className="">
<GlobalFilter <GlobalFilter
filter={globalFilter} filter={globalFilter}
setFilter={setGlobalFilter} setFilter={setGlobalFilter}
@ -271,14 +266,14 @@ const BasicTable = ({ addTab, activeTab }) => {
{activeList === true && ( {activeList === true && (
<div <div
{...getTableBodyProps()} {...getTableBodyProps()}
className="flex flex-row flex-wrap gap-4 items-center justify-center" className="flex flex-wrap gap-5 items-center justify-between "
> >
{page.map((row, idx) => { {page.map((row, idx) => {
prepareRow(row); prepareRow(row);
return ( return (
<div <div
{...row.getRowProps()} {...row.getRowProps()}
className={`flex flex-col items-stretch px-3 py-2 rounded-md w-52 relative ${ className={`flex flex-col min-w-[250px] items-stretch p-4 rounded-md relative ${
chekedItems.includes(row.original.id) chekedItems.includes(row.original.id)
? "bg-[#ddd]" ? "bg-[#ddd]"
: "bg-[#F3F3F3]" : "bg-[#F3F3F3]"
@ -297,9 +292,12 @@ const BasicTable = ({ addTab, activeTab }) => {
alt={row.original.filePic} alt={row.original.filePic}
className="w-16 mx-auto" className="w-16 mx-auto"
/> />
<p className="text-xs my-3">{row.original.fileName}</p> <p className="text-xs mb-3 mt-5">{row.original.fileName}</p>
<span className="text-xs text-left text-gray-500"> <span className="text-xs text-left text-gray-500">
{row.original.fileSize} {row.original.fileSize}
{console.log("mahdi")}
{console.log(row.original)}
{console.log("mahdi")}
</span> </span>
</div> </div>
); );

@ -7,15 +7,15 @@ const EditRow = ({ row }) => {
<div <div
onClick={() => setOpenModal(false)} onClick={() => setOpenModal(false)}
data-modal-toggle="large-modal" data-modal-toggle="large-modal"
className={`cursor-pointer w-screen h-screen backdrop-filter backdrop-blur-lg bg-opacity-90 bg-gray-600 flex items-center justify-center fixed left-0 top-0 className={`cursor-pointer w-screen h-screen backdrop-filter backdrop-blur-lg bg-opacity-90 bg-gray-900 flex items-center justify-center fixed left-0 top-0
${openModal ? "opacity-80" : "opacity-0 pointer-events-none"}`} ${openModal ? "opacity-90" : "opacity-0 pointer-events-none"}`}
> >
<div <div
className="absolute w-6/12 bg-white p-4 rounded flex flex-row flex-wrap items-center justify-around" className="absolute w-fit bg-white p-4 rounded flex flex-row items-center space-x-10"
style={{ top: "10%" }} style={{ top: "10%" }}
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<img src={row.original.filePic} className="w-20" /> <img src={row.original.filePic} alt="" className="w-20" />
<span <span
role="textbox" role="textbox"
style={{ style={{

@ -1,4 +1,5 @@
import React, { useState } from "react"; import React, { useState } from "react";
import Button from "../Button";
import ButtonNewDesign from "../ButtonNewDesign"; import ButtonNewDesign from "../ButtonNewDesign";
import EditRow from "./EditRow"; import EditRow from "./EditRow";
@ -7,33 +8,21 @@ const ViewEdit = ({ row }) => {
return ( return (
<div className="flex flex-row justify-end gap-x-2"> <div className="flex flex-row justify-end gap-x-2">
<div onClick={(e) => e.stopPropagation()}> <div onClick={(e) => e.stopPropagation()}>
<ButtonNewDesign <Button
bgColor={"bg-blue-400"} className={
bgHoverColor={"hover:bg-blue-600"} "bg-blue-400 hover:bg-blue-600 text-white rounded text-xs p-3"
textColor={"text-white"} }
border={"border-0"}
borderRadius={"rounded"}
fontSize={"text-xs"}
paddingX={"p-3"}
paddingY={"p-3"}
icon={null}
text={"نمایش"} text={"نمایش"}
{...row.getToggleRowExpandedProps()} {...row.getToggleRowExpandedProps()}
/> />
</div> </div>
<div onClick={(e) => e.stopPropagation()}> <div onClick={(e) => e.stopPropagation()}>
<ButtonNewDesign <Button
bgColor={"bg-transparent"} className={
bgHoverColor={null} "bg-transparent hover:bg-blue-600 hover:text-white border border-blue-600 text-blue-600 rounded text-xs p-3"
textColor={"text-blue-600"} }
border={"border"}
borderColor={"border-blue-600"}
borderRadius={"rounded"}
fontSize={"text-xs"}
paddingX={"p-3"}
paddingY={"p-3"}
icon={null}
text={"ویرایش"} text={"ویرایش"}
{...row.getToggleRowExpandedProps()}
onClick={() => setSelectedTab(true)} onClick={() => setSelectedTab(true)}
/> />
</div> </div>

Loading…
Cancel
Save