IO-1160 Target Touch Time Highlighting.
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
import moment from "moment";
|
||||
import React, { useMemo } from "react";
|
||||
export default function ProductionlistColumnTouchTime({ job }) {
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ProductionlistColumnTouchTime);
|
||||
|
||||
export function ProductionlistColumnTouchTime({ bodyshop, job }) {
|
||||
let ct = useMemo(() => {
|
||||
if (!!job.actual_in) {
|
||||
const totalHrs =
|
||||
@@ -18,5 +32,7 @@ export default function ProductionlistColumnTouchTime({ job }) {
|
||||
return 0;
|
||||
}, [job]);
|
||||
|
||||
return <span>{ct}</span>;
|
||||
const underTarget = ct < bodyshop.target_touchtime;
|
||||
|
||||
return <span style={{ color: underTarget && "tomato" }}>{ct}</span>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user