master
mahdi andalib 3 years ago
parent 3a83c2e228
commit ac932ee804
  1. 20
      src/components/ReactTable5/BasicTable.js
  2. 5
      src/components/ReactTable5/COLUMNS.js
  3. 2
      src/components/ReactTable5/Checkbox.js

@ -123,23 +123,7 @@ const BasicTable = ({
useSortBy, useSortBy,
useExpanded, useExpanded,
usePagination, usePagination,
useRowSelect, useRowSelect
(hooks) => {
hooks.visibleColumns.push((columns) => {
return [
{
id: "selection",
Header: ({ getToggleAllRowsSelectedProps }) => (
<Checkbox {...getToggleAllRowsSelectedProps()} />
),
Cell: ({ row }) => (
<Checkbox {...row.getToggleRowSelectedProps()} />
),
},
...columns,
];
});
}
); );
const { globalFilter, pageIndex, pageSize } = state; const { globalFilter, pageIndex, pageSize } = state;
@ -270,7 +254,7 @@ const BasicTable = ({
<tr <tr
{...row.getRowProps()} {...row.getRowProps()}
style={{ style={{
backgroundColor: isEven(idx) ? "#F9F9F9" : "fff", backgroundColor: isEven(idx) ? "#F9F9F9" : "#fff",
}} }}
// className={isEven(idx) ? "bg-gray-600" : "bg-white"} // className={isEven(idx) ? "bg-gray-600" : "bg-white"}
// //

@ -18,18 +18,21 @@ export const COLUMNS = ({ setFiltering, filtering, addTab }) => [
{ {
Header: "نام فایل", Header: "نام فایل",
accessor: "fileName", accessor: "fileName",
className: "bg-blue-500 w-10", // className: "bg-yellow-500",
}, },
{ {
Header: "نوع فایل", Header: "نوع فایل",
accessor: "fileType", accessor: "fileType",
// className: "bg-red-500 ",
}, },
{ {
Header: "سایز فایل", Header: "سایز فایل",
accessor: "fileSize", accessor: "fileSize",
// className: "bg-blue-500 ",
}, },
{ {
Header: "تاریخ فایل", Header: "تاریخ فایل",
accessor: "fileDate", accessor: "fileDate",
// className: "bg-green-500 ",
}, },
]; ];

@ -12,7 +12,7 @@ export const Checkbox = React.forwardRef(({ indeterminate, ...rest }, ref) => {
<> <>
<input <input
type="checkbox" type="checkbox"
className="rounded-sm accent-pink-500" className="rounded-sm "
ref={resolvedRef} ref={resolvedRef}
{...rest} {...rest}
/> />

Loading…
Cancel
Save