diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 0c20accd..6e6aa7aa 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -15,6 +15,10 @@ min-height: 28px; } +textarea { + resize: none; +} + /* Chrome, Safari, Edge, Opera */ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { diff --git a/src/layout/card/grid/item/NitroCardGridItemView.tsx b/src/layout/card/grid/item/NitroCardGridItemView.tsx index 3713b490..47c39438 100644 --- a/src/layout/card/grid/item/NitroCardGridItemView.tsx +++ b/src/layout/card/grid/item/NitroCardGridItemView.tsx @@ -4,7 +4,7 @@ import { NitroCardGridItemViewProps } from './NitroCardGridItemView.types'; export const NitroCardGridItemView: FC = props => { - const { itemImage = undefined, itemColor = undefined, itemActive = false, itemCount = 1, itemUniqueNumber = 0, itemUnseen = false, className = '', style = {}, children = null, ...rest } = props; + const { itemImage = undefined, itemColor = undefined, itemActive = false, itemCount = 1, itemUniqueNumber = -2, itemUnseen = false, className = '', style = {}, children = null, ...rest } = props; const getClassName = useMemo(() => { @@ -12,6 +12,8 @@ export const NitroCardGridItemView: FC = props => if(itemActive) newClassName += ' active'; + if(itemUniqueNumber === -1) newClassName += ' unique-item sold-out'; + if(itemUniqueNumber > 0) newClassName += ' unique-item'; if(itemUnseen) newClassName += ' unseen'; diff --git a/src/views/catalog/common/GetProuductIconUrl.ts b/src/views/catalog/common/GetProuductIconUrl.ts new file mode 100644 index 00000000..c775dd37 --- /dev/null +++ b/src/views/catalog/common/GetProuductIconUrl.ts @@ -0,0 +1,47 @@ +import { FurnitureType } from '@nitrots/nitro-renderer'; +import { GetConfiguration, GetRoomEngine, GetSessionDataManager } from '../../../api'; + +export const GetProductIconUrl = (furniClassId: number, productType: string, customParams: string = null) => +{ + switch(productType.toUpperCase()) + { + case FurnitureType.BADGE: + return GetSessionDataManager().getBadgeUrl(customParams); + case FurnitureType.ROBOT: + return undefined; + case FurnitureType.FLOOR: + return GetRoomEngine().getFurnitureFloorIconUrl(furniClassId); + case FurnitureType.WALL: { + const furniData = GetSessionDataManager().getWallItemData(furniClassId); + + let iconName = ''; + + if(furniData) + { + switch(furniData.className) + { + case 'floor': + iconName = [ 'th', furniData.className, customParams ].join('_'); + break; + case 'wallpaper': + iconName = [ 'th', 'wall', customParams ].join('_'); + break; + case 'landscape': + iconName = [ 'th', furniData.className, customParams.replace('.', '_'), '001' ].join('_'); + break; + } + + if(iconName !== '') + { + const assetUrl = GetConfiguration('catalog.asset.url'); + + return `${ assetUrl }/${ iconName }.png`; + } + } + + return GetRoomEngine().getFurnitureWallIconUrl(furniClassId, customParams); + } + } + + return null; +} diff --git a/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx b/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx new file mode 100644 index 00000000..c5269380 --- /dev/null +++ b/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx @@ -0,0 +1,19 @@ +import { FC } from 'react'; +import { GetCatalogPageImage, GetCatalogPageText } from '../../common/CatalogUtilities'; +import { CatalogPageDetailsViewProps } from './CatalogPageDetailsView.types'; + +export const CatalogPageDetailsView: FC = props => +{ + const { pageParser = null } = props; + + if(!pageParser) return null; + + const imageUrl = GetCatalogPageImage(pageParser, 1); + + return ( +
+ { imageUrl && } +
+
+ ); +} diff --git a/src/views/catalog/views/page-details/CatalogPageDetailsView.types.ts b/src/views/catalog/views/page-details/CatalogPageDetailsView.types.ts new file mode 100644 index 00000000..a02c3b6c --- /dev/null +++ b/src/views/catalog/views/page-details/CatalogPageDetailsView.types.ts @@ -0,0 +1,6 @@ +import { CatalogPageMessageParser } from '@nitrots/nitro-renderer'; + +export interface CatalogPageDetailsViewProps +{ + pageParser: CatalogPageMessageParser; +} diff --git a/src/views/catalog/views/page/CatalogPageView.scss b/src/views/catalog/views/page/CatalogPageView.scss index 7a00d29e..2281883f 100644 --- a/src/views/catalog/views/page/CatalogPageView.scss +++ b/src/views/catalog/views/page/CatalogPageView.scss @@ -1,6 +1,5 @@ @import './layout/CatalogLayout'; @import './offer/CatalogPageOfferView'; @import './offers/CatalogPageOffersView'; -@import './product/CatalogProductView'; @import './purchase/CatalogPurchaseView'; @import './search-result/CatalogLayoutSearchResultView'; diff --git a/src/views/catalog/views/page/layout/CatalogLayout.scss b/src/views/catalog/views/page/layout/CatalogLayout.scss index ff111f8a..addcc8e6 100644 --- a/src/views/catalog/views/page/layout/CatalogLayout.scss +++ b/src/views/catalog/views/page/layout/CatalogLayout.scss @@ -1,10 +1,5 @@ -@import './badge-display/CatalogLayoutBadgeDisplayView'; @import './default/CatalogLayoutDefaultView'; @import './frontpage4/CatalogLayoutFrontpage4View'; @import './pets/CatalogLayoutPetView'; -@import './pets3/CatalogLayoutPets3View'; -@import './single-bundle/CatalogLayoutSingleBundleView'; -@import './spaces-new/CatalogLayoutSpacesView'; -@import './trophies/CatalogLayoutTrophiesView'; @import './vip-buy/CatalogLayoutVipBuyView'; @import './info-loyalty/CatalogLayoutInfoLoyaltyView.scss'; diff --git a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.scss b/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.scss deleted file mode 100644 index 1229e018..00000000 --- a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.scss +++ /dev/null @@ -1,7 +0,0 @@ -.nitro-catalog-layout-badge-display { - - .inventory-badge-grid { - height: 200px; - max-height: 200px; - } -} diff --git a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx b/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx index 4cb90755..1826c10a 100644 --- a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx +++ b/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx @@ -1,5 +1,5 @@ import { StringDataType } from '@nitrots/nitro-renderer'; -import { FC, useCallback, useEffect, useMemo, useState } from 'react'; +import { FC, useCallback, useEffect, useState } from 'react'; import { LocalizeText } from '../../../../../../api'; import { InventoryBadgesUpdatedEvent, SetRoomPreviewerStuffDataEvent } from '../../../../../../events'; import { InventoryBadgesRequestEvent } from '../../../../../../events/inventory/InventoryBadgesRequestEvent'; @@ -7,11 +7,9 @@ import { dispatchUiEvent, useUiEvent } from '../../../../../../hooks'; import { NitroCardGridItemView } from '../../../../../../layout/card/grid/item/NitroCardGridItemView'; import { NitroCardGridView } from '../../../../../../layout/card/grid/NitroCardGridView'; import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; -import { GetOfferName } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutBadgeDisplayViewProps } from './CatalogLayoutBadgeDisplayView.types'; export const CatalogLayoutBadgeDisplayView: FC = props => @@ -32,18 +30,6 @@ export const CatalogLayoutBadgeDisplayView: FC - { - return badges.map(code => - { - return ( - setCurrentBadge(code) }> - - - ); - }); - }, [ badges, currentBadge ]); - useEffect(() => { dispatchUiEvent(new InventoryBadgesRequestEvent(InventoryBadgesRequestEvent.REQUEST_BADGES)); @@ -67,22 +53,26 @@ export const CatalogLayoutBadgeDisplayView: FC -
- -
+
+
+ +
{ LocalizeText('catalog_selectbadge') }
- - { badgeElements } + + { badges && (badges.length > 0) && badges.map(code => + { + return ( + setCurrentBadge(code) }> + + + ); + }) }
- { product && -
- -
{ GetOfferName(activeOffer) }
- -
} +
+ +
); } diff --git a/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx b/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx index db599364..415ac9fa 100644 --- a/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx +++ b/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx @@ -1,10 +1,7 @@ import { FC } from 'react'; -import { LimitedEditionCompletePlateView } from '../../../../../shared/limited-edition/complete-plate/LimitedEditionCompletePlateView'; -import { GetCatalogPageImage, GetCatalogPageText, GetOfferName } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutDefaultViewProps } from './CatalogLayoutDefaultView.types'; export const CatalogLayoutDefaultView: FC = props => @@ -17,24 +14,12 @@ export const CatalogLayoutDefaultView: FC = props return (
-
+
- { !product && -
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
-
} - { product && -
- - { product.uniqueLimitedItem && - } -
{ GetOfferName(activeOffer) }
- -
} +
+ +
); } diff --git a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx b/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx index f70afb5d..edf293c2 100644 --- a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx +++ b/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx @@ -2,11 +2,13 @@ import { ColorConverter, GetSellablePetPalettesComposer, SellablePetPaletteData import { FC, useEffect, useMemo, useState } from 'react'; import { GetProductDataForLocalization, LocalizeText } from '../../../../../../api'; import { SendMessageHook } from '../../../../../../hooks/messages/message-event'; +import { NitroCardGridItemView, NitroCardGridView } from '../../../../../../layout'; import { PetImageView } from '../../../../../shared/pet-image/PetImageView'; -import { GetCatalogPageImage, GetCatalogPageText, GetPetAvailableColors, GetPetIndexFromLocalization } from '../../../../common/CatalogUtilities'; +import { GetPetAvailableColors, GetPetIndexFromLocalization } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogActions } from '../../../../reducers/CatalogReducer'; import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; +import { CatalogPageDetailsView } from '../../../page-details/CatalogPageDetailsView'; import { CatalogLayoutPetViewProps } from './CatalogLayoutPetView.types'; import { CatalogLayoutPetPurchaseView } from './purchase/CatalogLayoutPetPurchaseView'; @@ -139,44 +141,40 @@ export const CatalogLayoutPetView: FC = props => if(!activeOffer) return null; return ( -
-
-
- { colorsShowing && (sellableColors.length > 0) && sellableColors.map((colorSet, index) => - { - return
-
setSelectedColorIndex(index) }> -
-
; - })} +
+
+ { !colorsShowing && (sellablePalettes.length > 0) && sellablePalettes.map((palette, index) => { - return
-
setSelectedPaletteIndex(index) }> + return ( + setSelectedPaletteIndex(index) }> -
-
; - }) } -
+ + ); + })} + { colorsShowing && (sellableColors.length > 0) && sellableColors.map((colorSet, index) => + { + return ( + setSelectedColorIndex(index) } /> + ); + })} + +
+
+ { (petIndex === -1) && + } + { (petIndex >= 0) && + <> + + { (petIndex > -1 && petIndex <= 7) && + } + +
{ petBreedName }
+ + }
- { (petIndex === -1) && -
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
-
} - { (petIndex >= 0) && -
- - { (petIndex > -1 && petIndex <= 7) && - } - -
{ petBreedName }
- -
}
); } diff --git a/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx b/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx index 9f1ebb31..c7b02518 100644 --- a/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx +++ b/src/views/catalog/views/page/layout/pets/purchase/CatalogLayoutPetPurchaseView.tsx @@ -6,6 +6,7 @@ import { useUiEvent } from '../../../../../../../hooks/events/ui/ui-event'; import { SendMessageHook } from '../../../../../../../hooks/messages/message-event'; import { CurrencyIcon } from '../../../../../../shared/currency-icon/CurrencyIcon'; import { CatalogPurchaseButtonView } from '../../../purchase/purchase-button/CatalogPurchaseButtonView'; +import { CatalogPurchaseGiftButtonView } from '../../../purchase/purchase-gift-button/CatalogPurchaseGiftButtonView'; import { CatalogPetNameApprovalView } from '../name-approval/CatalogPetNameApprovalView'; import { CatalogLayoutPetPurchaseViewProps } from './CatalogLayoutPetPurchaseView.types'; @@ -59,6 +60,8 @@ export const CatalogLayoutPetPurchaseView: FC
+ { offer.giftable && + }
diff --git a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.scss b/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.scss deleted file mode 100644 index 1b85077d..00000000 --- a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.scss +++ /dev/null @@ -1,2 +0,0 @@ -.nitro-catalog-layout-pets2 { -} diff --git a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx b/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx index 3e901711..06dd970c 100644 --- a/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx +++ b/src/views/catalog/views/page/layout/pets2/CatalogLayoutPets2View.tsx @@ -1,23 +1,8 @@ import { FC } from 'react'; -import { GetCatalogPageImage, GetCatalogPageText } from '../../../../common/CatalogUtilities'; +import { CatalogLayoutPets3View } from '../pets3/CatalogLayoutPets3View'; import { CatalogLayoutPets2ViewProps } from './CatalogLayoutPets2View.types'; export const CatalogLayoutPets2View: FC = props => { - const { pageParser = null } = props; - - return ( -
-
-
-
- -
-
{ GetCatalogPageText(pageParser, 1) }
-
-
- {GetCatalogPageText(pageParser, 3) &&
} -
-
- ); + return } diff --git a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.scss b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.scss deleted file mode 100644 index 2f2bc31c..00000000 --- a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.scss +++ /dev/null @@ -1,2 +0,0 @@ -.nitro-catalog-layout-pets3 { -} diff --git a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx index 23fa4048..94ab0a81 100644 --- a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx +++ b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx @@ -5,18 +5,24 @@ import { CatalogLayoutPets3ViewProps } from './CatalogLayoutPets3View.types'; export const CatalogLayoutPets3View: FC = props => { const { pageParser = null } = props; + + const imageUrl = GetCatalogPageImage(pageParser, 1); return ( -
-
-
-
- +
+
+
+
+ { imageUrl && } +
+
+
+
+
+
+
-
{ GetCatalogPageText(pageParser, 1) }
-
- {GetCatalogPageText(pageParser, 3) &&
}
); diff --git a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.scss b/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.scss deleted file mode 100644 index 664041a9..00000000 --- a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.scss +++ /dev/null @@ -1,6 +0,0 @@ -.nitro-catalog-layout-single-bundle { - - .single-bundle-items-container { - - } -} diff --git a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx b/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx index c85baeae..bab6711f 100644 --- a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx +++ b/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx @@ -1,6 +1,7 @@ import { FC } from 'react'; -import { GetCatalogPageImage, GetCatalogPageText } from '../../../../common/CatalogUtilities'; +import { NitroCardGridView } from '../../../../../../layout'; import { useCatalogContext } from '../../../../context/CatalogContext'; +import { CatalogPageDetailsView } from '../../../page-details/CatalogPageDetailsView'; import { CatalogProductView } from '../../product/CatalogProductView'; import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; import { CatalogLayoutSingleBundleViewProps } from './CatalogLayoutSingleBundleView.types'; @@ -12,20 +13,17 @@ export const CatalogLayoutSingleBundleView: FC -
-
+
+
+ { activeOffer && activeOffer.products && (activeOffer.products.length > 0) && activeOffer.products.map((product, index) => { return }) } -
+
-
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
+
+ { activeOffer && }
diff --git a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.scss b/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.scss deleted file mode 100644 index ce1e1c03..00000000 --- a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.scss +++ /dev/null @@ -1,3 +0,0 @@ -.nitro-catalog-layout-spaces { - -} diff --git a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx b/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx index c2c15a26..65da4622 100644 --- a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx +++ b/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx @@ -1,12 +1,10 @@ import { CatalogPageMessageOfferData, IFurnitureData } from '@nitrots/nitro-renderer'; import { FC, useEffect, useState } from 'react'; import { GetSessionDataManager, LocalizeText } from '../../../../../../api'; -import { GetCatalogPageImage, GetCatalogPageText, GetOfferName } from '../../../../common/CatalogUtilities'; import { ProductTypeEnum } from '../../../../common/ProductTypeEnum'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutSpacesViewProps } from './CatalogLayoutSpacesView.types'; export const CatalogLayoutSpacesView: FC = props => @@ -68,9 +66,9 @@ export const CatalogLayoutSpacesView: FC = props = const product = ((activeOffer && activeOffer.products[0]) || null); return ( -
-
-
+
+
+
{ groupNames.map((name, index) => { return @@ -78,19 +76,9 @@ export const CatalogLayoutSpacesView: FC = props =
- { !product && -
-
- -
-
{ GetCatalogPageText(pageParser, 0) }
-
} - { product && -
- -
{ GetOfferName(activeOffer) }
- -
} +
+ +
); } diff --git a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.scss b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.scss deleted file mode 100644 index 58637ed9..00000000 --- a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.scss +++ /dev/null @@ -1,8 +0,0 @@ -.nitro-catalog-layout-trophies { - - textarea { - height: 119px; - resize: none; - } - -} diff --git a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx index 471001a1..03379cf0 100644 --- a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx +++ b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx @@ -1,9 +1,7 @@ import { FC, useState } from 'react'; -import { GetOfferName } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutTrophiesViewProps } from './CatalogLayoutTrophiesView.types'; export const CatalogLayoutTrophiesView: FC = props => @@ -16,19 +14,14 @@ export const CatalogLayoutTrophiesView: FC = pro const product = ((activeOffer && activeOffer.products[0]) || null); return ( -
-
+
+
-
- -
+