Simplified profile page BOD-323

This commit is contained in:
Patrick Fic
2020-08-27 11:27:56 -07:00
parent 5c643515c0
commit 3150fdaade
13 changed files with 121 additions and 94 deletions

View File

@@ -1,10 +1,10 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { Table, Button } from "antd";
import { Table, Button, Typography } from "antd";
export default function ProfileShopsComponent({
loading,
data,
updateActiveShop
updateActiveShop,
}) {
const { t } = useTranslation();
@@ -14,14 +14,14 @@ export default function ProfileShopsComponent({
dataIndex: "shopname",
key: "shopname",
width: "25%",
render: (text, record) => <span>{record.bodyshop.shopname}</span>
render: (text, record) => <span>{record.bodyshop.shopname}</span>,
},
{
title: t("associations.fields.active"),
dataIndex: "active",
key: "active",
width: "25%",
render: (text, record) => <span>{record.active ? "Yes" : "No"}</span>
render: (text, record) => <span>{record.active ? "Yes" : "No"}</span>,
},
{
title: t("associations.labels.actions"),
@@ -36,15 +36,20 @@ export default function ProfileShopsComponent({
</Button>
)}
</span>
)
}
),
},
];
return (
<Table
title={() => (
<Typography.Title level={4}>
{t("profile.labels.activeshop")}
</Typography.Title>
)}
loading={loading}
size="small"
columns={columns.map(item => ({ ...item }))}
columns={columns.map((item) => ({ ...item }))}
rowKey="id"
dataSource={data}
/>