Skip to content

Commit

Permalink
Move all files to root dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Jul 8, 2020
1 parent 4fd882f commit d5a4eed
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 83 deletions.
26 changes: 20 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# macOS Speific Files
.DS_Store
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# Editor specific files
*.code-workspace
# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Working Directory for Create React App testing
# /webqueue2-cra-test/*
npm-debug.log*
yarn-debug.log*
yarn-error.log*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions webqueue2-cra-test/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"clsx": "^1.1.1",
"history": "^5.0.0",
"material-table": "^1.63.1",
"react": "^16.13.1",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from "react";
import ItemTable from "./ItemTable";

function App(){
return (
<ItemTable />
);
}

export default App;
56 changes: 10 additions & 46 deletions webqueue2-cra-test/src/ItemTable.js → src/ItemTable.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { useState } from 'react';
import MaterialTable from "material-table";
import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
import Drawer from "@material-ui/core/Drawer";
import Button from "@material-ui/core/Button";
import ItemView from "./ItemView";
import {useTheme} from "@material-ui/core/styles";

function App() {
function ItemTable() {
const theme = useTheme();

const columns = [
{ title: 'Queue', field: 'queue', filterPlaceholder: "Ex: \"ME\""},
Expand Down Expand Up @@ -49,56 +47,22 @@ function App() {
{"queue": "LINUX", "itemNumber": 12, "from": "apigman", "for": "cs", "subject": "Same Problem but a 5th time", "status": "qc ok", "priority": "covid"},
];

const acitons = [
{
"icon": OpenInBrowserIcon,
"tooltip": "Open Item",
onClick: (event, rowData) => {
console.log(rowData);
setActiveItem(rowData);
handleDrawerOpen();
}
}
]

const options = {
"filtering": true,
// "actionsColumnIndex": -1,
"paging": false,
"search": false,
"draggable": false,
"padding": "dense",
}

const [itemViewOpen, setItemViewOpen] = useState(false);
const [activeItem, setActiveItem] = useState({});

const handleDrawerOpen = () => setItemViewOpen(true);
const handleDrawerClose = () => setItemViewOpen(false);

return (
<>
<Button variant="contained" color="secondary">
Current Item is: {activeItem.queue + " " + activeItem.itemNumber}
</Button>
<Button onClick={handleDrawerOpen}>
Open Drawer
</Button>
<Button onClick={handleDrawerClose}>
Close Drawer
</Button>
<MaterialTable
columns={columns}
data={data}
title={"Example Item Table"}
actions={acitons}
options={options}
/>
<Drawer anchor="right" variant="persistent" open={itemViewOpen}>
<ItemView item={activeItem}/>
</Drawer>
</>
<MaterialTable
columns={columns}
data={data}
title={"Example Item Table"}
options={options}
/>
);
}

export default App;
export default ItemTable;
File renamed without changes.
2 changes: 2 additions & 0 deletions webqueue2-cra-test/src/index.js → src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import ReactDOM from 'react-dom';
import App from './App';
import * as serviceWorker from './serviceWorker';
import { createBrowserHistory } from 'history';
import { CssBaseline } from '@material-ui/core';

export const history = createBrowserHistory({
basename: process.env.PUBLIC_URL
});

ReactDOM.render(
<React.StrictMode>
<CssBaseline />
<App />
</React.StrictMode>,
document.getElementById('root')
Expand Down
File renamed without changes.
23 changes: 0 additions & 23 deletions webqueue2-cra-test/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions webqueue2-cra-test/src/App.js

This file was deleted.

0 comments on commit d5a4eed

Please sign in to comment.