@@ -7,11 +7,21 @@ import {
7
7
Grid ,
8
8
} from '@material-ui/core' ;
9
9
import ExpandMoreIcon from '@material-ui/icons/ExpandMore' ;
10
- import Select from '../Select' ;
11
- import { blendModes , frames } from '../../constants' ;
10
+ import { inject , observer } from 'mobx-react' ;
11
+ import { EMITTER_STORE , EmitterStoreProp } from 'src/stores' ;
12
+ import Switch from '../Switch' ;
13
+ import TextField from '../TextField' ;
14
+ import MultipleInput from '../MultipleInput' ;
15
+ import { selectComponent } from '../Select' ;
16
+ import { frames } from 'src/constants' ;
17
+ import _get from 'lodash/get' ;
12
18
13
- class ExpansionPanelFrame extends Component {
19
+ @inject ( EMITTER_STORE )
20
+ @observer
21
+ class ExpansionPanelFrame extends Component < EmitterStoreProp > {
14
22
render ( ) {
23
+ const { emitterStore } = this . props ;
24
+ const { currentEmitterConfig } = emitterStore ! ;
15
25
return (
16
26
< ExpansionPanel >
17
27
< ExpansionPanelSummary expandIcon = { < ExpandMoreIcon /> } >
@@ -20,10 +30,31 @@ class ExpansionPanelFrame extends Component {
20
30
< ExpansionPanelDetails >
21
31
< Grid container spacing = { 16 } >
22
32
< Grid item xs = { 6 } >
23
- < Select configName = "blendMode" options = { blendModes } />
33
+ < Switch
34
+ configName = "frame>cycle"
35
+ label = "Cycle"
36
+ disabled = { currentEmitterConfig . frame . frames . length < 2 }
37
+ />
24
38
</ Grid >
25
39
< Grid item xs = { 6 } >
26
- < Select configName = "frame" options = { frames } />
40
+ < TextField
41
+ configName = "frame>quantity"
42
+ type = "number"
43
+ label = "Quantity"
44
+ disabled = { ! currentEmitterConfig . frame . cycle }
45
+ />
46
+ </ Grid >
47
+ < Grid item xs = { 12 } >
48
+ < MultipleInput configName = "frame>frames" >
49
+ { ( params : any ) => {
50
+ const { configName } = params ;
51
+ return selectComponent ( {
52
+ ...params ,
53
+ options : frames ,
54
+ value : _get ( currentEmitterConfig , configName . split ( '>' ) ) ,
55
+ } ) ;
56
+ } }
57
+ </ MultipleInput >
27
58
</ Grid >
28
59
</ Grid >
29
60
</ ExpansionPanelDetails >
0 commit comments