mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-20 02:32:37 +01:00
quick changeee
This commit is contained in:
parent
474fb7ee0e
commit
86dac573c7
@ -75,6 +75,7 @@ export const CatalogLayoutColorGroupingView : FC<CatalogLayoutColorGroupViewProp
|
|||||||
{
|
{
|
||||||
const offers: IPurchasableOffer[] = [];
|
const offers: IPurchasableOffer[] = [];
|
||||||
const addedColorableItems = new Map<string, boolean>();
|
const addedColorableItems = new Map<string, boolean>();
|
||||||
|
const updatedColorableItems = new Map<string, number[]>();
|
||||||
|
|
||||||
page.offers.sort(sortByColorIndex);
|
page.offers.sort(sortByColorIndex);
|
||||||
|
|
||||||
@ -95,9 +96,9 @@ export const CatalogLayoutColorGroupingView : FC<CatalogLayoutColorGroupViewProp
|
|||||||
const name = furniData.className;
|
const name = furniData.className;
|
||||||
const colorIndex = furniData.colorIndex;
|
const colorIndex = furniData.colorIndex;
|
||||||
|
|
||||||
if(!colorableItems.has(name))
|
if(!updatedColorableItems.has(name))
|
||||||
{
|
{
|
||||||
colorableItems.set(name, []);
|
updatedColorableItems.set(name, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(furniData.colors)
|
if(furniData.colors)
|
||||||
@ -110,9 +111,9 @@ export const CatalogLayoutColorGroupingView : FC<CatalogLayoutColorGroupViewProp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(colorableItems.get(name).indexOf(selectedColor) === -1)
|
if(updatedColorableItems.get(name).indexOf(selectedColor) === -1)
|
||||||
{
|
{
|
||||||
colorableItems.get(name)[colorIndex] = selectedColor;
|
updatedColorableItems.get(name)[colorIndex] = selectedColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -125,8 +126,9 @@ export const CatalogLayoutColorGroupingView : FC<CatalogLayoutColorGroupViewProp
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
offers.sort(sortyByFurnitureClassName);
|
offers.sort(sortyByFurnitureClassName);
|
||||||
|
setColorableItems(updatedColorableItems);
|
||||||
return offers;
|
return offers;
|
||||||
}, [ colorableItems, page.offers ]);
|
}, [ page.offers ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Grid>
|
<Grid>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user