Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Oct 30, 2020
1 parent 3b4ef18 commit 496196e
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";
import PropTypes from "prop-types";
import { useTable, useFilters, useFlexLayout, useSortBy, useRowSelect } from "react-table";
import { makeStyles, Table, TableBody, TableCell, TableHead, TableRow, TableContainer, Paper, Grid, useTheme, ButtonGroup, IconButton } from "@material-ui/core";

import { useTable, useFilters, useFlexLayout, useSortBy } from "react-table";
import {
Table, TableBody, TableCell, TableHead, TableRow, TableContainer,
Paper, Grid, ButtonGroup, IconButton, makeStyles, useTheme
} from "@material-ui/core";
import { useHistory } from "react-router-dom";
import RelativeTime from "react-relative-time";
import ItemTableFilter from "../ItemTableFilter/"
Expand All @@ -20,11 +22,6 @@ export default function ItemTable({ data }) {
inactiveSortIcon: {
opacity: 0.2,
},
selectedItem: {
'.Mui-selected': {
backgroundColor: theme.palette.type === 'light' ? theme.palette.primary[50] : theme.palette.primary[700],
}
},
bandedRows: {
'&:nth-of-type(even)': {
backgroundColor: theme.palette.type === 'light' ? theme.palette.grey[50] : theme.palette.grey[700],
Expand All @@ -48,7 +45,6 @@ export default function ItemTable({ data }) {
{ Header: 'Subject', accessor: 'subject' },
{ Header: 'Status', accessor: 'status', },
{ Header: 'Priority', accessor: 'priority' },

{ Header: 'Last Updated', accessor: 'lastUpdated', Cell: ({ value }) => <RelativeTime value={value} /> },
{ Header: 'Department', accessor: 'department' },
{ Header: 'Building', accessor: 'building' },
Expand Down Expand Up @@ -88,13 +84,11 @@ export default function ItemTable({ data }) {
{column.render("Filter")}
</Grid>
<Grid item sm={2} alignItems='center' justify='center'>

<ButtonGroup orientation="vertical" size="small">
<IconButton
size="small"
onClick={(_ => {
const isSortedAsc = column.isSorted && !column.isSortedDesc;

isSortedAsc ? column.clearSortBy() : column.toggleSortBy(false)
})}
>
Expand All @@ -107,7 +101,6 @@ export default function ItemTable({ data }) {
size="small"
onClick={(_ => {
const isSortedDesc = column.isSorted && column.isSortedDesc;

isSortedDesc ? column.clearSortBy() : column.toggleSortBy(true)
})}
>
Expand All @@ -117,7 +110,6 @@ export default function ItemTable({ data }) {
/>
</IconButton>
</ButtonGroup>

</Grid>
</Grid>
</TableCell>
Expand Down

0 comments on commit 496196e

Please sign in to comment.