Added scoreboard initial design BOD-91
This commit is contained in:
@@ -113,6 +113,10 @@ const PaymentsAll = lazy(() =>
|
||||
import("../payments-all/payments-all.container.page")
|
||||
);
|
||||
|
||||
const Scoreboard = lazy(() =>
|
||||
import("../scoreboard/scoreboard.page.container.jsx")
|
||||
);
|
||||
|
||||
const { Content } = Layout;
|
||||
|
||||
const stripePromise = new Promise((resolve, reject) => {
|
||||
@@ -305,6 +309,11 @@ export function Manage({ match, conflict }) {
|
||||
path={`${match.path}/payments`}
|
||||
component={PaymentsAll}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/scoreboard`}
|
||||
component={Scoreboard}
|
||||
/>
|
||||
</Suspense>
|
||||
)}
|
||||
</ErrorBoundary>
|
||||
|
||||
10
client/src/pages/scoreboard/scoreboard.page.component.jsx
Normal file
10
client/src/pages/scoreboard/scoreboard.page.component.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import React from "react";
|
||||
import ScoreboardDisplay from "../../components/scoreboard-display/scoreboard-display.component";
|
||||
|
||||
export default function ProductionBoardComponent({ scoreboardSubscription }) {
|
||||
return (
|
||||
<div>
|
||||
<ScoreboardDisplay scoreboardSubscription={scoreboardSubscription} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
47
client/src/pages/scoreboard/scoreboard.page.container.jsx
Normal file
47
client/src/pages/scoreboard/scoreboard.page.container.jsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import React, { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { setBreadcrumbs } from "../../redux/application/application.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import ScoreboardPageComponent from "./scoreboard.page.component";
|
||||
import { useSubscription } from "@apollo/react-hooks";
|
||||
import { SUBSCRIPTION_SCOREBOARD } from "../../graphql/scoreboard.queries";
|
||||
import moment from "moment";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||
});
|
||||
|
||||
export function ScoreboardContainer({ setBreadcrumbs }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const scoreboardSubscription = useSubscription(SUBSCRIPTION_SCOREBOARD, {
|
||||
variables: {
|
||||
start: moment().startOf("month"),
|
||||
end: moment().endOf("month"),
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("titles.scoreboard");
|
||||
setBreadcrumbs([
|
||||
{
|
||||
link: "/manage/scoreboard",
|
||||
label: t("titles.bc.scoreboard"),
|
||||
},
|
||||
]);
|
||||
}, [t, setBreadcrumbs]);
|
||||
|
||||
return (
|
||||
<ScoreboardPageComponent scoreboardSubscription={scoreboardSubscription} />
|
||||
);
|
||||
}
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ScoreboardContainer);
|
||||
Reference in New Issue
Block a user