Commit 56bbd7b0 authored by Svein Olav Styve's avatar Svein Olav Styve

Merge branch '#16-artwork_refactor' into 'master'

Refactor artwork selection handler

Closes #16

See merge request !14
parents 30be571a 78874980
......@@ -182,7 +182,7 @@ class App extends React.Component {
</div>
<div className="artworkArea">
<Artwork artwork={this.state.artwork}
handler={this}
artworkChanged={this.handleArtworkChange}
categorySelections={categorySelections}/>
</div>
</div>
......
......@@ -5,15 +5,6 @@ import Audio from './Audio';
import Tabs from './Tabs';
class Artwork extends React.Component {
constructor(props) {
super(props);
this.handleArtworkChange = this.handleArtworkChange.bind(this);
}
handleArtworkChange(artwork) {
this.props.handler.handleArtworkChange(artwork);
}
render() {
const artwork = this.props.artwork;
......@@ -23,7 +14,7 @@ class Artwork extends React.Component {
return (
<div className="theArtwork">
<div className="tabs">
<Tabs artwork={artwork} onArtworkChange={this.handleArtworkChange}/>
<Tabs artwork={artwork} onArtworkChange={this.props.artworkChanged}/>
</div>
<div className="text">
<Text artwork={artwork} cat={textCat} />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment