master
mahdi andalib 3 years ago
parent da09fab25a
commit a0871366cd
  1. 19
      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,6 +359,7 @@ const BasicTable = ({
/> />
)} )}
{/* GRID LIST */} {/* GRID LIST */}
{activeList === true && (
<div className="flex flex-row gap-4"> <div className="flex flex-row gap-4">
{data.map((item, index) => ( {data.map((item, index) => (
<div <div
@ -365,6 +375,7 @@ const BasicTable = ({
</div> </div>
))} ))}
</div> </div>
)}
</> </>
); );
}; };

Loading…
Cancel
Save