Updates to all card components.

This commit is contained in:
Patrick Fic
2020-01-09 15:27:40 -08:00
parent e3357910b9
commit dbe4f47539
46 changed files with 1135 additions and 112 deletions

View File

@@ -1,17 +1,42 @@
import React from "react";
import { useTranslation } from "react-i18next";
import CardTemplate from "./job-detail-cards.template.component";
import { Pie } from "react-chartjs-2";
export default function JobDetailCardsPartsComponent({ loading, data }) {
const { t } = useTranslation();
const p = {
labels: ["Not Ordered", "Ordered", "Received", "Backordered"],
datasets: [
{
data: [5, 15, 10, 2],
backgroundColor: [
"rgba(255, 99, 132, 0.2)",
"rgba(54, 162, 235, 0.2)",
"rgba(255, 206, 86, 0.2)",
"rgba(75, 192, 192, 0.2)",
"rgba(153, 102, 255, 0.2)",
"rgba(255, 159, 64, 0.2)"
],
borderColor: [
"rgba(255, 99, 132, 1)",
"rgba(54, 162, 235, 1)",
"rgba(255, 206, 86, 1)",
"rgba(75, 192, 192, 1)",
"rgba(153, 102, 255, 1)",
"rgba(255, 159, 64, 1)"
],
borderWidth: 1
}
]
};
return (
<CardTemplate loading={loading} title={t("jobs.labels.cards.parts")}>
{data ? (
<span>
Parts stuff here.
</span>
) : null}
</CardTemplate>
<div>
<CardTemplate loading={loading} title={t("jobs.labels.cards.parts")}>
{data ? <Pie data={p} /> : null}
</CardTemplate>
</div>
);
}