File tree Expand file tree Collapse file tree 1 file changed +20
-18
lines changed
Expand file tree Collapse file tree 1 file changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,23 @@ class ListWidget extends React.Component {
232232 }
233233}
234234
235+ class ColorComponentEntry extends React . Component {
236+ render ( ) {
237+ return (
238+ < div style = { { display : 'inline-block' , margin : '1em' } } >
239+ { this . props . label } : < input type = 'text'
240+ size = '4'
241+ maxLength = '4'
242+ style = { { textAlign : 'center' } } />
243+ </ div >
244+ ) ;
245+ }
246+ }
247+
248+ ColorComponentEntry . propTypes = {
249+ label : PropTypes . string . isRequired
250+ } ;
251+
235252class ColorSelector extends React . Component {
236253 render ( ) {
237254 return (
@@ -241,24 +258,9 @@ class ColorSelector extends React.Component {
241258 height : '3em' ,
242259 border : 'solid 2px black' } } />
243260 < div style = { { marginTop : '-1em' } } >
244- < div style = { { display : 'inline-block' , margin : '1em' } } >
245- R: < input type = 'text'
246- size = '4'
247- maxLength = '4'
248- style = { { textAlign : 'center' } } />
249- </ div >
250- < div style = { { display : 'inline-block' , margin : '1em' } } >
251- G: < input type = 'text'
252- size = '4'
253- maxLength = '4'
254- style = { { textAlign : 'center' } } />
255- </ div >
256- < div style = { { display : 'inline-block' , margin : '1em' } } >
257- B: < input type = 'text'
258- size = '4'
259- maxLength = '4'
260- style = { { textAlign : 'center' } } />
261- </ div >
261+ < ColorComponentEntry label = "R" />
262+ < ColorComponentEntry label = "G" />
263+ < ColorComponentEntry label = "B" />
262264 </ div >
263265 </ div >
264266 ) ;
You can’t perform that action at this time.
0 commit comments