@@ -17,6 +17,7 @@ export default class Single extends Component {
1717 size : 25 , // rem
1818 faceColorPanelOpen : false ,
1919 hairColorPanelOpen : false ,
20+ hatColorPanelOpen : false ,
2021 shirtColorPanelOpen : false ,
2122 bgColorPanelOpen : false
2223 } ;
@@ -59,6 +60,7 @@ export default class Single extends Component {
5960 closeAllColorPanel ( ) {
6061 this . setState ( {
6162 hairColorPanelOpen : false ,
63+ hatColorPanelOpen : false ,
6264 faceColorPanelOpen : false ,
6365 shirtColorPanelOpen : false ,
6466 bgColorPanelOpen : false
@@ -104,6 +106,7 @@ export default class Single extends Component {
104106 bgShape,
105107 faceColorPanelOpen,
106108 hairColorPanelOpen,
109+ hatColorPanelOpen,
107110 shirtColorPanelOpen,
108111 bgColorPanelOpen
109112 } = this . state ;
@@ -225,14 +228,37 @@ export default class Single extends Component {
225228 onClick = { this . updateConfig . bind ( this , "hairStyle" , "womanShort" ) } >
226229 Woman Short
227230 </ p >
231+ </ div >
232+
233+ { /* Hat */ }
234+ < div className = "field" >
235+ < p > Hat</ p >
236+ < div className = "colorPanelWrapper" onClick = { ( e ) => e . nativeEvent . stopImmediatePropagation ( ) } >
237+ < i
238+ className = "iconfont icon-color"
239+ onClick = { this . toggleColorPanel . bind ( this , "hatColorPanelOpen" ) } />
240+ { hatColorPanelOpen &&
241+ < ChromePicker
242+ className = "colorPanel"
243+ color = { config . hatColor }
244+ onChange = { this . onChangeColor . bind ( this , "hatColor" ) } />
245+ }
246+ </ div >
247+ </ div >
248+ < div className = "opts" >
249+ < p
250+ className = { classnames ( "opt" , { active : config . hatStyle === "none" } ) }
251+ onClick = { this . updateConfig . bind ( this , "hatStyle" , "none" ) } >
252+ None
253+ </ p >
228254 < p
229- className = { classnames ( "opt" , { active : config . hairStyle === "turban" } ) }
230- onClick = { this . updateConfig . bind ( this , "hairStyle " , "turban" ) } >
255+ className = { classnames ( "opt" , { active : config . hatStyle === "turban" } ) }
256+ onClick = { this . updateConfig . bind ( this , "hatStyle " , "turban" ) } >
231257 Turban
232258 </ p >
233259 < p
234- className = { classnames ( "opt" , { active : config . hairStyle === "beanie" } ) }
235- onClick = { this . updateConfig . bind ( this , "hairStyle " , "beanie" ) } >
260+ className = { classnames ( "opt" , { active : config . hatStyle === "beanie" } ) }
261+ onClick = { this . updateConfig . bind ( this , "hatStyle " , "beanie" ) } >
236262 Beanie
237263 </ p >
238264 </ div >
0 commit comments