brutal-legends/src/components/modal.jsx

43 lines
1.4 KiB
React
Raw Normal View History

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" />
</figure>
2019-04-23 15:18:35 +02:00
<span className="selected-album__summary">
#{id+1}: {artist} - {song}, från "{title}" ({year})<br />
</span>
2019-04-23 15:18:35 +02:00
<p className="selected-album__description">
{description.split('\n\n').map(text => (
<React.Fragment>
{text}
<br />
<br />
</React.Fragment>
))}
</p>
</div>
</div>
2019-04-23 15:18:35 +02:00
);
}
}