@@ -12,10 +12,10 @@ class Preferences extends Component {
1212 if ( ! window . ready ) {
1313 const interval = setInterval ( ( ) => {
1414 if ( window . ready ) {
15- this . state = {
15+ this . setState ( {
1616 preferences : window . preferences || { } ,
1717 ready : window . ready
18- }
18+ } )
1919 clearInterval ( interval )
2020 }
2121 } , 100 )
@@ -26,49 +26,49 @@ class Preferences extends Component {
2626 return (
2727 < div >
2828 < Portal >
29- < button onClick = { ( ) => pluginCall ( 'savePreferences' , preferences ) } className = " save" >
29+ < button onClick = { ( ) => pluginCall ( 'savePreferences' , preferences ) } className = ' save' >
3030 Save Preferences
3131 </ button >
3232 </ Portal >
3333 { ! ready && 'loading...' }
3434 < h2 > Diffs preferences</ h2 >
35- < div className = " form" >
36- < label htmlFor = " folder" > Folder where the pretty diffs will be exported</ label >
37- < input type = " text" value = { preferences . exportFolder } id = " folder" onInput = { this . linkState ( 'preferences.exportFolder' ) } />
35+ < div className = ' form' >
36+ < label htmlFor = ' folder' > Folder where the pretty diffs will be exported</ label >
37+ < input type = ' text' value = { preferences . exportFolder } id = ' folder' onInput = { this . linkState ( 'preferences.exportFolder' ) } />
3838 </ div >
39- < div className = " form" >
40- < label htmlFor = " scale" > Scale of the exported artboards</ label >
41- < input type = " number" value = { preferences . exportScale } id = " scale" onInput = { this . linkState ( 'preferences.exportScale' ) } />
39+ < div className = ' form' >
40+ < label htmlFor = ' scale' > Scale of the exported artboards</ label >
41+ < input type = ' number' value = { preferences . exportScale } id = ' scale' onInput = { this . linkState ( 'preferences.exportScale' ) } />
4242 </ div >
43- < div className = " form" >
44- < label htmlFor = " format" > Format of the exported artboards</ label >
45- < select id = " form" value = { preferences . exportFormat } onChange = { this . linkState ( 'preferences.exportFormat' ) } >
46- < option value = " png" > PNG</ option >
47- < option value = " jpg" > JPG</ option >
48- < option value = " pdf" > PDF</ option >
49- < option value = " eps" > EPS</ option >
50- < option value = " svg" > SVG</ option >
43+ < div className = ' form' >
44+ < label htmlFor = ' format' > Format of the exported artboards</ label >
45+ < select id = ' form' value = { preferences . exportFormat } onChange = { this . linkState ( 'preferences.exportFormat' ) } >
46+ < option value = ' png' > PNG</ option >
47+ < option value = ' jpg' > JPG</ option >
48+ < option value = ' pdf' > PDF</ option >
49+ < option value = ' eps' > EPS</ option >
50+ < option value = ' svg' > SVG</ option >
5151 </ select >
5252 </ div >
53- < div className = " form" >
54- < input type = " checkbox" checked = { preferences . diffByDefault } id = " diffByDefault" onChange = { this . linkState ( 'preferences.diffByDefault' ) } />
55- < label htmlFor = " diffByDefault" > Generate pretty diff by default</ label >
53+ < div className = ' form' >
54+ < input type = ' checkbox' checked = { preferences . diffByDefault } id = ' diffByDefault' onChange = { this . linkState ( 'preferences.diffByDefault' ) } />
55+ < label htmlFor = ' diffByDefault' > Generate pretty diff by default</ label >
5656 </ div >
57- < div className = " form" >
58- < input type = " checkbox" checked = { preferences . includeOverviewFile } id = " includeOverviewFile" onChange = { this . linkState ( 'preferences.includeOverviewFile' ) } />
59- < label htmlFor = " includeOverviewFile" > Save an overview file with rendered artboards</ label >
57+ < div className = ' form' >
58+ < input type = ' checkbox' checked = { preferences . includeOverviewFile } id = ' includeOverviewFile' onChange = { this . linkState ( 'preferences.includeOverviewFile' ) } />
59+ < label htmlFor = ' includeOverviewFile' > Save an overview file with rendered artboards</ label >
6060 </ div >
6161 < h2 > Miscellaneous</ h2 >
62- < div className = " form" >
63- < label htmlFor = " terminal" > Terminal App</ label >
64- < select id = " terminal" value = { preferences . terminal } onChange = { this . linkState ( 'preferences.terminal' ) } >
65- < option value = " Terminal" > Terminal</ option >
66- < option value = " iTerm" > iTerm</ option >
62+ < div className = ' form' >
63+ < label htmlFor = ' terminal' > Terminal App</ label >
64+ < select id = ' terminal' value = { preferences . terminal } onChange = { this . linkState ( 'preferences.terminal' ) } >
65+ < option value = ' Terminal' > Terminal</ option >
66+ < option value = ' iTerm' > iTerm</ option >
6767 </ select >
6868 </ div >
69- < div className = " form" >
70- < input type = " checkbox" checked = { preferences . sendAnalytics } id = " sendAnalytics" onChange = { this . linkState ( 'preferences.sendAnalytics' ) } />
71- < label htmlFor = " sendAnalytics" > Send anymous usage data to improve the plugin</ label >
69+ < div className = ' form' >
70+ < input type = ' checkbox' checked = { preferences . sendAnalytics } id = ' sendAnalytics' onChange = { this . linkState ( 'preferences.sendAnalytics' ) } />
71+ < label htmlFor = ' sendAnalytics' > Send anymous usage data to improve the plugin</ label >
7272 </ div >
7373 </ div >
7474 )
0 commit comments