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:
committed by
mrugesh
parent
e925e854f1
commit
978bae6716
@ -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>
|
||||
|
@ -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}`,
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user