Skip to content

Commit 1d69065

Browse files
committed
add message to notify the user they have no results for the search
1 parent 75b2dc8 commit 1d69065

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

pages/browse/index.js

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,29 @@ const Browse = () => {
5858
<ItemLoading orientation='horizontal' withButtonLink={true} />
5959
</>
6060
) : (
61-
services.map(service => (
62-
<Item
63-
key={service.id}
64-
item={service}
65-
withButtonLink={true}
66-
buttonLink={service.href}
67-
orientation='horizontal'
68-
buttonProps={{
69-
backgroundColor: buttonBg,
70-
label: 'Request this item',
71-
}}
72-
/>
73-
))
61+
<>
62+
{(services.length > 0) ? (
63+
<>
64+
{services.map(service => (
65+
<Item
66+
key={service.id}
67+
item={service}
68+
withButtonLink={true}
69+
buttonLink={service.href}
70+
orientation='horizontal'
71+
buttonProps={{
72+
backgroundColor: buttonBg,
73+
label: 'Request this item',
74+
}}
75+
/>
76+
))}
77+
</>
78+
) : (
79+
<p>
80+
Your search for <b>{query}</b> returned no results. Please try another search term.
81+
</p>
82+
)}
83+
</>
7484
)
7585
}
7686
</div>

0 commit comments

Comments
 (0)