@imposium-hub/components 1.24.3 → 1.24.4
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ASSET_TYPES } from '../../constants/assets';
|
|
2
|
+
import { ASSET_COLORS, ASSET_TYPES } from '../../constants/assets';
|
|
3
3
|
import { assets as copy } from '../../constants/copy';
|
|
4
4
|
import {
|
|
5
5
|
ICON_FILTER, ICON_TIMES, ICON_VIDEO, ICON_AUDIO_TYPE, ICON_FONT, ICON_LAYER_GROUP, ICON_CUBE,
|
|
@@ -11,6 +11,11 @@ interface IAssetsTypeIconProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const AssetsTypeIcon : React.FC<IAssetsTypeIconProps> = (p : IAssetsTypeIconProps) => {
|
|
14
|
+
|
|
15
|
+
const style = {
|
|
16
|
+
color: ASSET_COLORS[p.type]
|
|
17
|
+
};
|
|
18
|
+
|
|
14
19
|
switch (p.type) {
|
|
15
20
|
case 'filter':
|
|
16
21
|
return (
|
|
@@ -26,37 +31,37 @@ const AssetsTypeIcon : React.FC<IAssetsTypeIconProps> = (p : IAssetsTypeIconProp
|
|
|
26
31
|
);
|
|
27
32
|
case ASSET_TYPES.VIDEO:
|
|
28
33
|
return (
|
|
29
|
-
<span title = {copy.iconTypes.video}>
|
|
34
|
+
<span title = {copy.iconTypes.video} style = {style}>
|
|
30
35
|
{ICON_VIDEO}
|
|
31
36
|
</span>
|
|
32
37
|
);
|
|
33
38
|
case ASSET_TYPES.AUDIO:
|
|
34
39
|
return (
|
|
35
|
-
<span title = {copy.iconTypes.audio}>
|
|
40
|
+
<span title = {copy.iconTypes.audio} style = {style}>
|
|
36
41
|
{ICON_AUDIO_TYPE}
|
|
37
42
|
</span>
|
|
38
43
|
);
|
|
39
44
|
case ASSET_TYPES.IMAGE:
|
|
40
45
|
return (
|
|
41
|
-
<span title = {copy.iconTypes.image}>
|
|
46
|
+
<span title = {copy.iconTypes.image} style = {style}>
|
|
42
47
|
{ICON_IMAGE}
|
|
43
48
|
</span>
|
|
44
49
|
);
|
|
45
50
|
case ASSET_TYPES.IMAGE_SEQUENCE:
|
|
46
51
|
return (
|
|
47
|
-
<span title = {copy.iconTypes.image_sequence}>
|
|
52
|
+
<span title = {copy.iconTypes.image_sequence} style = {style}>
|
|
48
53
|
{ICON_IMAGE_SEQ_TYPE}
|
|
49
54
|
</span>
|
|
50
55
|
);
|
|
51
56
|
case ASSET_TYPES.TEMPLATE:
|
|
52
57
|
return (
|
|
53
|
-
<span title = {copy.iconTypes.template}>
|
|
58
|
+
<span title = {copy.iconTypes.template} style = {style}>
|
|
54
59
|
{ICON_FILE_ARCHIVE}
|
|
55
60
|
</span>
|
|
56
61
|
);
|
|
57
62
|
case ASSET_TYPES.VIDEO_COMPOSITION:
|
|
58
63
|
return (
|
|
59
|
-
<span title = {copy.iconTypes.video_composition}>
|
|
64
|
+
<span title = {copy.iconTypes.video_composition} style = {style}>
|
|
60
65
|
{ICON_LAYER_GROUP}
|
|
61
66
|
</span>
|
|
62
67
|
);
|
package/components/tabs/Tabs.tsx
CHANGED
|
@@ -22,6 +22,8 @@ interface ITabsProps {
|
|
|
22
22
|
onChange(i) : void;
|
|
23
23
|
onClose(i) : void;
|
|
24
24
|
tabPadding? : number;
|
|
25
|
+
width : number;
|
|
26
|
+
height : number;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
interface ITabsState {
|
|
@@ -88,7 +90,7 @@ class Tabs extends React.PureComponent<ITabsProps, ITabsState> {
|
|
|
88
90
|
|
|
89
91
|
private renderContent() {
|
|
90
92
|
|
|
91
|
-
const {options, activeTab, keepMounted} = this.props;
|
|
93
|
+
const {options, activeTab, keepMounted, width, height} = this.props;
|
|
92
94
|
|
|
93
95
|
if (keepMounted) {
|
|
94
96
|
|
|
@@ -99,14 +101,16 @@ class Tabs extends React.PureComponent<ITabsProps, ITabsState> {
|
|
|
99
101
|
const active = (option.key === activeTab);
|
|
100
102
|
|
|
101
103
|
const content = React.cloneElement(option.content, {
|
|
102
|
-
active
|
|
104
|
+
active,
|
|
105
|
+
width,
|
|
106
|
+
height
|
|
103
107
|
});
|
|
104
108
|
|
|
105
109
|
contentArray.push(content);
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
if (contentArray.length > 0) {
|
|
109
|
-
return
|
|
113
|
+
return contentArray;
|
|
110
114
|
} else {
|
|
111
115
|
return null;
|
|
112
116
|
}
|
|
@@ -116,7 +120,7 @@ class Tabs extends React.PureComponent<ITabsProps, ITabsState> {
|
|
|
116
120
|
|
|
117
121
|
if (option.key === activeTab || !activeTab) {
|
|
118
122
|
|
|
119
|
-
return
|
|
123
|
+
return option.content;
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
126
|
return null;
|
package/constants/assets.ts
CHANGED
|
@@ -14,3 +14,12 @@ export const ASSET_TYPES = {
|
|
|
14
14
|
LUT : 'lut',
|
|
15
15
|
ALL : 'all'
|
|
16
16
|
};
|
|
17
|
+
|
|
18
|
+
export const ASSET_COLORS = {
|
|
19
|
+
[ASSET_TYPES.VIDEO]: 'rgba(236,22,150, 1)',
|
|
20
|
+
[ASSET_TYPES.IMAGE]: 'rgba(241,191,21, 1)',
|
|
21
|
+
[ASSET_TYPES.AUDIO]: 'rgba(72,177,222,1)',
|
|
22
|
+
[ASSET_TYPES.TEMPLATE]: 'rgba(208, 80, 35, 1)',
|
|
23
|
+
[ASSET_TYPES.VIDEO_COMPOSITION]: 'rgba(215, 22, 22, 1)',
|
|
24
|
+
[ASSET_TYPES.IMAGE_SEQUENCE]: 'rgba(241,191,21, 1)',
|
|
25
|
+
};
|