Added tech routing paths and basic structure of landing page + sign in + reducers BOD-95

This commit is contained in:
Patrick Fic
2020-06-29 13:39:17 -07:00
parent 0009f7d3bb
commit 2edfadce3a
24 changed files with 662 additions and 24 deletions

View File

@@ -1,9 +1,9 @@
import { Card, Statistic } from "antd";
import moment from "moment";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { Statistic, Card } from "antd";
import moment from "moment";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -12,25 +12,21 @@ const mapDispatchToProps = (dispatch) => ({
});
export function ScoreboardDayStats({ bodyshop, date, entries }) {
const {
lastNumberWorkingDays,
dailyPaintTarget,
dailyBodyTarget,
} = bodyshop.scoreboard_target;
const { dailyPaintTarget, dailyBodyTarget } = bodyshop.scoreboard_target;
let totalHrs = 0;
//let totalHrs = 0;
const paintHrs = entries.reduce((acc, value) => {
totalHrs = +value.painthrs;
// totalHrs = +value.painthrs;
return acc + value.painthrs;
}, 0);
const bodyHrs = entries.reduce((acc, value) => {
totalHrs = +value.bodyhrs;
//totalHrs = +value.bodyhrs;
return acc + value.bodyhrs;
}, 0);
return (
<div className="imex-flex-row__margin">
<div className='imex-flex-row__margin'>
<Card title={moment(date).format("D - ddd")}>
<Statistic
valueStyle={{ color: dailyBodyTarget > bodyHrs ? "red" : "green" }}