wip
This commit is contained in:
parent
ce77c9df10
commit
0faf70aea6
2 changed files with 8 additions and 11 deletions
|
@ -118,6 +118,7 @@ export const ProductList: React.FC<ProductListProps> = props => {
|
||||||
pageInfo,
|
pageInfo,
|
||||||
products,
|
products,
|
||||||
selected,
|
selected,
|
||||||
|
loading,
|
||||||
sort,
|
sort,
|
||||||
toggle,
|
toggle,
|
||||||
toggleAll,
|
toggleAll,
|
||||||
|
@ -137,11 +138,11 @@ export const ProductList: React.FC<ProductListProps> = props => {
|
||||||
);
|
);
|
||||||
const numberOfColumns = 2 + settings.columns.length;
|
const numberOfColumns = 2 + settings.columns.length;
|
||||||
|
|
||||||
const getProductPrice = (
|
const getProductPrice = product => {
|
||||||
priceRangeUndiscounted: ProductList_products_edges_node_pricing_priceRangeUndiscounted
|
const priceRangeUndiscounted = product?.pricing?.priceRangeUndiscounted;
|
||||||
) => {
|
|
||||||
if (!priceRangeUndiscounted) {
|
if (!priceRangeUndiscounted) {
|
||||||
return null;
|
return "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
const { start, stop } = priceRangeUndiscounted;
|
const { start, stop } = priceRangeUndiscounted;
|
||||||
|
@ -182,6 +183,7 @@ export const ProductList: React.FC<ProductListProps> = props => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(123, { loading });
|
||||||
return (
|
return (
|
||||||
<div className={classes.tableContainer}>
|
<div className={classes.tableContainer}>
|
||||||
<ResponsiveTable className={classes.table}>
|
<ResponsiveTable className={classes.table}>
|
||||||
|
@ -445,13 +447,7 @@ export const ProductList: React.FC<ProductListProps> = props => {
|
||||||
displayColumns={settings.columns}
|
displayColumns={settings.columns}
|
||||||
>
|
>
|
||||||
<TableCell className={classes.colPrice}>
|
<TableCell className={classes.colPrice}>
|
||||||
{product?.pricing?.priceRangeUndiscounted ? (
|
{loading ? <Skeleton /> : getProductPrice(product)}
|
||||||
getProductPrice(
|
|
||||||
product?.pricing?.priceRangeUndiscounted
|
|
||||||
)
|
|
||||||
) : (
|
|
||||||
<Skeleton />
|
|
||||||
)}
|
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</DisplayColumn>
|
</DisplayColumn>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
|
@ -185,6 +185,7 @@ export const ProductListPage: React.FC<ProductListPageProps> = props => {
|
||||||
/>
|
/>
|
||||||
<ProductList
|
<ProductList
|
||||||
{...listProps}
|
{...listProps}
|
||||||
|
loading={loading}
|
||||||
gridAttributes={gridAttributes}
|
gridAttributes={gridAttributes}
|
||||||
settings={settings}
|
settings={settings}
|
||||||
onUpdateListSettings={onUpdateListSettings}
|
onUpdateListSettings={onUpdateListSettings}
|
||||||
|
|
Loading…
Reference in a new issue