Skip to content

Commit

Permalink
Add hitless breadcrumbs title for no query case
Browse files Browse the repository at this point in the history
  • Loading branch information
owi92 committed Dec 21, 2023
1 parent d695b80 commit 03ad1a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ realm:
search:
input-label: Suche
title: Suchergebnisse für „{{query}}“ ({{hits}} Treffer)
no-query: Suchergebnisse
no-results: Keine Ergebnisse
too-few-characters: Tippen Sie weitere Zeichen, um die Suche zu starten.
unavailable: Die Suchfunktion ist zurzeit nicht verfügbar. Versuchen Sie es später erneut.
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ realm:
search:
input-label: Search
title: Search results for “{{query}}” ({{hits}} hits)
no-query: Search results
no-results: No results
too-few-characters: Please type more characters to start the search.
unavailable: The search is currently unavailable. Try again later.
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/routes/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ const SearchPage: React.FC<Props> = ({ q, outcome }) => {
}

return <>
<Breadcrumbs path={[]} tail={t("search.title", {
<Breadcrumbs path={[]} tail={q ? t("search.title", {
query: q,
hits: outcome.__typename === "SearchResults" ? outcome.totalHits : 0,
})} />
}) : t("search.no-query")} />
<div css={{ maxWidth: 950, margin: "0 auto" }}>
{body}
</div>
Expand Down

0 comments on commit 03ad1a8

Please sign in to comment.