Added page for job closing BOD-131

This commit is contained in:
Patrick Fic
2020-05-15 16:43:27 -07:00
parent 58b4985319
commit 51ea04bf2c
15 changed files with 833 additions and 444 deletions

View File

@@ -0,0 +1,31 @@
import React, { useCallback, useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { CalculateJob } from "../../components/job-totals-table/job-totals.utility";
import JobsCloseLaborMaterialAllocation from "../../components/jobs-close-labmat-allocation/jobs-close-labmat-allocation.component";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
bodyshop: selectBodyshop,
});
export function JobsCloseComponent({ job, bodyshop }) {
const CalcJobMemoized = useCallback(
() => CalculateJob(job, bodyshop.shoprates),
[job, bodyshop.shoprates]
);
const jobTotals = CalcJobMemoized();
const [labmatAllocations, setLabmatAllocations] = useState(jobTotals.rates);
return (
<div>
<JobsCloseLaborMaterialAllocation
labmatAllocations={labmatAllocations}
setLabmatAllocations={setLabmatAllocations}
/>
</div>
);
}
export default connect(mapStateToProps, null)(JobsCloseComponent);