Skip to content

Commit

Permalink
UI improvements
Browse files Browse the repository at this point in the history
1. Disable review button when an audio plays
2. Disable next button when an audio plays
3. Avoid  jumping to next prompt when a user clicks for review
  • Loading branch information
Ruthvicp committed Apr 4, 2019
1 parent 6ddf000 commit 49e1c77
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions frontend/src/App/Record.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ class Record extends Component {
? "btn-disabled"
: this.state.blob === undefined
? "btn-disabled"
: this.state.play
? "btn-disabled"
: null
} `}
onClick={this.state.shouldRecord ? () => null : this.playWav}
onClick={this.state.shouldRecord ? () => null : this.state.play ? () => null : this.playWav}
>
<i className="fas fa-play ibutton" />
Review
Expand All @@ -105,9 +107,11 @@ class Record extends Component {
? "btn-disabled"
: this.state.blob === undefined
? "btn-disabled"
: this.state.play
? "btn-disabled"
: null
}`}
onClick={this.state.shouldRecord ? () => null : this.onNext}
onClick={this.state.shouldRecord ? () => null : this.state.play ? () => null : this.onNext}
>
<i className="fas fa-forward ibutton-next" />
Next
Expand Down Expand Up @@ -240,8 +244,10 @@ class Record extends Component {

// next prompt
if (event.keyCode === 39) {
this.onNext();
}
if (!this.state.play) {
this.onNext();
}
}
};

recordHandler = () => {
Expand Down

0 comments on commit 49e1c77

Please sign in to comment.