-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Make toolbar accessible #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,23 +10,25 @@ class Toolbar extends React.Component { | |
render() { | ||
let playButtonClass = classNames({ | ||
"toolbar__play-button": true, | ||
"playing": this.props.isPlaying | ||
"toolbar__play-button--selected": this.props.isPlaying | ||
}); | ||
let stopButtonClass = classNames({ | ||
"toolbar__stop-button": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this line should be |
||
"toolbar__stop-button--selected": !this.props.isPlaying | ||
}); | ||
|
||
return ( | ||
<div className="toolbar"> | ||
<img className="toolbar__logo" src={logoUrl} alt="p5js Logo"/> | ||
<div className={playButtonClass} onClick={this.props.startSketch}> | ||
<button className={playButtonClass} onClick={this.props.startSketch}> | ||
<Isvg src={playUrl} alt="Play Sketch" /> | ||
</div> | ||
{ this.props.isPlaying ? | ||
<div className="toolbar__stop-button" onClick={this.props.stopSketch}> | ||
<Isvg src={stopUrl} alt="Stop Sketch" /> | ||
</div> | ||
: null } | ||
</button> | ||
<button className={stopButtonClass} onClick={this.props.stopSketch}> | ||
<Isvg src={stopUrl} alt="Stop Sketch" /> | ||
</button> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Toolbar; | ||
export default Toolbar; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
.toolbar__play-button { | ||
@extend %toolbar-button; | ||
margin-right: #{15 / $base-font-size}rem; | ||
&.playing { | ||
background-color: $light-button-background-hover-color; | ||
& g { | ||
fill: $light-button-hover-color; | ||
} | ||
&--selected { | ||
@extend %toolbar-button--selected; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be
|
||
} | ||
} | ||
|
||
.toolbar__stop-button { | ||
@extend %toolbar-button; | ||
&--selected { | ||
@extend %toolbar-button--selected; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be
|
||
} | ||
} | ||
|
||
.toolbar__logo { | ||
|
@@ -20,4 +20,4 @@ | |
.toolbar { | ||
padding: #{20 / $base-font-size}rem #{60 / $base-font-size}rem; | ||
display: flex; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be
"toolbar__play-button": !this.props.isPlaying