Skip to content

Commit

Permalink
Load thumbnail in window
Browse files Browse the repository at this point in the history
Co-Authored-By: Jack Reed <[email protected]>
  • Loading branch information
camillevilla and mejackreed committed Oct 17, 2018
1 parent a20e9cb commit f73fc50
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions minimal_redux_poc/src/components/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ class Window extends Component {
*/
render() {
return (
<div
className="mirador-window"
>
{this.props.window.id}
<div className="mirador-window">
<h3>{this.props.manifest.manifestation.getLabel().map(label => label.value)[0]}</h3>
<img src={this.props.manifest.manifestation.getThumbnail().id} alt="" />
<p>{this.props.window.id}</p>
</div>
);
}
Expand All @@ -31,10 +31,12 @@ Window.propTypes = {
* @memberof Window
* @private
*/
const mapStateToProps = ({ windows }, props) => (
{
window: windows.find(window => props.id === window.id),
}
);
const mapStateToProps = ({ windows, manifests }, props) => {
const window = windows.find(win => props.id === win.id);
return {
window,
manifest: manifests[window.manifestId],
};
};

export default connect(mapStateToProps)(Window);

0 comments on commit f73fc50

Please sign in to comment.