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
|
// when non-empty search input submitted
|
||||||
return query
|
return query
|
||||||
? window.location.assign(
|
? window.location.assign(
|
||||||
`https://freecodecamp.org/news/search/?query=${encodeURIComponent(
|
`https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
|
||||||
query
|
query
|
||||||
)}`
|
)}`
|
||||||
)
|
)
|
||||||
@ -188,7 +188,7 @@ export class SearchBar extends Component {
|
|||||||
onChange={this.handleChange}
|
onChange={this.handleChange}
|
||||||
onFocus={this.handleFocus}
|
onFocus={this.handleFocus}
|
||||||
onSubmit={this.handleSearch}
|
onSubmit={this.handleSearch}
|
||||||
showLoadingIndicator={true}
|
showLoadingIndicator={false}
|
||||||
translations={{ placeholder }}
|
translations={{ placeholder }}
|
||||||
/>
|
/>
|
||||||
</ObserveKeys>
|
</ObserveKeys>
|
||||||
|
@ -17,7 +17,7 @@ const CustomHits = connectHits(
|
|||||||
{
|
{
|
||||||
objectID: `default-hit-${searchQuery}`,
|
objectID: `default-hit-${searchQuery}`,
|
||||||
query: searchQuery,
|
query: searchQuery,
|
||||||
url: `https://freecodecamp.org/news/search/?query=${encodeURIComponent(
|
url: `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
|
||||||
searchQuery
|
searchQuery
|
||||||
)}`,
|
)}`,
|
||||||
title: `See all results for ${searchQuery}`,
|
title: `See all results for ${searchQuery}`,
|
||||||
|
@ -14,7 +14,7 @@ const Suggestion = ({ hit, handleMouseEnter, handleMouseLeave }) => {
|
|||||||
}
|
}
|
||||||
href={
|
href={
|
||||||
dropdownFooter
|
dropdownFooter
|
||||||
? `https://freecodecamp.org/news/search/?query=${encodeURIComponent(
|
? `https://www.freecodecamp.org/news/search/?query=${encodeURIComponent(
|
||||||
hit.query
|
hit.query
|
||||||
)}`
|
)}`
|
||||||
: hit.url
|
: hit.url
|
||||||
|
Reference in New Issue
Block a user