Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-129689668-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-129689668-4');
</script>

<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
26 changes: 23 additions & 3 deletions src/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class App extends Component {
source: {'java': code['java'], 'python': code['python'], 'c_cpp': code['c_cpp']},
results: [ ],
disabled: false,
practice: false
practice: false,
autocomplete: true
})
}

Expand Down Expand Up @@ -53,6 +54,13 @@ class App extends Component {
})
}

onChangeAutocomplete = () => {
this.setState({
...this.state,
autocomplete: !this.state.autocomplete
})
}

setRunningStatus = () => {
let currentResults = this.state.results;
currentResults.unshift('Running your code...')
Expand Down Expand Up @@ -148,7 +156,7 @@ class App extends Component {
<Grid container style={{ marginBottom: '1.5%' }}>
<Grid item xs={6}>
<CodeEditor
autocomplete={!this.state.practice}
autocomplete={this.state.autocomplete}
language={this.state.practice === true ? 'plain_text' : this.state.language}
source={this.state.source[this.state.language]}
onChange={this.onChangeCode} />
Expand Down Expand Up @@ -188,6 +196,18 @@ class App extends Component {
</Button> */}
</Grid>
<Grid item xs={6} style={{ textAlign: 'right' }}>
<FormControlLabel
control={
<Checkbox
checked={this.state.autocomplete}
onChange={this.onChangeAutocomplete}
value='autocomplete'
style={{ color: '#0269a4' }}
/>
}
label="Autocomplete"
style={{ marginRight: '2.5%' }}
/>
<FormControlLabel
control={
<Checkbox
Expand All @@ -197,7 +217,7 @@ class App extends Component {
style={{ color: '#0269a4' }}
/>
}
label="Practice Mode"
label="Practice Format"
style={{ marginRight: '2.5%' }}
/>
</Grid>
Expand Down