2019-04-23 15:04:18 +02:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
|
|
export default class Modal extends Component {
|
|
|
|
|
render() {
|
|
|
|
|
const {
|
|
|
|
|
id,
|
|
|
|
|
artist,
|
|
|
|
|
title,
|
|
|
|
|
songs,
|
|
|
|
|
year,
|
|
|
|
|
img,
|
|
|
|
|
description,
|
|
|
|
|
handleOnClick,
|
|
|
|
|
} = this.props;
|
|
|
|
|
if (id === undefined) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
const imagePath = `assets/covers/${img}`;
|
|
|
|
|
const song = songs.join(', ');
|
|
|
|
|
return (
|
2019-04-23 15:18:35 +02:00
|
|
|
<div className="selected-album" tabIndex="0" onClick={handleOnClick}>
|
|
|
|
|
<div className="selected-album__inner">
|
|
|
|
|
<figure className="selected-album__cover">
|
|
|
|
|
<img src={imagePath} alt="cover" className="selected-album__cover__media" />
|
2019-04-23 15:04:18 +02:00
|
|
|
</figure>
|
2019-04-23 15:18:35 +02:00
|
|
|
<span className="selected-album__summary">
|
2019-04-23 15:04:18 +02:00
|
|
|
#{id+1}: {artist} - {song}, från "{title}" ({year})<br />
|
|
|
|
|
</span>
|
2019-04-23 15:18:35 +02:00
|
|
|
<p className="selected-album__description">
|
2019-04-23 15:04:18 +02:00
|
|
|
{description.split('\n\n').map(text => (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{text}
|
|
|
|
|
<br />
|
|
|
|
|
<br />
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
))}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-04-23 15:18:35 +02:00
|
|
|
);
|
2019-04-23 15:04:18 +02:00
|
|
|
}
|
|
|
|
|
}
|