Added basic pages for template editing BOD-85
This commit is contained in:
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