mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-27 08:00:51 +01:00
Layout fixes
This commit is contained in:
parent
c19efc7fed
commit
67afaccd21
@ -3,7 +3,7 @@ import { NitroCardGridViewProps } from './NitroCardGridView.types';
|
|||||||
|
|
||||||
export const NitroCardGridView: FC<NitroCardGridViewProps> = props =>
|
export const NitroCardGridView: FC<NitroCardGridViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { columns = 5, gap = 2, className = '', style = null, children = null, ...rest } = props;
|
const { columns = 0, gap = 2, className = '', style = null, children = null, ...rest } = props;
|
||||||
|
|
||||||
const getClassName = useMemo(() =>
|
const getClassName = useMemo(() =>
|
||||||
{
|
{
|
||||||
@ -18,7 +18,11 @@ export const NitroCardGridView: FC<NitroCardGridViewProps> = props =>
|
|||||||
{
|
{
|
||||||
const newStyle = { ...style };
|
const newStyle = { ...style };
|
||||||
|
|
||||||
//newStyle['--bs-columns'] = columns.toString();
|
if(columns && (columns >= 1))
|
||||||
|
{
|
||||||
|
newStyle['grid-template-columns'] = 'unset';
|
||||||
|
newStyle['--bs-columns'] = columns.toString();
|
||||||
|
}
|
||||||
|
|
||||||
return newStyle;
|
return newStyle;
|
||||||
}, [ style, columns ]);
|
}, [ style, columns ]);
|
||||||
|
@ -22,7 +22,7 @@ export const AvatarEditorFigureSetView: FC<AvatarEditorFigureSetViewProps> = pro
|
|||||||
}, [ model, category, setMaxPaletteCount ]);
|
}, [ model, category, setMaxPaletteCount ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardGridView columns={ 3 }>
|
<NitroCardGridView>
|
||||||
{ (category.parts.length > 0) && category.parts.map((item, index) =>
|
{ (category.parts.length > 0) && category.parts.map((item, index) =>
|
||||||
{
|
{
|
||||||
return <AvatarEditorFigureSetItemView key={ index } partItem={ item } onClick={ selectPart } />;
|
return <AvatarEditorFigureSetItemView key={ index } partItem={ item } onClick={ selectPart } />;
|
||||||
|
@ -18,7 +18,7 @@ export const AvatarEditorPaletteSetView: FC<AvatarEditorPaletteSetViewProps> = p
|
|||||||
}, [ model, category, paletteSet, paletteIndex ]);
|
}, [ model, category, paletteSet, paletteIndex ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardGridView columns={ 4 } { ...rest }>
|
<NitroCardGridView { ...rest }>
|
||||||
{ (paletteSet.length > 0) && paletteSet.map((item, index) =>
|
{ (paletteSet.length > 0) && paletteSet.map((item, index) =>
|
||||||
{
|
{
|
||||||
return <AvatarEditorPaletteSetItem key={ index } colorItem={ item } onClick={ event => selectColor(item) } />;
|
return <AvatarEditorPaletteSetItem key={ index } colorItem={ item } onClick={ event => selectColor(item) } />;
|
||||||
|
@ -67,7 +67,7 @@ export const AvatarEditorWardrobeView: FC<AvatarEditorWardrobeViewProps> = props
|
|||||||
return (
|
return (
|
||||||
<div className="row h-100">
|
<div className="row h-100">
|
||||||
<div className="col-12 d-flex h-100">
|
<div className="col-12 d-flex h-100">
|
||||||
<NitroCardGridView className="wardrobe-grid" columns={ 5 }>
|
<NitroCardGridView className="wardrobe-grid">
|
||||||
{ figures }
|
{ figures }
|
||||||
</NitroCardGridView>
|
</NitroCardGridView>
|
||||||
</div>
|
</div>
|
||||||
|
@ -143,7 +143,7 @@ export const CatalogLayoutPetView: FC<CatalogLayoutPetViewProps> = props =>
|
|||||||
return (
|
return (
|
||||||
<div className="row h-100">
|
<div className="row h-100">
|
||||||
<div className="d-flex flex-column col-7 h-100">
|
<div className="d-flex flex-column col-7 h-100">
|
||||||
<NitroCardGridView columns={ 5 }>
|
<NitroCardGridView>
|
||||||
{ !colorsShowing && (sellablePalettes.length > 0) && sellablePalettes.map((palette, index) =>
|
{ !colorsShowing && (sellablePalettes.length > 0) && sellablePalettes.map((palette, index) =>
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
|
@ -15,7 +15,7 @@ export const CatalogLayoutSingleBundleView: FC<CatalogLayoutSingleBundleViewProp
|
|||||||
return (
|
return (
|
||||||
<div className="row h-100">
|
<div className="row h-100">
|
||||||
<div className="d-flex flex-column col-7 h-100">
|
<div className="d-flex flex-column col-7 h-100">
|
||||||
<NitroCardGridView columns={ 5 }>
|
<NitroCardGridView>
|
||||||
{ 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 } />
|
||||||
|
@ -11,7 +11,7 @@ export const CatalogPageOffersView: FC<CatalogPageOffersViewProps> = props =>
|
|||||||
const { activeOffer = null } = catalogState;
|
const { activeOffer = null } = catalogState;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardGridView columns={ 5 } { ...rest }>
|
<NitroCardGridView { ...rest }>
|
||||||
{ 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 } />
|
||||||
|
@ -20,7 +20,7 @@ export const CatalogSearchResultOffersView: FC<CatalogSearchResultOffersViewProp
|
|||||||
}, [ offers ]);
|
}, [ offers ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardGridView columns={ 5 } { ...rest }>
|
<NitroCardGridView { ...rest }>
|
||||||
{ offers && (offers.length > 0) && offers.map((offer, index) =>
|
{ offers && (offers.length > 0) && offers.map((offer, index) =>
|
||||||
{
|
{
|
||||||
const isActive = (activeOffer && (activeOffer.products[0].furniClassId === offer.id));
|
const isActive = (activeOffer && (activeOffer.products[0].furniClassId === offer.id));
|
||||||
|
@ -8,7 +8,7 @@ export const InventoryActiveBadgeResultsView: FC<InventoryActiveBadgeResultsView
|
|||||||
const { badges = [] } = props;
|
const { badges = [] } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardGridView columns={ 3 }>
|
<NitroCardGridView>
|
||||||
{ badges && (badges.length > 0) && badges.map(code =>
|
{ badges && (badges.length > 0) && badges.map(code =>
|
||||||
{
|
{
|
||||||
return <InventoryBadgeItemView key={ code } badge={ code } />
|
return <InventoryBadgeItemView key={ code } badge={ code } />
|
||||||
|
@ -8,7 +8,7 @@ export const InventoryFurnitureResultsView: FC<InventoryFurnitureResultsViewProp
|
|||||||
const { groupItems = [], columns = 5 } = props;
|
const { groupItems = [], columns = 5 } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NitroCardGridView columns={ columns }>
|
<NitroCardGridView>
|
||||||
{ groupItems && (groupItems.length > 0) && groupItems.map((item, index) =>
|
{ groupItems && (groupItems.length > 0) && groupItems.map((item, index) =>
|
||||||
{
|
{
|
||||||
return <InventoryFurnitureItemView key={ index } groupItem={ item } />
|
return <InventoryFurnitureItemView key={ index } groupItem={ item } />
|
||||||
|
@ -158,7 +158,7 @@ export const ToolbarView: FC<ToolbarViewProps> = props =>
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="nitro-toolbar-container overflow-hidden">
|
<div className="nitro-toolbar-container">
|
||||||
<TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ isMeExpanded } timeout={ 300 }>
|
<TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ isMeExpanded } timeout={ 300 }>
|
||||||
<ToolbarMeView handleToolbarItemClick={ handleToolbarItemClick } />
|
<ToolbarMeView handleToolbarItemClick={ handleToolbarItemClick } />
|
||||||
</TransitionAnimation>
|
</TransitionAnimation>
|
||||||
|
@ -9,7 +9,7 @@ export const BadgesContainerView: FC<BadgesContainerViewProps> = props =>
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<NitroCardGridView columns={ 5 }>
|
<NitroCardGridView>
|
||||||
{ badges && (badges.length > 0) && badges.map((badge, index) =>
|
{ badges && (badges.length > 0) && badges.map((badge, index) =>
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user