Fix badge only catalog items

This commit is contained in:
Bill 2022-08-03 21:44:00 -04:00
parent 72bc5562fd
commit 3298471651
2 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,6 @@
import { FC } from 'react';
import { Base, Column, Flex, Grid, Text } from '../../../../../common';
import { ProductTypeEnum } from '../../../../../api';
import { Column, Flex, Grid, Text } from '../../../../../common';
import { useCatalog } from '../../../../../hooks';
import { CatalogAddOnBadgeWidgetView } from '../widgets/CatalogAddOnBadgeWidgetView';
import { CatalogItemGridWidgetView } from '../widgets/CatalogItemGridWidgetView';
@ -28,11 +29,15 @@ export const CatalogLayoutDefaultView: FC<CatalogLayoutProps> = props =>
</> }
{ currentOffer &&
<>
<Base position="relative" overflow="hidden">
<CatalogViewProductWidgetView />
<CatalogLimitedItemWidgetView fullWidth position="absolute" className="top-1" />
<CatalogAddOnBadgeWidgetView position="absolute" className="bg-muted rounded bottom-1 end-1" />
</Base>
<Flex center overflow="hidden" style={ { height: 140 } }>
{ (currentOffer.product.productType !== ProductTypeEnum.BADGE) &&
<>
<CatalogViewProductWidgetView />
<CatalogLimitedItemWidgetView fullWidth position="absolute" className="top-1" />
<CatalogAddOnBadgeWidgetView className="bg-muted rounded bottom-1 end-1" />
</> }
{ (currentOffer.product.productType === ProductTypeEnum.BADGE) && <CatalogAddOnBadgeWidgetView className="scale-2" /> }
</Flex>
<Column grow gap={ 1 }>
<Text grow truncate>{ currentOffer.localizationName }</Text>
<Flex justifyContent="between">

View File

@ -17,6 +17,8 @@ export const CatalogViewProductWidgetView: FC<{}> = props =>
if(!product) return;
roomPreviewer.reset(false);
switch(product.productType)
{
case ProductTypeEnum.FLOOR: {
@ -49,15 +51,12 @@ export const CatalogViewProductWidgetView: FC<{}> = props =>
switch(product.furnitureData.specialType)
{
case FurniCategory.FLOOR:
roomPreviewer.reset(false);
roomPreviewer.updateObjectRoom(product.extraParam);
return;
case FurniCategory.WALL_PAPER:
roomPreviewer.reset(false);
roomPreviewer.updateObjectRoom(null, product.extraParam);
return;
case FurniCategory.LANDSCAPE: {
roomPreviewer.reset(false);
roomPreviewer.updateObjectRoom(null, null, product.extraParam);
const furniData = GetSessionDataManager().getWallItemDataByName('ads_twi_windw');