From eadb3d5d1e62aba925564525fa39876c6f7a7bd8 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 29 Sep 2021 22:31:31 -0400 Subject: [PATCH] Update catalog --- src/views/catalog/CatalogView.tsx | 16 +-- .../navigation/CatalogNavigationView.scss | 2 +- .../navigation/CatalogNavigationView.tsx | 20 ++- .../page-details/CatalogPageDetailsView.tsx | 5 +- .../CatalogLayoutBadgeDisplayView.tsx | 20 +-- .../default/CatalogLayoutDefaultView.tsx | 13 +- .../CatalogLayoutFrontpage4View.scss | 34 +++--- .../CatalogLayoutFrontpage4View.tsx | 30 ++--- .../item/CatalogLayoutFrontPageItemView.tsx | 35 ++++++ .../CatalogLayoutFrontPageItemView.types.ts | 7 ++ .../CatalogLayoutGuildCustomFurniView.tsx | 65 ++++------ .../CatalogLayoutGuildForumView.tsx | 49 +++----- .../CatalogLayoutGuildFrontpageView.tsx | 27 +++-- .../page/layout/pets/CatalogLayoutPetView.tsx | 34 +++--- .../layout/pets3/CatalogLayoutPets3View.tsx | 32 ++--- .../CatalogLayoutSingleBundleView.tsx | 14 +-- .../spaces-new/CatalogLayoutSpacesView.tsx | 17 +-- .../trophies/CatalogLayoutTrophiesView.tsx | 13 +- .../vip-buy/CatalogLayoutVipBuyView.tsx | 114 +++++++++--------- .../CatalogProductPreviewView.tsx | 25 ++-- .../CatalogProductPreviewView.types.ts | 2 + .../CatalogRedeemVoucherView.tsx | 2 +- .../select-group/CatalogSelectGroupView.tsx | 40 ++++++ .../CatalogSelectGroupView.types.ts | 7 ++ 24 files changed, 341 insertions(+), 282 deletions(-) create mode 100644 src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.tsx create mode 100644 src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.types.ts create mode 100644 src/views/catalog/views/select-group/CatalogSelectGroupView.tsx create mode 100644 src/views/catalog/views/select-group/CatalogSelectGroupView.types.ts diff --git a/src/views/catalog/CatalogView.tsx b/src/views/catalog/CatalogView.tsx index ec06d572..403166bf 100644 --- a/src/views/catalog/CatalogView.tsx +++ b/src/views/catalog/CatalogView.tsx @@ -4,7 +4,7 @@ import { AddEventLinkTracker, GetRoomEngine, LocalizeText, RemoveLinkEventTracke import { CatalogEvent } from '../../events'; import { useUiEvent } from '../../hooks/events/ui/ui-event'; import { SendMessageHook } from '../../hooks/messages/message-event'; -import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../layout'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView, NitroLayoutGrid, NitroLayoutGridColumn } from '../../layout'; import { CatalogMessageHandler } from './CatalogMessageHandler'; import { CatalogMode, CatalogViewProps } from './CatalogView.types'; import { BuildCatalogPageTree } from './common/CatalogUtilities'; @@ -184,7 +184,7 @@ export const CatalogView: FC = props => }, []); const currentNavigationPage = ((searchResult && searchResult.page) || currentTab); - const navigationHidden = (pageParser && pageParser.frontPageItems.length); + const navigationHidden = !!(pageParser && pageParser.frontPageItems.length); return ( @@ -203,15 +203,15 @@ export const CatalogView: FC = props => }) } -
+ { currentNavigationPage && !navigationHidden && -
+ -
} -
+ } + -
-
+ +
} diff --git a/src/views/catalog/views/navigation/CatalogNavigationView.scss b/src/views/catalog/views/navigation/CatalogNavigationView.scss index cd6cc820..d76fdbf9 100644 --- a/src/views/catalog/views/navigation/CatalogNavigationView.scss +++ b/src/views/catalog/views/navigation/CatalogNavigationView.scss @@ -1,4 +1,4 @@ -.nitro-catalog-navigation-grid { +.nitro-catalog-navigation-grid-container { border-radius: 0.25rem; border-color: #B6BEC5 !important; background-color: #CDD3D9; diff --git a/src/views/catalog/views/navigation/CatalogNavigationView.tsx b/src/views/catalog/views/navigation/CatalogNavigationView.tsx index cb8efe9c..b7bf41ed 100644 --- a/src/views/catalog/views/navigation/CatalogNavigationView.tsx +++ b/src/views/catalog/views/navigation/CatalogNavigationView.tsx @@ -1,6 +1,6 @@ import { INodeData } from '@nitrots/nitro-renderer'; import { FC, useEffect } from 'react'; -import { NitroCardGridView } from '../../../../layout'; +import { NitroCardGridView, NitroLayoutFlexColumn } from '../../../../layout'; import { CatalogSearchView } from '../search/CatalogSearchView'; import { CatalogNavigationViewProps } from './CatalogNavigationView.types'; import { CatalogNavigationSetView } from './set/CatalogNavigationSetView'; @@ -24,15 +24,13 @@ export const CatalogNavigationView: FC = props => }, [ page ]); return ( -
-
- -
- - - -
-
-
+ + + + + + + + ); } diff --git a/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx b/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx index 390aed62..d5a8ad6c 100644 --- a/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx +++ b/src/views/catalog/views/page-details/CatalogPageDetailsView.tsx @@ -1,4 +1,5 @@ import { FC } from 'react'; +import { NitroLayoutFlexColumn } from '../../../../layout'; import { GetCatalogPageImage, GetCatalogPageText } from '../../common/CatalogUtilities'; import { CatalogPageDetailsViewProps } from './CatalogPageDetailsView.types'; @@ -11,9 +12,9 @@ export const CatalogPageDetailsView: FC = props => const imageUrl = GetCatalogPageImage(pageParser, 1); return ( -
+ { imageUrl && }
-
+
); } 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 1826c10a..38156bd6 100644 --- a/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx +++ b/src/views/catalog/views/page/layout/badge-display/CatalogLayoutBadgeDisplayView.tsx @@ -4,6 +4,8 @@ import { LocalizeText } from '../../../../../../api'; import { InventoryBadgesUpdatedEvent, SetRoomPreviewerStuffDataEvent } from '../../../../../../events'; import { InventoryBadgesRequestEvent } from '../../../../../../events/inventory/InventoryBadgesRequestEvent'; import { dispatchUiEvent, useUiEvent } from '../../../../../../hooks'; +import { NitroLayoutFlexColumn, NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; +import { NitroLayoutBase } from '../../../../../../layout/base'; import { NitroCardGridItemView } from '../../../../../../layout/card/grid/item/NitroCardGridItemView'; import { NitroCardGridView } from '../../../../../../layout/card/grid/NitroCardGridView'; import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; @@ -53,11 +55,11 @@ export const CatalogLayoutBadgeDisplayView: FC -
+ + -
-
{ LocalizeText('catalog_selectbadge') }
+ + { LocalizeText('catalog_selectbadge') } { badges && (badges.length > 0) && badges.map(code => { @@ -68,11 +70,11 @@ export const CatalogLayoutBadgeDisplayView: FC -
-
-
+ + + -
-
+ + ); } diff --git a/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx b/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx index 86d2bd1b..1ec8d867 100644 --- a/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx +++ b/src/views/catalog/views/page/layout/default/CatalogLayoutDefaultView.tsx @@ -1,4 +1,5 @@ import { FC } from 'react'; +import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; @@ -13,13 +14,13 @@ export const CatalogLayoutDefaultView: FC = props const product = ((activeOffer && activeOffer.products[0]) || null); return ( -
-
+ + -
-
+ + -
-
+ + ); } diff --git a/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.scss b/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.scss index a08568d7..4d79a2c7 100644 --- a/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.scss +++ b/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.scss @@ -1,23 +1,17 @@ -.nitro-catalog-layout-frontpage4 { - max-height:600px; +.nitro-front-page-item { + background-position: center; + background-repeat: no-repeat; + cursor: pointer; - .front-page-item { - position: relative; - border-radius: $border-radius; - background-position: center; - background-repeat: no-repeat; - cursor: pointer; - - .front-page-item-caption { - position: absolute; - background: rgba(0, 0, 0, .5); - color: #fff; - font-size: 16px; - border-radius: 5px; - margin: 10px; - padding: 5px 15px; - bottom: 0; - text-shadow: 2px 2px rgba(0, 0, 0, .2); - } + .front-page-item-caption { + position: absolute; + background: rgba(0, 0, 0, .5); + color: #fff; + font-size: 16px; + border-radius: 5px; + margin: 10px; + padding: 5px 15px; + bottom: 0; + text-shadow: 2px 2px rgba(0, 0, 0, .2); } } diff --git a/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.tsx b/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.tsx index 7a2c67a3..9f04e00e 100644 --- a/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.tsx +++ b/src/views/catalog/views/page/layout/frontpage4/CatalogLayoutFrontpage4View.tsx @@ -1,9 +1,11 @@ import { FrontPageItem } from '@nitrots/nitro-renderer'; import { FC, useCallback, useMemo } from 'react'; import { CreateLinkEvent, GetConfiguration } from '../../../../../../api'; +import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; import { GetCatalogPageText } from '../../../../common/CatalogUtilities'; import { CatalogRedeemVoucherView } from '../../redeem-voucher/CatalogRedeemVoucherView'; import { CatalogLayoutFrontpage4ViewProps } from './CatalogLayoutFrontpage4View.types'; +import { CatalogLayoutFrontPageItemView } from './item/CatalogLayoutFrontPageItemView'; export const CatalogLayoutFrontpage4View: FC = props => { @@ -31,28 +33,20 @@ export const CatalogLayoutFrontpage4View: FC = if(!pageParser) return null; return ( -
-
+ + { pageParser.frontPageItems[0] && -
selectItem(pageParser.frontPageItems[0]) }> -
{ pageParser.frontPageItems[0].itemName }
-
} -
-
+ selectItem(pageParser.frontPageItems[0]) } /> } + + { pageParser.frontPageItems[1] && -
selectItem(pageParser.frontPageItems[1]) }> -
{ pageParser.frontPageItems[1].itemName }
-
} + selectItem(pageParser.frontPageItems[1]) } /> } { pageParser.frontPageItems[2] && -
selectItem(pageParser.frontPageItems[2]) }> -
{ pageParser.frontPageItems[2].itemName }
-
} + selectItem(pageParser.frontPageItems[2]) } /> } { pageParser.frontPageItems[3] && -
selectItem(pageParser.frontPageItems[3]) }> -
{ pageParser.frontPageItems[3].itemName }
-
} + selectItem(pageParser.frontPageItems[3]) } /> } -
-
+ + ); } diff --git a/src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.tsx b/src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.tsx new file mode 100644 index 00000000..9ead2796 --- /dev/null +++ b/src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.tsx @@ -0,0 +1,35 @@ +import { FC, useMemo } from 'react'; +import { GetConfiguration } from '../../../../../../../api'; +import { NitroLayoutBase } from '../../../../../../../layout/base'; +import { CatalogLayoutFrontPageItemViewProps } from './CatalogLayoutFrontPageItemView.types'; + +export const CatalogLayoutFrontPageItemView: FC = props => +{ + const { item = null, className = '', style = null, ...rest } = props; + + const getClassName = useMemo(() => + { + let newClassName = 'position-relative rounded h-100 nitro-front-page-item'; + + if(className && className.length) newClassName += ' ' + className; + + return newClassName; + }, [ className ]); + + const getStyle = useMemo(() => + { + const newStyle = { ...style }; + + newStyle.backgroundImage = `url('${ GetConfiguration('image.library.url') }${ item.itemPromoImage }')`; + + return newStyle; + }, [ style, item ]); + + if(!item) return null; + + return ( + +
{ item.itemName }
+
+ ); +} diff --git a/src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.types.ts b/src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.types.ts new file mode 100644 index 00000000..6f6135d1 --- /dev/null +++ b/src/views/catalog/views/page/layout/frontpage4/item/CatalogLayoutFrontPageItemView.types.ts @@ -0,0 +1,7 @@ +import { FrontPageItem } from '@nitrots/nitro-renderer'; +import { DetailedHTMLProps, HTMLAttributes } from 'react'; + +export interface CatalogLayoutFrontPageItemViewProps extends DetailedHTMLProps, HTMLDivElement> +{ + item: FrontPageItem; +} diff --git a/src/views/catalog/views/page/layout/guild-custom-furni/CatalogLayoutGuildCustomFurniView.tsx b/src/views/catalog/views/page/layout/guild-custom-furni/CatalogLayoutGuildCustomFurniView.tsx index 7d60016a..2ee74233 100644 --- a/src/views/catalog/views/page/layout/guild-custom-furni/CatalogLayoutGuildCustomFurniView.tsx +++ b/src/views/catalog/views/page/layout/guild-custom-furni/CatalogLayoutGuildCustomFurniView.tsx @@ -1,25 +1,28 @@ import { CatalogGroupsComposer, StringDataType } from '@nitrots/nitro-renderer'; -import { FC, useEffect, useState } from 'react'; -import { LocalizeText } from '../../../../../../api'; +import { FC, useEffect, useMemo, useState } from 'react'; import { SetRoomPreviewerStuffDataEvent } from '../../../../../../events'; import { dispatchUiEvent } from '../../../../../../hooks'; import { SendMessageHook } from '../../../../../../hooks/messages'; -import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; -import { GetOfferName } from '../../../../common/CatalogUtilities'; +import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; import { useCatalogContext } from '../../../../context/CatalogContext'; -import { CatalogRoomPreviewerView } from '../../../catalog-room-previewer/CatalogRoomPreviewerView'; +import { CatalogSelectGroupView } from '../../../select-group/CatalogSelectGroupView'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutGuildCustomFurniViewProps } from './CatalogLayoutGuildCustomFurniView.types'; export const CatalogLayouGuildCustomFurniView: FC = props => { const { roomPreviewer = null, pageParser = null } = props; - + const [ selectedGroupIndex, setSelectedGroupIndex ] = useState(0); const { catalogState = null } = useCatalogContext(); const { activeOffer = null, groups = null } = catalogState; - - const [ selectedGroupIndex, setSelectedGroupIndex ] = useState(0); + + const selectedGroup = useMemo(() => + { + if(!groups || !groups.length) return; + + return groups[selectedGroupIndex]; + }, [ groups, selectedGroupIndex ]); useEffect(() => { @@ -44,41 +47,17 @@ export const CatalogLayouGuildCustomFurniView: FC -
+ + -
- { product && -
- { groups[selectedGroupIndex] &&
- -
} - -
{ GetOfferName(activeOffer) }
- { groups.length === 0 &&
- { LocalizeText('catalog.guild_selector.members_only') } - -
} - { groups.length > 0 && <> -
-
-
-
-
- -
- - } -
} - - ); + + + + + + + + ); } diff --git a/src/views/catalog/views/page/layout/guild-forum/CatalogLayoutGuildForumView.tsx b/src/views/catalog/views/page/layout/guild-forum/CatalogLayoutGuildForumView.tsx index add86a9c..c7c3204f 100644 --- a/src/views/catalog/views/page/layout/guild-forum/CatalogLayoutGuildForumView.tsx +++ b/src/views/catalog/views/page/layout/guild-forum/CatalogLayoutGuildForumView.tsx @@ -1,12 +1,13 @@ import { CatalogGroupsComposer } from '@nitrots/nitro-renderer'; import { FC, useEffect, useState } from 'react'; -import { LocalizeText } from '../../../../../../api'; import { SendMessageHook } from '../../../../../../hooks/messages'; -import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; +import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; +import { NitroLayoutBase } from '../../../../../../layout/base'; import { GetCatalogPageText } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogActions } from '../../../../reducers/CatalogReducer'; -import { CatalogPurchaseView } from '../../purchase/CatalogPurchaseView'; +import { CatalogSelectGroupView } from '../../../select-group/CatalogSelectGroupView'; +import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; import { CatalogLayoutGuildForumViewProps } from './CatalogLayoutGuildForumView.types'; export const CatalogLayouGuildForumView: FC = props => @@ -36,35 +37,15 @@ export const CatalogLayouGuildForumView: FC = }, [ dispatchCatalogState, pageParser ]); return ( -
-
-
-
- { product &&
- { groups.length === 0 &&
- { LocalizeText('catalog.guild_selector.members_only') } - -
} - { groups[selectedGroupIndex] &&
- -
} - { groups.length > 0 && <> -
-
-
-
-
- -
- { groups[selectedGroupIndex].hasForum &&
{ LocalizeText('catalog.alert.group_has_forum') }
} - - } -
} -
- ); + + + + + + + + + + + ); } diff --git a/src/views/catalog/views/page/layout/guild-frontpage/CatalogLayoutGuildFrontpageView.tsx b/src/views/catalog/views/page/layout/guild-frontpage/CatalogLayoutGuildFrontpageView.tsx index 06dbb7f9..2ad9bd2e 100644 --- a/src/views/catalog/views/page/layout/guild-frontpage/CatalogLayoutGuildFrontpageView.tsx +++ b/src/views/catalog/views/page/layout/guild-frontpage/CatalogLayoutGuildFrontpageView.tsx @@ -1,28 +1,29 @@ import { FC } from 'react'; import { CreateLinkEvent, LocalizeText } from '../../../../../../api'; +import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; +import { NitroLayoutBase } from '../../../../../../layout/base'; import { GetCatalogPageImage, GetCatalogPageText } from '../../../../common/CatalogUtilities'; -import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogLayoutGuildFrontpageViewProps } from './CatalogLayoutGuildFrontpageView.types'; export const CatalogLayouGuildFrontpageView: FC = props => { const { pageParser = null } = props; - - const { catalogState = null, dispatchCatalogState = null } = useCatalogContext(); return ( -
-
-
-
-
+ + + + + + +
-
-
CreateLinkEvent('groups/create') }> - -
-
+
CreateLinkEvent('groups/create') }> + +
+ + ); } diff --git a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx b/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx index f68c2c50..1d4b2ad3 100644 --- a/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx +++ b/src/views/catalog/views/page/layout/pets/CatalogLayoutPetView.tsx @@ -2,7 +2,8 @@ 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 { NitroCardGridItemView, NitroCardGridView, NitroLayoutFlexColumn, NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; +import { NitroLayoutBase } from '../../../../../../layout/base'; import { PetImageView } from '../../../../../shared/pet-image/PetImageView'; import { GetPetAvailableColors, GetPetIndexFromLocalization } from '../../../../common/CatalogUtilities'; import { useCatalogContext } from '../../../../context/CatalogContext'; @@ -141,8 +142,8 @@ export const CatalogLayoutPetView: FC = props => if(!activeOffer) return null; return ( -
-
+ + { !colorsShowing && (sellablePalettes.length > 0) && sellablePalettes.map((palette, index) => { @@ -159,22 +160,27 @@ export const CatalogLayoutPetView: FC = props => ); })} -
-
+ + { (petIndex === -1) && } { (petIndex >= 0) && <> - + + { roomPreviewer && } { (petIndex > -1 && petIndex <= 7) && - } - -
{ petBreedName }
- + + + } +
+ + { petBreedName } + + } -
-
+ + ); } diff --git a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx index 94ab0a81..8e1977f5 100644 --- a/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx +++ b/src/views/catalog/views/page/layout/pets3/CatalogLayoutPets3View.tsx @@ -1,4 +1,6 @@ import { FC } from 'react'; +import { NitroLayoutFlex, NitroLayoutFlexColumn, NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; +import { NitroLayoutBase } from '../../../../../../layout/base'; import { GetCatalogPageImage, GetCatalogPageText } from '../../../../common/CatalogUtilities'; import { CatalogLayoutPets3ViewProps } from './CatalogLayoutPets3View.types'; @@ -9,21 +11,19 @@ export const CatalogLayoutPets3View: FC = props => const imageUrl = GetCatalogPageImage(pageParser, 1); return ( -
-
-
-
- { imageUrl && } -
-
-
-
-
-
-
-
-
-
-
+ + + + { imageUrl && } + + + + + + + + + + ); } 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 fe5eaf41..e826290c 100644 --- a/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx +++ b/src/views/catalog/views/page/layout/single-bundle/CatalogLayoutSingleBundleView.tsx @@ -1,5 +1,5 @@ import { FC } from 'react'; -import { NitroCardGridView } from '../../../../../../layout'; +import { NitroCardGridView, NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogPageDetailsView } from '../../../page-details/CatalogPageDetailsView'; import { CatalogProductView } from '../../product/CatalogProductView'; @@ -13,19 +13,19 @@ export const CatalogLayoutSingleBundleView: FC -
+ + { activeOffer && activeOffer.products && (activeOffer.products.length > 0) && activeOffer.products.map((product, index) => { return }) } -
-
+ + { activeOffer && } -
-
+ + ); } 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 65da4622..2a04a80b 100644 --- a/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx +++ b/src/views/catalog/views/page/layout/spaces-new/CatalogLayoutSpacesView.tsx @@ -1,6 +1,7 @@ import { CatalogPageMessageOfferData, IFurnitureData } from '@nitrots/nitro-renderer'; import { FC, useEffect, useState } from 'react'; import { GetSessionDataManager, LocalizeText } from '../../../../../../api'; +import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; import { ProductTypeEnum } from '../../../../common/ProductTypeEnum'; import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; @@ -10,10 +11,10 @@ import { CatalogLayoutSpacesViewProps } from './CatalogLayoutSpacesView.types'; export const CatalogLayoutSpacesView: FC = props => { const { roomPreviewer = null, pageParser = null } = props; - const { catalogState } = useCatalogContext(); - const { activeOffer = null } = catalogState; const [ groups, setGroups ] = useState([]); const [ activeGroupIndex, setActiveGroupIndex ] = useState(-1); + const { catalogState } = useCatalogContext(); + const { activeOffer = null } = catalogState; const groupNames = [ 'floors', 'walls', 'views' ]; @@ -66,8 +67,8 @@ export const CatalogLayoutSpacesView: FC = props = const product = ((activeOffer && activeOffer.products[0]) || null); return ( -
-
+ +
{ groupNames.map((name, index) => { @@ -75,10 +76,10 @@ export const CatalogLayoutSpacesView: FC = props = })}
-
-
+ + -
-
+ + ); } diff --git a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx index 03379cf0..86d0e7ba 100644 --- a/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx +++ b/src/views/catalog/views/page/layout/trophies/CatalogLayoutTrophiesView.tsx @@ -1,4 +1,5 @@ import { FC, useState } from 'react'; +import { NitroLayoutGrid, NitroLayoutGridColumn } from '../../../../../../layout'; import { useCatalogContext } from '../../../../context/CatalogContext'; import { CatalogPageOffersView } from '../../offers/CatalogPageOffersView'; import { CatalogProductPreviewView } from '../../product-preview/CatalogProductPreviewView'; @@ -14,14 +15,14 @@ export const CatalogLayoutTrophiesView: FC = pro const product = ((activeOffer && activeOffer.products[0]) || null); return ( -
-
+ +