@remvst/configurable-react 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,7 +43,6 @@ exports.default = TexturedEnumComponent;
|
|
|
43
43
|
function CategoryComponent(props) {
|
|
44
44
|
const items = props.category.items.map(item => {
|
|
45
45
|
const texture = props.getTexture ? props.getTexture(props.enumToken, item.value) : null;
|
|
46
|
-
console.log(texture);
|
|
47
46
|
return react_1.default.createElement(TextureItemComponent, { key: item.key, title: item.key, src: texture ? texture[0] : null, textureType: texture ? texture[1] : null, enumToken: props.enumToken, selected: item.value === props.currentValue, onClick: () => props.onSelectValue(item.value) });
|
|
48
47
|
});
|
|
49
48
|
return (react_1.default.createElement("div", { className: 'group-configurable' }, items));
|
|
@@ -51,7 +50,6 @@ function CategoryComponent(props) {
|
|
|
51
50
|
function TextureItemComponent(props) {
|
|
52
51
|
const [size, setSize] = (0, react_1.useState)({ 'width': 0, 'height': 0 });
|
|
53
52
|
(0, react_1.useEffect)(() => {
|
|
54
|
-
console.log('load', props.src);
|
|
55
53
|
if (size.width !== 0 || !props.src) {
|
|
56
54
|
return;
|
|
57
55
|
}
|
|
@@ -60,7 +58,7 @@ function TextureItemComponent(props) {
|
|
|
60
58
|
img.src = props.src;
|
|
61
59
|
});
|
|
62
60
|
let backgroundSize = 'contain';
|
|
63
|
-
switch (props.
|
|
61
|
+
switch (props.textureType) {
|
|
64
62
|
case TextureType.SINGLE:
|
|
65
63
|
backgroundSize = 'contain';
|
|
66
64
|
break;
|
package/package.json
CHANGED
|
@@ -39,7 +39,6 @@ function CategoryComponent<T>(props: {
|
|
|
39
39
|
}) {
|
|
40
40
|
const items = props.category.items.map(item => {
|
|
41
41
|
const texture = props.getTexture ? props.getTexture(props.enumToken, item.value) : null;
|
|
42
|
-
console.log(texture);
|
|
43
42
|
|
|
44
43
|
return <TextureItemComponent
|
|
45
44
|
key={item.key}
|
|
@@ -67,7 +66,6 @@ function TextureItemComponent(props: {
|
|
|
67
66
|
const [size, setSize] = useState({'width': 0, 'height': 0});
|
|
68
67
|
|
|
69
68
|
useEffect(() => {
|
|
70
|
-
console.log('load', props.src);
|
|
71
69
|
if (size.width !== 0 || !props.src) {
|
|
72
70
|
return;
|
|
73
71
|
}
|
|
@@ -78,7 +76,7 @@ function TextureItemComponent(props: {
|
|
|
78
76
|
});
|
|
79
77
|
|
|
80
78
|
let backgroundSize: string = 'contain';
|
|
81
|
-
switch (props.
|
|
79
|
+
switch (props.textureType) {
|
|
82
80
|
case TextureType.SINGLE:
|
|
83
81
|
backgroundSize = 'contain';
|
|
84
82
|
break;
|