Skip to content

Commit

Permalink
Implement logic for default sorting order of ItemTable
Browse files Browse the repository at this point in the history
  • Loading branch information
wrigh393 committed Jan 8, 2021
1 parent 2bd362c commit bb68f11
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ArrowDownward, ArrowUpward } from "@material-ui/icons";


export default function ItemTable({ data, rowCanBeSelected }) {
const [selectedRow, setSelectedRow] = useState({ queue: null, number: null});
const [selectedRow, setSelectedRow] = useState({ queue: null, number: null });

const theme = useTheme();
const useStyles = makeStyles({
Expand Down Expand Up @@ -69,8 +69,14 @@ export default function ItemTable({ data, rowCanBeSelected }) {
);
}
},
initialState: {
sortBy: [
{ id: 'number', desc: false },
{ id: 'lastUpdated', desc: false },
]
}
},
useFilters, useFlexLayout, useSortBy,
useFilters, useFlexLayout, useSortBy,
);
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow, } = tableInstance;

Expand Down

0 comments on commit bb68f11

Please sign in to comment.