@@ -25,7 +25,8 @@ class App extends Component {
2525 source : { 'java' : code [ 'java' ] , 'python' : code [ 'python' ] , 'c_cpp' : code [ 'c_cpp' ] } ,
2626 results : [ ] ,
2727 disabled : false ,
28- practice : false
28+ practice : false ,
29+ autocomplete : true
2930 } )
3031 }
3132
@@ -53,6 +54,13 @@ class App extends Component {
5354 } )
5455 }
5556
57+ onChangeAutocomplete = ( ) => {
58+ this . setState ( {
59+ ...this . state ,
60+ autocomplete : ! this . state . autocomplete
61+ } )
62+ }
63+
5664 setRunningStatus = ( ) => {
5765 let currentResults = this . state . results ;
5866 currentResults . unshift ( 'Running your code...' )
@@ -148,7 +156,7 @@ class App extends Component {
148156 < Grid container style = { { marginBottom : '1.5%' } } >
149157 < Grid item xs = { 6 } >
150158 < CodeEditor
151- autocomplete = { ! this . state . practice }
159+ autocomplete = { this . state . autocomplete }
152160 language = { this . state . practice === true ? 'plain_text' : this . state . language }
153161 source = { this . state . source [ this . state . language ] }
154162 onChange = { this . onChangeCode } />
@@ -188,6 +196,18 @@ class App extends Component {
188196 </Button> */ }
189197 </ Grid >
190198 < Grid item xs = { 6 } style = { { textAlign : 'right' } } >
199+ < FormControlLabel
200+ control = {
201+ < Checkbox
202+ checked = { this . state . autocomplete }
203+ onChange = { this . onChangeAutocomplete }
204+ value = 'autocomplete'
205+ style = { { color : '#0269a4' } }
206+ />
207+ }
208+ label = "Autocomplete"
209+ style = { { marginRight : '2.5%' } }
210+ />
191211 < FormControlLabel
192212 control = {
193213 < Checkbox
@@ -197,7 +217,7 @@ class App extends Component {
197217 style = { { color : '#0269a4' } }
198218 />
199219 }
200- label = "Practice Mode "
220+ label = "Practice Format "
201221 style = { { marginRight : '2.5%' } }
202222 />
203223 </ Grid >
0 commit comments