Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workorder view height adjust, Button integration and color #29

Merged
merged 1 commit into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions src/components/root/Workorder.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
import React, { Fragment, useState } from "react";
import WorkorderDisplay from "./WorkorderDisplay";
import WorkorderCreate from "../admin/WorkorderCreate";
import { makeStyles } from "@material-ui/core/styles";
import Button from "@material-ui/core/Button";

const useStyles = makeStyles((theme) => ({
root: {
display: "flex",
flexWrap: "wrap",
justifyContent: "center",
flexGrow: 1,
"& > *": {
margin: theme.spacing(1),
},
},
button: {
backgroundColor: "#558564",
color: "#E0E0E0",
padding: "2rem",
},
}));

const Workorder = ({ currentProfile, loadUserProfile, admin }) => {
const classes = useStyles();
const [workView, setWorkView] = useState("display");

function workorderClick() {
Expand All @@ -19,12 +39,16 @@ const Workorder = ({ currentProfile, loadUserProfile, admin }) => {
<Fragment>
{workView === "display" ? (
<Fragment>
<button onClick={workorderClick}>Create new Workorder</button>
<Button className={classes.button} onClick={workorderClick}>
Create new Workorder
</Button>
<WorkorderDisplay currentProfile={currentProfile} />
</Fragment>
) : (
<Fragment>
<button onClick={workorderClick}>View Workorders</button>
<Button className={classes.button} onClick={workorderClick}>
View Workorders
</Button>
<WorkorderCreate
currentProfile={currentProfile}
loadUserProfile={loadUserProfile}
Expand Down
10 changes: 5 additions & 5 deletions src/components/root/WorkorderDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ export default function WorkorderDisplay({ currentProfile }) {
const [orderBy, setOrderBy] = React.useState("calories");
const [selected, setSelected] = React.useState([]);
const [page, setPage] = React.useState(0);
const [dense, setDense] = React.useState(false);
// const [dense] = React.useState(false);
//? LEARN HOW TO UTILIZE DENSE
const [rowsPerPage, setRowsPerPage] = React.useState(10);
const { workorders } = currentProfile;

Expand Down Expand Up @@ -308,9 +309,7 @@ export default function WorkorderDisplay({ currentProfile }) {
return (
<TableRow
hover
onClick={(event) =>
handleClick(event, workorder._id)
}
onClick={(event) => handleClick(event, workorder._id)}
role="checkbox"
aria-checked={isItemSelected}
tabIndex={-1}
Expand Down Expand Up @@ -338,7 +337,8 @@ export default function WorkorderDisplay({ currentProfile }) {
);
})}
{emptyRows > 0 && (
<TableRow style={{ height: (dense ? 33 : 53) * emptyRows }}>
// <TableRow style={{ height: (dense ? 33 : 36.7) * emptyRows }}>
<TableRow style={{ height: "44.3vh" }}>
<TableCell colSpan={6} />
</TableRow>
)}
Expand Down