BOD-34 Added jobs items and conditional rendering for print center.

This commit is contained in:
Patrick Fic
2020-04-28 10:42:47 -07:00
parent b47767e86c
commit 113bf3f0fb
13 changed files with 297 additions and 28 deletions

View File

@@ -1,8 +1,23 @@
import React from "react";
import { useTranslation } from "react-i18next";
import PrintCenterJobs from "../print-center-jobs/print-center-jobs.component";
export default function PrintCenterModalComponent({ context }) {
const { t } = useTranslation();
const { type, id } = context;
return <div>{`${type} - ${id}`}</div>;
const { type } = context;
let ModalContent;
switch (type) {
case "job":
ModalContent = PrintCenterJobs;
break;
default:
break;
}
return (
<div>
{ModalContent ? <ModalContent /> : t("printcenter.errors.nocontexttype")}
</div>
);
}

View File

@@ -32,8 +32,8 @@ export function PrintCenterModalContainer({
}) {
const { t } = useTranslation();
const { visible, context, actions } = printCenterModal;
// const { jobId, linesToOrder } = context;
const { visible, context } = printCenterModal;
const { type, id } = context;
// const { refetch } = actions;
return (
@@ -41,7 +41,7 @@ export function PrintCenterModalContainer({
visible={visible}
onCancel={() => toggleModalVisible()}
width='90%'
title={t("printcenter.labels.title")}
title={` ${t("printcenter.labels.title")} ${type} - ${id}`}
destroyOnClose>
<PrintCenterModalComponent context={context} />
</Modal>