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

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

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

Loading…
Cancel
Save