mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 06:40:50 +01:00
Merge branch 'dev' of https://github.com/billsonnn/nitro-react into dev
This commit is contained in:
commit
255d54bba2
18
package.json
18
package.json
@ -50,22 +50,17 @@
|
||||
"keyword-spacing": [
|
||||
"error",
|
||||
{
|
||||
"overrides":
|
||||
{
|
||||
"if":
|
||||
{
|
||||
"overrides": {
|
||||
"if": {
|
||||
"after": false
|
||||
},
|
||||
"for":
|
||||
{
|
||||
"for": {
|
||||
"after": false
|
||||
},
|
||||
"while":
|
||||
{
|
||||
"while": {
|
||||
"after": false
|
||||
},
|
||||
"switch":
|
||||
{
|
||||
"switch": {
|
||||
"after": false
|
||||
}
|
||||
}
|
||||
@ -96,8 +91,7 @@
|
||||
"@typescript-eslint/ban-types": [
|
||||
"error",
|
||||
{
|
||||
"types":
|
||||
{
|
||||
"types": {
|
||||
"String": true,
|
||||
"Boolean": true,
|
||||
"Number": true,
|
||||
|
@ -9,8 +9,6 @@
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
|
||||
&.theme-default {
|
||||
@ -69,6 +67,15 @@
|
||||
background-position-y: 12px !important;
|
||||
}
|
||||
|
||||
.background {
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
&.disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.trade-button {
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
|
@ -1,3 +1,4 @@
|
||||
import classNames from 'classnames';
|
||||
import { FC } from 'react';
|
||||
import { LimitedEditionStyledNumberView } from '../../../../views/shared/limited-edition/styled-number/LimitedEditionStyledNumberView';
|
||||
import { useNitroCardGridContext } from '../context';
|
||||
@ -6,14 +7,15 @@ import { NitroCardGridItemViewProps } from './NitroCardGridItemView.types';
|
||||
|
||||
export const NitroCardGridItemView: FC<NitroCardGridItemViewProps> = props =>
|
||||
{
|
||||
const { itemImage = undefined, itemColor = undefined, itemActive = false, itemCount = 1, itemUnique = false, itemUniqueNumber = 0, itemUnseen = false, columns = undefined, className = '', style = {}, children = null, ...rest } = props;
|
||||
const { itemImage = undefined, itemColor = undefined, itemActive = false, itemCount = 1, itemUnique = false, itemUniqueNumber = 0, itemUnseen = false, columns = undefined, className = '', style = {}, backgroundDisabled = false, children = null, ...rest } = props;
|
||||
const { theme = NitroCardGridThemes.THEME_DEFAULT } = useNitroCardGridContext();
|
||||
|
||||
const imageUrl = `url(${ itemImage })`;
|
||||
|
||||
return (
|
||||
<div className={ `${ columns === undefined ? 'col' : ('col-' + columns) } pb-1 grid-item-container` }>
|
||||
<div className={ `grid-item ${ theme } cursor-pointer${ itemActive ? ' active' : '' }${ itemUnique ? ' unique-item' : '' }${ itemUnseen ? ' unseen' : ''}${ (itemImage === null ? ' icon loading-icon': '')} ${ className || '' }` } style={ itemImage ? { ...style, backgroundImage: imageUrl } : (itemColor ? { ...style, backgroundColor: itemColor } : style) } { ...rest }>
|
||||
<div className={ `grid-item ${ theme } cursor-pointer${ itemActive ? ' active' : '' }${ itemUnique ? ' unique-item' : '' }${ itemUnseen ? ' unseen' : ''}${ (itemImage === null ? ' icon loading-icon': '')} ${ className || '' }` } { ...rest }>
|
||||
<div className={'background position-absolute w-100 h-100' + classNames({ ' disabled': backgroundDisabled })} style={ itemImage ? { ...style, backgroundImage: imageUrl } : (itemColor ? { ...style, backgroundColor: itemColor } : style) }></div>
|
||||
{ (itemCount > 1) &&
|
||||
<span className="position-absolute badge border bg-danger px-1 rounded-circle">{ itemCount }</span> }
|
||||
{ itemUnique &&
|
||||
|
@ -10,4 +10,5 @@ export interface NitroCardGridItemViewProps extends DetailsHTMLAttributes<HTMLDi
|
||||
itemUniqueNumber?: number;
|
||||
itemUnseen?: boolean;
|
||||
columns?: number;
|
||||
backgroundDisabled?: boolean;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ export class AvatarEditorGridPartItem implements IAvatarImageListener
|
||||
this._isSellable = false;
|
||||
}
|
||||
|
||||
if(this._isDisabled) this.setAlpha(container, 0.2);
|
||||
//if(this._isDisabled) this.setAlpha(container, 0.2);
|
||||
|
||||
this._imageUrl = TextureUtils.generateImageUrl(container);
|
||||
|
||||
|
@ -24,7 +24,7 @@ export const AvatarEditorFigureSetItemView: FC<AvatarEditorFigureSetItemViewProp
|
||||
})
|
||||
|
||||
return (
|
||||
<NitroCardGridItemView itemImage={ (partItem.isClear ? undefined : partItem.imageUrl) } itemActive={ partItem.isSelected } onClick={ () => onClick(partItem) }>
|
||||
<NitroCardGridItemView backgroundDisabled={ partItem.isDisabled } itemImage={ (partItem.isClear ? undefined : partItem.imageUrl) } itemActive={ partItem.isSelected } onClick={ () => onClick(partItem) }>
|
||||
{ partItem.isHC && <CurrencyIcon className="position-absolute end-1 bottom-1" type={ 'hc' } /> }
|
||||
{ partItem.isClear && <i className="icon clear-icon" /> }
|
||||
{ partItem.isSellable && <i className="position-absolute icon sellable-icon end-1 bottom-1" /> }
|
||||
|
Loading…
Reference in New Issue
Block a user