@@ -122,7 +122,7 @@ function createElement({ node, style, useInlineStyles, key }) {
122122 style : require ( '../styles/hljs/tomorrow-night-eighties' ) . default ,
123123 code : initialCodeString ,
124124 showLineNumbers : false
125- }
125+ } ;
126126 }
127127 render ( ) {
128128 const h1Style = {
@@ -132,7 +132,7 @@ function createElement({ node, style, useInlineStyles, key }) {
132132 const h2 = {
133133 fontSize : 24 ,
134134 color : 'aliceblue'
135- }
135+ } ;
136136
137137 return (
138138 < div >
@@ -141,34 +141,45 @@ function createElement({ node, style, useInlineStyles, key }) {
141141 < h2 style = { h2 } > Change Style</ h2 >
142142 < select
143143 value = { this . state . selected }
144- onChange = { ( e ) => this . setState ( { style : require ( `../styles/hljs/${ e . target . value } ` ) . default , selected : e . target . value } ) }
144+ onChange = { e =>
145+ this . setState ( {
146+ style : require ( `../styles/hljs/${ e . target . value } ` ) . default ,
147+ selected : e . target . value
148+ } )
149+ }
145150 >
146- { availableStyles . map ( s => < option key = { s } value = { s } > { s } </ option > ) }
151+ { availableStyles . map ( s => (
152+ < option key = { s } value = { s } >
153+ { s }
154+ </ option >
155+ ) ) }
147156 </ select >
148- < div style = { { paddingTop : '10px' , fontSize : 16 , color : 'aliceblue' } } >
157+ < div style = { { paddingTop : '10px' , fontSize : 16 , color : 'aliceblue' } } >
149158 < label htmlFor = "showLineNumbers" > Show Line Numbers:</ label >
150159 < input
151160 type = "checkbox"
152161 checked = { this . state . showLineNumbers }
153- onChange = { ( ) => this . setState ( { showLineNumbers : ! this . state . showLineNumbers } ) }
162+ onChange = { ( ) =>
163+ this . setState ( { showLineNumbers : ! this . state . showLineNumbers } )
164+ }
154165 id = "showLineNumbers"
155166 />
156167 </ div >
157- < div style = { { paddingTop : 20 , display : 'flex' } } >
168+ < div style = { { paddingTop : 20 , display : 'flex' } } >
158169 < textarea
159- style = { { flex : 1 , marginTop : 11 } }
170+ style = { { flex : 1 , marginTop : 11 } }
160171 rows = { 40 }
161172 cols = { 100 }
162173 value = { this . state . code }
163- onChange = { ( e ) => this . setState ( { code : e . target . value } ) }
174+ onChange = { e => this . setState ( { code : e . target . value } ) }
164175 />
165- < div style = { { flex : 1 , width : '50%' } } >
176+ < div style = { { flex : 1 , width : '50%' } } >
166177 < SyntaxHighlighter
167178 style = { this . state . style }
168179 showLineNumbers = { this . state . showLineNumbers }
169180 wrapLines = { true }
170- lineProps = { ( lineNumber ) => ( {
171- style : { display : " block" , cursor : " pointer" } ,
181+ lineProps = { lineNumber => ( {
182+ style : { display : ' block' , cursor : ' pointer' } ,
172183 onClick ( ) {
173184 alert ( `Line Number Clicked: ${ lineNumber } ` ) ;
174185 }
@@ -183,5 +194,4 @@ function createElement({ node, style, useInlineStyles, key }) {
183194 }
184195}
185196
186-
187197render ( < Component /> , document . getElementById ( 'app' ) ) ;
0 commit comments