Skip to content

Commit 4a5a2bb

Browse files
committed
add static image paths
1 parent 8d78add commit 4a5a2bb

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed
Loading
Loading
Loading

packages/overhead-metrics/test-apps/booking-app/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,15 @@ function generateResult() {
9999
const descriptionShort = description.slice(0, 200);
100100
const priceStr = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(price);
101101

102+
const imgSrc = `./img/house-${Math.floor(Math.random() * 3)}.jpg`;
103+
102104
const placeholders = {
103105
title,
104106
beds,
105107
description,
106108
descriptionShort,
107109
priceStr,
110+
imgSrc,
108111
};
109112

110113
return replacePlaceholders(template, placeholders);
@@ -124,7 +127,7 @@ function replacePlaceholders(str, placeholders) {
124127
}
125128

126129
const template = `<figure class="result-image">
127-
<img alt="{{title}}" data-image />
130+
<img src="{{imgSrc}}" alt="{{title}}" data-image />
128131
</figure>
129132
130133
<div class="result-content">

0 commit comments

Comments
 (0)