@@ -1,23 +1,23 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
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 } = context;
|
||||
export default function PrintCenterModalComponent({context}) {
|
||||
const {t} = useTranslation();
|
||||
const {type} = context;
|
||||
|
||||
let ModalContent;
|
||||
let ModalContent;
|
||||
|
||||
switch (type) {
|
||||
case "job":
|
||||
ModalContent = PrintCenterJobs;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
{ModalContent ? <ModalContent /> : t("printcenter.errors.nocontexttype")}
|
||||
</div>
|
||||
);
|
||||
switch (type) {
|
||||
case "job":
|
||||
ModalContent = PrintCenterJobs;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
{ModalContent ? <ModalContent/> : t("printcenter.errors.nocontexttype")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
import { Modal } from "antd";
|
||||
import {Modal} from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||
import { selectPrintCenter } from "../../redux/modals/modals.selectors";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {connect} from "react-redux";
|
||||
import {createStructuredSelector} from "reselect";
|
||||
import {toggleModalVisible} from "../../redux/modals/modals.actions";
|
||||
import {selectPrintCenter} from "../../redux/modals/modals.selectors";
|
||||
import PrintCenterModalComponent from "./print-center-modal.component";
|
||||
import "./print-center-modal.styles.scss";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
printCenterModal: selectPrintCenter,
|
||||
printCenterModal: selectPrintCenter,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
toggleModalVisible: () => dispatch(toggleModalVisible("printCenter")),
|
||||
toggleModalVisible: () => dispatch(toggleModalVisible("printCenter")),
|
||||
});
|
||||
|
||||
export function PrintCenterModalContainer({
|
||||
printCenterModal,
|
||||
toggleModalVisible,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
printCenterModal,
|
||||
toggleModalVisible,
|
||||
}) {
|
||||
const {t} = useTranslation();
|
||||
|
||||
const { open, context } = printCenterModal;
|
||||
//const { type } = context;
|
||||
// const { refetch } = actions;
|
||||
const {open, context} = printCenterModal;
|
||||
//const { type } = context;
|
||||
// const { refetch } = actions;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
onOk={() => toggleModalVisible()}
|
||||
onCancel={() => toggleModalVisible()}
|
||||
cancelButtonProps={{ style: { display: "none" } }}
|
||||
okText={t("general.actions.close")}
|
||||
width="90%"
|
||||
title={t("printcenter.labels.title")}
|
||||
destroyOnClose
|
||||
>
|
||||
<PrintCenterModalComponent context={context} />
|
||||
</Modal>
|
||||
);
|
||||
return (
|
||||
<Modal
|
||||
open={open}
|
||||
onOk={() => toggleModalVisible()}
|
||||
onCancel={() => toggleModalVisible()}
|
||||
cancelButtonProps={{style: {display: "none"}}}
|
||||
okText={t("general.actions.close")}
|
||||
width="90%"
|
||||
title={t("printcenter.labels.title")}
|
||||
destroyOnClose
|
||||
>
|
||||
<PrintCenterModalComponent context={context}/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(PrintCenterModalContainer);
|
||||
|
||||
Reference in New Issue
Block a user