Rearranged shop template page to better handle previews & template editor BOD-126

This commit is contained in:
Patrick Fic
2020-09-04 15:03:01 -07:00
parent 051be83303
commit af8e39da75
8 changed files with 129 additions and 88 deletions

View File

@@ -1,5 +1,5 @@
import { Col, Row } from "antd";
import React, { useEffect } from "react";
import { Button } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -18,6 +18,7 @@ const mapDispatchToProps = (dispatch) => ({
export function ShopTemplatesContainer({ setBreadcrumbs, bodyshop }) {
const { t } = useTranslation();
const drawerVisibility = useState(false);
useEffect(() => {
document.title = t("titles.shop-templates");
setBreadcrumbs([
@@ -31,16 +32,11 @@ export function ShopTemplatesContainer({ setBreadcrumbs, bodyshop }) {
return (
<RbacWrapper action="shop:templates">
<Row>
<Col span={4}>
<ShopTemplatesListContainer />
</Col>
<Col span={20}>
<div>
<ShopTemplateEditor />
</div>
</Col>
</Row>
<div>
<ShopTemplatesListContainer visibleState={drawerVisibility} />
<Button onClick={() => drawerVisibility[1](true)}>Show List</Button>
<ShopTemplateEditor />
</div>
</RbacWrapper>
);
}