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

View File

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