Skip to content

Commit

Permalink
added row click handler to include updating history
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Thomas Elfreich committed Oct 8, 2020
1 parent a91daff commit ec0cdc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types'
import MaterialTable from "material-table";

export default function ItemTable({ setActiveItem, setSidebarOpen }) {
export default function ItemTable({ history, setActiveItem, setSidebarOpen }) {

const columns = [
{ title: 'Queue', field: 'queue', filterPlaceholder: "Ex: \"ME\"" },
Expand Down Expand Up @@ -43,6 +43,7 @@ export default function ItemTable({ setActiveItem, setSidebarOpen }) {
onRowClick={(event, rowData) => {
setActiveItem(rowData);
setSidebarOpen(true);
history.push(`/${rowData.queue}/${rowData.number}`);
}}
/>
);
Expand Down

0 comments on commit ec0cdc5

Please sign in to comment.