Add a way for reviewCard to get i18n

This commit is contained in:
Robbie Antenesse 2019-09-13 22:46:18 -06:00
parent 2b95ab81c1
commit e991169075
3 changed files with 6 additions and 4 deletions

View File

@ -55,7 +55,7 @@ export const loggedOutView = (homeController, emit) => {
</button>
</header>
<footer>
${homeController.recentReviews.map(review => reviewCard(review))}
${homeController.recentReviews.map(review => reviewCard(homeController, review))}
</footer>
</div>
</div>
@ -68,7 +68,7 @@ export const loggedOutView = (homeController, emit) => {
</button>
</header>
<footer>
${homeController.recentUpdates.map(review => reviewCard(review))}
${homeController.recentUpdates.map(review => reviewCard(homeController, review))}
</footer>
</div>
</div>

View File

@ -2,7 +2,9 @@ import html from 'choo/html';
import { starRating } from './starRating';
export const reviewCard = (review) => {
export const reviewCard = (controller, review) => {
const { i18n } = controller;
return html`<article class="card">
<header style="font-weight:normal;">
<strong>${review.reviewer.name}</strong> <em>${review.reviewer.handle}</em><br>

View File

@ -71,7 +71,7 @@ export const resultDetails = (searchController, result, emit = () => {}) => {
</div>
</div>
${result.reviews.map(review => {
return reviewCard(review);
return reviewCard(searchController, review);
})}
</div>
<div class="sixth-700">