Readlebee/app/views/partials/reviewCard.js

29 lines
771 B
JavaScript
Raw Normal View History

import html from 'choo/html';
import { starRating } from './starRating';
2019-09-14 06:46:18 +02:00
export const reviewCard = (controller, review) => {
const { __ } = controller.i18n;
2019-09-14 06:46:18 +02:00
return html`<article class="card">
<header style="font-weight:normal;">
<strong>${review.reviewer.name}</strong> <em>${review.reviewer.handle}</em><br>
${review.date} ${starRating(Math.ceil(review.rating))}
</header>
<footer>
<div class="content">
<p>
${review.review}
</p>
</div>
<span class="tooltip-top" data-tooltip=${__('interaction.heart')}>
<button class="pseudo">
<i class="icon-heart-outline"></i>
</button>
</span>
<span>
${review.hearts}
</span>
</footer>
</article>`;
}