fix: news search redirects and loading indicator (#38048)

Disable loading indicator and redirect to full news search page url so NGINX no longer redirects to ../news/news/search?query=...
This commit is contained in:
Kristofer Koishigawa
2020-01-13 07:52:27 +09:00
committed by mrugesh
parent e925e854f1
commit 978bae6716
3 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ export class SearchBar extends Component {
// when non-empty search input submitted
return query
? window.location.assign(
`https://freecodecamp.org/news/search/?query=${encodeURIComponent(
`https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
query
)}`
)
@ -188,7 +188,7 @@ export class SearchBar extends Component {
onChange={this.handleChange}
onFocus={this.handleFocus}
onSubmit={this.handleSearch}
showLoadingIndicator={true}
showLoadingIndicator={false}
translations={{ placeholder }}
/>
</ObserveKeys>

View File

@ -17,7 +17,7 @@ const CustomHits = connectHits(
{
objectID: `default-hit-${searchQuery}`,
query: searchQuery,
url: `https://freecodecamp.org/news/search/?query=${encodeURIComponent(
url: `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
searchQuery
)}`,
title: `See all results for ${searchQuery}`,

View File

@ -14,7 +14,7 @@ const Suggestion = ({ hit, handleMouseEnter, handleMouseLeave }) => {
}
href={
dropdownFooter
? `https://freecodecamp.org/news/search/?query=${encodeURIComponent(
? `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
hit.query
)}`
: hit.url