catalogue layout changes

This commit is contained in:
Layne 2021-06-20 04:32:04 -04:00
parent 102774187c
commit 2fc70c8270
20 changed files with 111 additions and 31 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -7,12 +7,13 @@
border-radius: $border-radius; border-radius: $border-radius;
background: rgba($primary,.4); background: rgba($primary,.4);
box-shadow:inset 1px 0 rgba($black,.2); box-shadow:inset 1px 0 rgba($black,.2);
padding-top:3px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: $border-radius; border-radius: $border-radius;
background: #DCDCDC; background: #DCDCDC;
box-shadow:inset 1px 4px $white, inset -1px -4px rgba($black,.2), 0 1px rgba($black,.2); box-shadow:inset 0px 4px $white, inset 0px -4px rgba($black,.2), 0 1px rgba($black,.2);
width: 4px; width: 4px;
} }

View File

@ -31,6 +31,8 @@ export const CatalogMessageHandler: FC<CatalogMessageHandlerProps> = props =>
{ {
const parser = event.getParser(); const parser = event.getParser();
console.log(parser)
dispatchCatalogState({ dispatchCatalogState({
type: CatalogActions.SET_CATALOG_PAGE_PARSER, type: CatalogActions.SET_CATALOG_PAGE_PARSER,
payload: { payload: {

View File

@ -6,3 +6,4 @@
@import './spaces-new/CatalogLayoutSpacesView'; @import './spaces-new/CatalogLayoutSpacesView';
@import './trophies/CatalogLayoutTrophiesView'; @import './trophies/CatalogLayoutTrophiesView';
@import './vip-buy/CatalogLayoutVipBuyView'; @import './vip-buy/CatalogLayoutVipBuyView';
@import './info-loyalty/CatalogLayoutInfoLoyaltyView.scss';

View File

@ -1,7 +1,9 @@
import { ICatalogPageParser, RoomPreviewer } from 'nitro-renderer'; import { ICatalogPageParser, RoomPreviewer } from 'nitro-renderer';
import { CatalogLayoutDefaultView } from './default/CatalogLayoutDefaultView'; import { CatalogLayoutDefaultView } from './default/CatalogLayoutDefaultView';
import { CatalogLayoutFrontpage4View } from './frontpage4/CatalogLayoutFrontpage4View'; import { CatalogLayoutFrontpage4View } from './frontpage4/CatalogLayoutFrontpage4View';
import { CatalogLayoutInfoLoyaltyView } from './info-loyalty/CatalogLayoutInfoLoyaltyView';
import { CatalogLayoutPetView } from './pets/CatalogLayoutPetView'; import { CatalogLayoutPetView } from './pets/CatalogLayoutPetView';
import { CatalogLayoutPets2View } from './pets2/CatalogLayoutPets2View';
import { CatalogLayoutPets3View } from './pets3/CatalogLayoutPets3View'; import { CatalogLayoutPets3View } from './pets3/CatalogLayoutPets3View';
import { CatalogLayoutSingleBundleView } from './single-bundle/CatalogLayoutSingleBundleView'; import { CatalogLayoutSingleBundleView } from './single-bundle/CatalogLayoutSingleBundleView';
import { CatalogLayoutSpacesView } from './spaces-new/CatalogLayoutSpacesView'; import { CatalogLayoutSpacesView } from './spaces-new/CatalogLayoutSpacesView';
@ -10,16 +12,17 @@ import { CatalogLayoutVipBuyView } from './vip-buy/CatalogLayoutVipBuyView';
export function GetCatalogLayout(pageParser: ICatalogPageParser, roomPreviewer: RoomPreviewer): JSX.Element export function GetCatalogLayout(pageParser: ICatalogPageParser, roomPreviewer: RoomPreviewer): JSX.Element
{ {
switch(pageParser.layoutCode) switch(pageParser.layoutCode)
{ {
case 'frontpage_featured': case 'frontpage_featured':
return null; return null
case 'frontpage4': case 'frontpage4':
return <CatalogLayoutFrontpage4View roomPreviewer={ roomPreviewer } pageParser={ pageParser } />; return <CatalogLayoutFrontpage4View roomPreviewer={ roomPreviewer } pageParser={ pageParser } />;
case 'pets': case 'pets':
return <CatalogLayoutPetView roomPreviewer={ roomPreviewer } pageParser={ pageParser } />; return <CatalogLayoutPetView roomPreviewer={ roomPreviewer } pageParser={ pageParser } />;
case 'pets2': case 'pets2':
return null; return <CatalogLayoutPets2View roomPreviewer={ roomPreviewer } pageParser={ pageParser } />;
case 'pets3': case 'pets3':
return <CatalogLayoutPets3View roomPreviewer={ roomPreviewer } pageParser={ pageParser } />; return <CatalogLayoutPets3View roomPreviewer={ roomPreviewer } pageParser={ pageParser } />;
case 'vip_buy': case 'vip_buy':
@ -41,7 +44,9 @@ export function GetCatalogLayout(pageParser: ICatalogPageParser, roomPreviewer:
case 'spaces_new': case 'spaces_new':
return <CatalogLayoutSpacesView roomPreviewer={ roomPreviewer } pageParser={ pageParser } />; return <CatalogLayoutSpacesView roomPreviewer={ roomPreviewer } pageParser={ pageParser } />;
case 'trophies': case 'trophies':
return <CatalogLayoutTrophiesView roomPreviewer={ roomPreviewer } pageParser={ pageParser } />; return <CatalogLayoutTrophiesView roomPreviewer={roomPreviewer} pageParser={pageParser} />;
case 'info_loyalty':
return <CatalogLayoutInfoLoyaltyView roomPreviewer={ roomPreviewer } pageParser={ pageParser } />;
case 'bots': case 'bots':
case 'default_3x3': case 'default_3x3':
default: default:

View File

@ -0,0 +1,15 @@
.nitro-catalog-layout-info-loyalty {
.info-loyalty-content {
background-repeat: no-repeat;
background-position: top right;
background-image: url('../../../../../../assets/images/catalog/diamond_info_illustration.gif');
padding-right:123px;
}
.info-image {
width: 123px;
height:350px;
background-image: url('../../../../../../assets/images/catalog/diamond_info_illustration.gif');
}
}

View File

@ -0,0 +1,16 @@
import { FC } from 'react';
import { GetCatalogPageText } from '../../../../utils/CatalogUtilities';
import { CatalogLayoutInfoLoyaltyViewProps } from './CatalogLayoutInfoLoyaltyView.types';
export const CatalogLayoutInfoLoyaltyView: FC<CatalogLayoutInfoLoyaltyViewProps> = props =>
{
const { pageParser = null } = props;
return (
<div className="h-100 nitro-catalog-layout-info-loyalty text-black d-flex flex-row">
<div className="overflow-auto h-100 d-flex flex-column info-loyalty-content">
<div dangerouslySetInnerHTML={ {__html: GetCatalogPageText(pageParser, 0) } } />
</div>
</div>
);
}

View File

@ -0,0 +1,6 @@
import { CatalogLayoutProps } from '../CatalogLayout.types';
export interface CatalogLayoutInfoLoyaltyViewProps extends CatalogLayoutProps
{
}

View File

@ -141,8 +141,8 @@ export const CatalogLayoutPetView: FC<CatalogLayoutPetViewProps> = props =>
return ( return (
<div className="row h-100 nitro-catalog-layout-pets"> <div className="row h-100 nitro-catalog-layout-pets">
<div className="col-7"> <div className="col-7 h-100">
<div className="row row-cols-5 align-content-start g-0 mb-n1 w-100 catalog-offers-container single-bundle-items-container"> <div className="row row-cols-5 align-content-start g-0 mb-n1 w-100 h-100 overflow-auto catalog-offers-container single-bundle-items-container">
{ colorsShowing && (sellableColors.length > 0) && sellableColors.map((colorSet, index) => { colorsShowing && (sellableColors.length > 0) && sellableColors.map((colorSet, index) =>
{ {
return <div key={ index } className="col pe-1 pb-1 catalog-offer-item-container"> return <div key={ index } className="col pe-1 pb-1 catalog-offer-item-container">

View File

@ -0,0 +1,2 @@
.nitro-catalog-layout-pets2 {
}

View File

@ -0,0 +1,23 @@
import { FC } from 'react';
import { GetCatalogPageImage, GetCatalogPageText } from '../../../../utils/CatalogUtilities';
import { CatalogLayoutPets2ViewProps } from './CatalogLayoutPets2View.types';
export const CatalogLayoutPets2View: FC<CatalogLayoutPets2ViewProps> = props =>
{
const { pageParser = null } = props;
return (
<div className="h-100 nitro-catalog-layout-pets3 bg-muted p-1 rounded text-black">
<div className="overflow-auto h-100 d-flex flex-column">
<div className="d-flex flex-row">
<div className="d-block mb-1 me-1">
<img alt="" src={ GetCatalogPageImage(pageParser, 1) } />
</div>
<h6 className="align-self-center">{ GetCatalogPageText(pageParser, 1) }</h6>
</div>
<div dangerouslySetInnerHTML={ {__html: GetCatalogPageText(pageParser, 2) } } />
{GetCatalogPageText(pageParser, 3) && <div className="mt-auto bg-secondary text-white rounded p-1 text-center" dangerouslySetInnerHTML={{ __html: GetCatalogPageText(pageParser, 3) }} />}
</div>
</div>
);
}

View File

@ -0,0 +1,6 @@
import { CatalogLayoutProps } from '../CatalogLayout.types';
export interface CatalogLayoutPets2ViewProps extends CatalogLayoutProps
{
}

View File

@ -7,17 +7,16 @@ export const CatalogLayoutPets3View: FC<CatalogLayoutPets3ViewProps> = props =>
const { pageParser = null } = props; const { pageParser = null } = props;
return ( return (
<div className="row h-100 nitro-catalog-layout-pets3"> <div className="h-100 nitro-catalog-layout-pets3 bg-muted p-1 rounded text-black">
<div className="col-7 text-black"> <div className="overflow-auto h-100 d-flex flex-column">
<div dangerouslySetInnerHTML={ {__html: GetCatalogPageText(pageParser, 1) } } /> <div className="d-flex flex-row">
<div dangerouslySetInnerHTML={ {__html: GetCatalogPageText(pageParser, 2) } } /> <div className="d-block mb-1 me-1">
<div dangerouslySetInnerHTML={ {__html: GetCatalogPageText(pageParser, 3) } } /> <img alt="" src={ GetCatalogPageImage(pageParser, 1) } />
</div> </div>
<div className="position-relative d-flex flex-column col-5 justify-content-center align-items-center"> <h6 className="align-self-center">{ GetCatalogPageText(pageParser, 1) }</h6>
<div className="d-block mb-2">
<img alt="" src={ GetCatalogPageImage(pageParser, 1) } />
</div> </div>
<div className="fs-6 text-center text-black lh-sm overflow-hidden">{ GetCatalogPageText(pageParser, 0) }</div> <div dangerouslySetInnerHTML={ {__html: GetCatalogPageText(pageParser, 2) } } />
{GetCatalogPageText(pageParser, 3) && <div className="mt-auto bg-secondary text-white rounded p-1 text-center" dangerouslySetInnerHTML={{ __html: GetCatalogPageText(pageParser, 3) }} />}
</div> </div>
</div> </div>
); );

View File

@ -13,8 +13,8 @@ export const CatalogLayoutSingleBundleView: FC<CatalogLayoutSingleBundleViewProp
return ( return (
<div className="row h-100 nitro-catalog-layout-single-bundle"> <div className="row h-100 nitro-catalog-layout-single-bundle">
<div className="col-7"> <div className="col-7 h-100">
<div className="row row-cols-5 align-content-start g-0 mb-n1 w-100 catalog-offers-container single-bundle-items-container"> <div className="row row-cols-5 align-content-start g-0 mb-n1 w-100 catalog-offers-container single-bundle-items-container h-100 overflow-auto">
{ activeOffer && activeOffer.products && (activeOffer.products.length > 0) && activeOffer.products.map((product, index) => { activeOffer && activeOffer.products && (activeOffer.products.length > 0) && activeOffer.products.map((product, index) =>
{ {
return <CatalogProductView key={ index } isActive={ false } product={ product } /> return <CatalogProductView key={ index } isActive={ false } product={ product } />

View File

@ -1,7 +1,3 @@
.nitro-catalog-layout-spaces { .nitro-catalog-layout-spaces {
.catalog-offers-container {
height: 284px;
max-height: 284px;
}
} }

View File

@ -70,7 +70,7 @@ export const CatalogLayoutSpacesView: FC<CatalogLayoutSpacesViewProps> = props =
return ( return (
<div className="row h-100 nitro-catalog-layout-spaces"> <div className="row h-100 nitro-catalog-layout-spaces">
<div className="col-7"> <div className="col-7 h-100 d-flex flex-column">
<div className="d-flex"> <div className="d-flex">
<div className="btn-group mx-auto mb-1 w-100"> <div className="btn-group mx-auto mb-1 w-100">
{ groupNames.map((name, index) => { groupNames.map((name, index) =>

View File

@ -5,8 +5,4 @@
resize: none; resize: none;
} }
.catalog-offers-container {
height: 192px;
max-height: 192px;
}
} }

View File

@ -17,7 +17,7 @@ export const CatalogLayoutTrophiesView: FC<CatalogLayoutTrophiesViewProps> = pro
return ( return (
<div className="row h-100 nitro-catalog-layout-trophies"> <div className="row h-100 nitro-catalog-layout-trophies">
<div className="d-flex flex-column col-7"> <div className="d-flex flex-column col-7 h-100">
<CatalogPageOffersView offers={ pageParser.offers } /> <CatalogPageOffersView offers={ pageParser.offers } />
<div className="d-flex mt-2"> <div className="d-flex mt-2">
<textarea className="form-control w-100" defaultValue={ trophyText || '' } onChange={ event => setTrophyText(event.target.value) }></textarea> <textarea className="form-control w-100" defaultValue={ trophyText || '' } onChange={ event => setTrophyText(event.target.value) }></textarea>

View File

@ -54,8 +54,8 @@ export const CatalogLayoutVipBuyView: FC<CatalogLayoutVipBuyViewProps> = props =
return ( return (
<div className="row h-100 nitro-catalog-layout-vip-buy"> <div className="row h-100 nitro-catalog-layout-vip-buy">
<div className="col-7"> <div className="col-7 h-100">
<div className="row row-cols-1 align-content-start g-0 mb-n1 w-100 catalog-offers-container"> <div className="row row-cols-1 align-content-start g-0 mb-n1 w-100 catalog-offers-container h-100 overflow-auto">
{ clubOffers && (clubOffers.length > 0) && clubOffers.map((offer, index) => { clubOffers && (clubOffers.length > 0) && clubOffers.map((offer, index) =>
{ {
return <div key={ index } className="col pe-1 pb-1 catalog-offer-item-container"> return <div key={ index } className="col pe-1 pb-1 catalog-offer-item-container">

View File

@ -22,10 +22,22 @@ export const CatalogPageOffersView: FC<CatalogPageOffersViewProps> = props =>
}, [ offers, dispatchCatalogState ]); }, [ offers, dispatchCatalogState ]);
return ( return (
<div className="row row-cols-5 align-content-start g-0 mb-n1 w-100 catalog-offers-container h-100"> <div className="row row-cols-5 align-content-start g-0 mb-n1 w-100 catalog-offers-container h-100 overflow-auto">
{ offers && (offers.length > 0) && offers.map((offer, index) => { offers && (offers.length > 0) && offers.map((offer, index) =>
{ {
return <CatalogPageOfferView key={ index } isActive={ (activeOffer === offer) } offer={ offer } /> return <CatalogPageOfferView key={ index } isActive={ (activeOffer === offer) } offer={ offer } />
})}
{ offers && (offers.length > 0) && offers.map((offer, index) =>
{
return <CatalogPageOfferView key={ index } isActive={ (activeOffer === offer) } offer={ offer } />
})}
{ offers && (offers.length > 0) && offers.map((offer, index) =>
{
return <CatalogPageOfferView key={ index } isActive={ (activeOffer === offer) } offer={ offer } />
})}
{ offers && (offers.length > 0) && offers.map((offer, index) =>
{
return <CatalogPageOfferView key={ index } isActive={ (activeOffer === offer) } offer={ offer } />
}) } }) }
</div> </div>
); );