Commit ad58e2b7 authored by Svein Olav Styve's avatar Svein Olav Styve

Refactor FavoriteSection

parent 49010f67
......@@ -184,7 +184,7 @@ class App extends React.Component {
categorySelections={categorySelections}/>
</div>
</div>
<FavoriteSection handler={this}/>
<FavoriteSection save={this.saveAsFavorite} open={this.openFavorite}/>
<SessionElement sessionHistory={sessionHistory} handler={this}/>
</header>
</div>
......
import React from 'react';
import '../style/FavoriteButton.css';
export default class FavoriteSection extends React.Component {
render() {
return (
<div className="Button-container">
<button onClick={this.props.handler.saveAsFavorite}>Save as favorite</button>
<button onClick={this.props.handler.openFavorite}>Open favourite</button>
</div>
);
}
export default function FavoriteSection(props) {
return (
<div className="Button-container">
<button onClick={props.save}>Save as favorite</button>
<button onClick={props.open}>Open favourite</button>
</div>
);
}
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