master
mahdi andalib 3 years ago
parent da09fab25a
commit a0871366cd
  1. 49
      src/components/ReactTable5/BasicTable.js

@ -153,8 +153,16 @@ const BasicTable = ({
return ( return (
<> <>
<img src={list} className="cursor-pointer my-5" /> <img
<img src={grid} className="cursor-pointer my-5" /> src={list}
className="cursor-pointer my-5"
onClick={() => setActiveList(false)}
/>
<img
src={grid}
className="cursor-pointer my-5"
onClick={() => setActiveList(true)}
/>
<div className="flex flex-row items-center justify-between"> <div className="flex flex-row items-center justify-between">
{/* right box */} {/* right box */}
<di className="bg-red-400"> <di className="bg-red-400">
@ -217,6 +225,7 @@ const BasicTable = ({
</div> </div>
) : null} ) : null}
</div> </div>
{/* table LIST */} {/* table LIST */}
{activeTab == 0 ? ( {activeTab == 0 ? (
<> <>
@ -285,7 +294,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({
@ -323,7 +332,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}
@ -350,21 +359,23 @@ const BasicTable = ({
/> />
)} )}
{/* GRID LIST */} {/* GRID LIST */}
<div className="flex flex-row gap-4"> {activeList === true && (
{data.map((item, index) => ( <div className="flex flex-row gap-4">
<div {data.map((item, index) => (
className="flex flex-col px-4 py-5 rounded-md" <div
key={index} className="flex flex-col px-4 py-5 rounded-md"
style={{ backgroundColor: "#fff" }} key={index}
> style={{ backgroundColor: "#fff" }}
<img src={image1} className="w-52" /> >
<p className="text-sm my-3">{item.fileName}</p> <img src={image1} className="w-52" />
<span className="text-xs text-left text-gray-500"> <p className="text-sm my-3">{item.fileName}</p>
{item.fileSize} <span className="text-xs text-left text-gray-500">
</span> {item.fileSize}
</div> </span>
))} </div>
</div> ))}
</div>
)}
</> </>
); );
}; };

Loading…
Cancel
Save