Gitlab needs updates. This will be performed Friday at 09:00 AM until 09:30. Working in this period can result in loss of data.

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 { ...@@ -182,7 +182,7 @@ class App extends React.Component {
</div> </div>
<div className="artworkArea"> <div className="artworkArea">
<Artwork artwork={this.state.artwork} <Artwork artwork={this.state.artwork}
handler={this} artworkChanged={this.handleArtworkChange}
categorySelections={categorySelections}/> categorySelections={categorySelections}/>
</div> </div>
</div> </div>
......
...@@ -5,15 +5,6 @@ import Audio from './Audio'; ...@@ -5,15 +5,6 @@ import Audio from './Audio';
import Tabs from './Tabs'; import Tabs from './Tabs';
class Artwork extends React.Component { class Artwork extends React.Component {
constructor(props) {
super(props);
this.handleArtworkChange = this.handleArtworkChange.bind(this);
}
handleArtworkChange(artwork) {
this.props.handler.handleArtworkChange(artwork);
}
render() { render() {
const artwork = this.props.artwork; const artwork = this.props.artwork;
...@@ -23,7 +14,7 @@ class Artwork extends React.Component { ...@@ -23,7 +14,7 @@ class Artwork extends React.Component {
return ( return (
<div className="theArtwork"> <div className="theArtwork">
<div className="tabs"> <div className="tabs">
<Tabs artwork={artwork} onArtworkChange={this.handleArtworkChange}/> <Tabs artwork={artwork} onArtworkChange={this.props.artworkChanged}/>
</div> </div>
<div className="text"> <div className="text">
<Text artwork={artwork} cat={textCat} /> <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