Skip to content

Commit

Permalink
Pre UI update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Jordan Wright committed Sep 23, 2020
1 parent db4d476 commit 9bd5dbc
Showing 1 changed file with 56 additions and 12 deletions.
68 changes: 56 additions & 12 deletions src/components/ItemTable/ItemTable.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types'
import MaterialTable from "material-table";
import MaterialTable, { MTableCell,MTableBodyRow } from "material-table";
import { Card, CardContent, Typography } from '@material-ui/core';


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

const columns = [
{ title: 'Queue', field: 'queue', filterPlaceholder: "Ex: \"ME\"" },
{ title: 'Item #', field: 'number', filterPlaceholder: "Ex: \"42\"" },
{ title: 'Item #', field: 'number', filterPlaceholder: "Ex: \"42\""},
{ title: 'From', field: 'userAlias', filterPlaceholder: "Ex: \"campb303\"" },
{ title: 'Assigned To', field: 'assignedTo', filterPlaceholder: "Ex: \"sundeep\"" },
{ title: 'Subject', field: 'subject', filterPlaceholder: "Ex: \"Install Libraries\"" },
Expand All @@ -26,31 +28,73 @@ export default function ItemTable({ setActiveItem, setSidebarOpen }) {
})
}, [])




const options = {
"filtering": true,
"paging": false,
"search": false,
"draggable": false,
"padding": "dense",


}



return (
<MaterialTable
columns={columns}
data={data}
title={"Demo Table"}
options={options}
onRowClick={(event, rowData) => {
setActiveItem(rowData);
setSidebarOpen(true);
}}
/>
<>
<MaterialTable
columns= {columns}
data={data}
title={"Demo Table"}
options={options}
onRowClick={(event, rowData) => {
setActiveItem(rowData);
setSidebarOpen(true);
}}
style={{

}}
components={{
// Cell: props => (

// <Card>
// <CardContent>
// <MTableCell {...props}/>
// </CardContent>
// </Card>

// ),
Row: props => (

<Card>
<CardContent>
<MTableBodyRow {...props}/>
</CardContent>
</Card>

),
}}


/>


</>
);
}






ItemTable.propTypes = {
/** Function to set active item on row click. */
"setActiveItem": PropTypes.func.isRequired,
/** Function to toggle sidebar on row click. */
"setSidebarOpen": PropTypes.func.isRequired
}

0 comments on commit 9bd5dbc

Please sign in to comment.