traxxx/assets/views/home.jsx

120 lines
4.6 KiB
React
Raw Normal View History

'use strict';
const React = require('react');
const moment = require('moment');
2019-05-17 19:59:14 +00:00
const PropTypes = require('prop-types');
2019-05-08 03:50:13 +00:00
const Layout = require('./layout.jsx');
2019-05-17 19:59:14 +00:00
const Home = ({ releases }) => (
<Layout>
<ul className="scenes">
{releases.map(release => (
<li key={release.id} className="scene">
<span
className="scene-banner"
>
<span className="scene-details">
<a
href={`/site/${release.site.id}`}
2019-05-18 23:34:08 +00:00
target="_blank"
rel="noopener noreferrer"
2019-05-17 19:59:14 +00:00
className="scene-site site-link"
title={release.network.name}
2019-05-08 03:50:13 +00:00
>
2019-05-17 19:59:14 +00:00
{release.site.name}
</a>
2019-05-08 23:58:47 +00:00
2019-05-17 19:59:14 +00:00
<a
href={release.url}
target="_blank"
rel="noopener noreferrer"
className="scene-date"
>
{moment(release.date).format('MMM D, YYYY')}
</a>
</span>
2019-05-08 23:58:47 +00:00
2019-05-18 23:34:08 +00:00
<a
href={`/scene/${release.id}`}
target="_blank"
rel="noopener noreferrer"
className="scene-row scene-link"
>
<img
src={`/${release.site.id}/${release.id}/0.jpg`}
alt={release.id}
className="scene-thumbnail"
/>
</a>
2019-05-17 19:59:14 +00:00
</span>
2019-05-08 03:50:13 +00:00
2019-05-17 19:59:14 +00:00
<div className="scene-info">
<a
2019-05-18 23:34:08 +00:00
href={`/scene/${release.id}`}
2019-05-17 19:59:14 +00:00
target="_blank"
rel="noopener noreferrer"
className="scene-row scene-link"
>
<h2 className="scene-title">{release.title}</h2>
</a>
2019-05-08 03:50:13 +00:00
2019-05-17 19:59:14 +00:00
<span className="scene-row">
<ul className="scene-actors nolist">
{release.actors.map(actor => (
<li
key={actor.id}
className="scene-actor"
>
<a
href={`/actor/${actor.id}`}
2019-05-18 23:34:08 +00:00
target="_blank"
rel="noopener noreferrer"
2019-05-17 19:59:14 +00:00
className="actor-link"
2019-05-08 03:50:13 +00:00
>
2019-05-17 19:59:14 +00:00
{actor.name}
</a>
</li>
))}
</ul>
</span>
2019-05-08 03:50:13 +00:00
2019-05-17 19:59:14 +00:00
<span
title={release.tags.map(tag => tag.tag).join(', ')}
className="scene-row"
>
<ul className="scene-tags nolist">
{release.tags.map(tag => (
<li
key={tag.tag}
className="scene-tag"
>
<a
href={`/tag/${tag.tag}`}
2019-05-18 23:34:08 +00:00
target="_blank"
rel="noopener noreferrer"
2019-05-17 19:59:14 +00:00
className="tag-link"
2019-05-08 03:50:13 +00:00
>
2019-05-17 19:59:14 +00:00
{tag.tag}
</a>
</li>
))}
</ul>
</span>
</div>
</li>
))}
</ul>
</Layout>
);
Home.propTypes = {
releases: PropTypes.arrayOf(PropTypes.object),
};
Home.defaultProps = {
releases: [],
};
module.exports = Home;