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>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<footer>
|
<footer>
|
||||||
${homeController.recentReviews.map(review => reviewCard(review))}
|
${homeController.recentReviews.map(review => reviewCard(homeController, review))}
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -68,7 +68,7 @@ export const loggedOutView = (homeController, emit) => {
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<footer>
|
<footer>
|
||||||
${homeController.recentUpdates.map(review => reviewCard(review))}
|
${homeController.recentUpdates.map(review => reviewCard(homeController, review))}
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,9 @@ import html from 'choo/html';
|
||||||
|
|
||||||
import { starRating } from './starRating';
|
import { starRating } from './starRating';
|
||||||
|
|
||||||
export const reviewCard = (review) => {
|
export const reviewCard = (controller, review) => {
|
||||||
|
const { i18n } = controller;
|
||||||
|
|
||||||
return html`<article class="card">
|
return html`<article class="card">
|
||||||
<header style="font-weight:normal;">
|
<header style="font-weight:normal;">
|
||||||
<strong>${review.reviewer.name}</strong> <em>${review.reviewer.handle}</em><br>
|
<strong>${review.reviewer.name}</strong> <em>${review.reviewer.handle}</em><br>
|
||||||
|
|
|
@ -71,7 +71,7 @@ export const resultDetails = (searchController, result, emit = () => {}) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${result.reviews.map(review => {
|
${result.reviews.map(review => {
|
||||||
return reviewCard(review);
|
return reviewCard(searchController, review);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div class="sixth-700">
|
<div class="sixth-700">
|
||||||
|
|
Loading…
Reference in New Issue