Added basic pages for template editing BOD-85
This commit is contained in:
@@ -2,16 +2,16 @@ import { BackTop, Layout } from "antd";
|
||||
import React, { lazy, Suspense, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import BreadCrumbs from "../../components/breadcrumbs/breadcrumbs.component";
|
||||
import ChatAffixContainer from "../../components/chat-affix/chat-affix.container";
|
||||
import ErrorBoundary from "../../components/error-boundary/error-boundary.component";
|
||||
import FcmNotification from "../../components/fcm-notification/fcm-notification.component";
|
||||
import FooterComponent from "../../components/footer/footer.component";
|
||||
//Component Imports
|
||||
import HeaderContainer from "../../components/header/header.container";
|
||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||
import "./manage.page.styles.scss";
|
||||
import BreadCrumbs from "../../components/breadcrumbs/breadcrumbs.component";
|
||||
import PrintCenterModalContainer from "../../components/print-center-modal/print-center-modal.container";
|
||||
import ChatAffixContainer from "../../components/chat-affix/chat-affix.container";
|
||||
import FcmNotification from "../../components/fcm-notification/fcm-notification.component";
|
||||
import "./manage.page.styles.scss";
|
||||
const ManageRootPage = lazy(() =>
|
||||
import("../manage-root/manage-root.page.container")
|
||||
);
|
||||
@@ -82,6 +82,9 @@ const ProductionListPage = lazy(() =>
|
||||
const ProductionBoardPage = lazy(() =>
|
||||
import("../production-board/production-board.container")
|
||||
);
|
||||
const ShopTemplates = lazy(() =>
|
||||
import("../shop-templates/shop-templates.container")
|
||||
);
|
||||
const { Header, Content, Footer } = Layout;
|
||||
|
||||
export default function Manage({ match }) {
|
||||
@@ -218,6 +221,11 @@ export default function Manage({ match }) {
|
||||
component={JobsAvailablePage}
|
||||
/>
|
||||
<Route exact path={`${match.path}/shop/`} component={ShopPage} />
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/shop/templates`}
|
||||
component={ShopTemplates}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path={`${match.path}/shop/vendors`}
|
||||
|
||||
41
client/src/pages/shop-templates/shop-templates.container.js
Normal file
41
client/src/pages/shop-templates/shop-templates.container.js
Normal file
@@ -0,0 +1,41 @@
|
||||
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 ShopTemplatesListContainer from "../../components/shop-templates-list/shop-templates-list.container";
|
||||
import ShopTemplateEditor from "../../components/shop-template-editor/shop-template-editor.container";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||
});
|
||||
|
||||
export function ShopTemplatesContainer({ setBreadcrumbs, bodyshop }) {
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
document.title = t("titles.shop-templates");
|
||||
setBreadcrumbs([
|
||||
{
|
||||
link: "/manage/shop",
|
||||
label: t("titles.bc.shop", { shopname: bodyshop.shopname }),
|
||||
},
|
||||
{ link: "/manage/shop/templates", label: t("titles.bc.shop-templates") },
|
||||
]);
|
||||
}, [t, setBreadcrumbs, bodyshop.shopname]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ShopTemplatesListContainer />
|
||||
<ShopTemplateEditor />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ShopTemplatesContainer);
|
||||
Reference in New Issue
Block a user