Removed AdminLTE, some minor improvements
This commit is contained in:
@@ -6,6 +6,7 @@ import {Box, Button, Select, TextField, Table, TableBody, TableCell, TableHead,
|
||||
import {formatDate, formatDateTime} from "../util";
|
||||
import {isNumber} from "chart.js/helpers";
|
||||
import {ArrowUpward, ArrowDownward, Refresh} from "@mui/icons-material";
|
||||
import TableBodyStriped from "./table-body-striped";
|
||||
|
||||
|
||||
export function DataTable(props) {
|
||||
@@ -135,9 +136,9 @@ export function DataTable(props) {
|
||||
{ headerRow }
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
<TableBodyStriped>
|
||||
{ rows }
|
||||
</TableBody>
|
||||
</TableBodyStriped>
|
||||
</Table>
|
||||
{pagination && pagination.renderPagination(L, numRows)}
|
||||
</Box>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
export default function Icon(props) {
|
||||
|
||||
let classes = props.className || [];
|
||||
classes = Array.isArray(classes) ? classes : classes.toString().split(" ");
|
||||
let type = props.type || "fas";
|
||||
let icon = props.icon;
|
||||
|
||||
classes.push(type);
|
||||
classes.push("fa-" + icon);
|
||||
|
||||
if (icon === "spinner" || icon === "circle-notch") {
|
||||
classes.push("fa-spin");
|
||||
}
|
||||
|
||||
let newProps = {...props, className: classes.join(" ") };
|
||||
delete newProps["type"];
|
||||
delete newProps["icon"];
|
||||
|
||||
return (
|
||||
<i {...newProps} />
|
||||
);
|
||||
}
|
||||
12
react/shared/elements/table-body-striped.jsx
Normal file
12
react/shared/elements/table-body-striped.jsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import {styled, TableBody} from "@mui/material";
|
||||
|
||||
const TableBodyStriped = styled(TableBody)(({ theme }) => ({
|
||||
'& tr:nth-of-type(odd)': {
|
||||
backgroundColor: theme.palette.grey[0],
|
||||
},
|
||||
'& tr:nth-of-type(even)': {
|
||||
backgroundColor: theme.palette.grey[100],
|
||||
},
|
||||
}));
|
||||
|
||||
export default TableBodyStriped;
|
||||
Reference in New Issue
Block a user