Add a way for reviewCard to get i18n
This commit is contained in:
parent
2b95ab81c1
commit
e991169075
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue