diff --git a/client/gatsby-config.js b/client/gatsby-config.js index e936b34e99..52e822295e 100644 --- a/client/gatsby-config.js +++ b/client/gatsby-config.js @@ -126,7 +126,7 @@ module.exports = { { resolve: 'gatsby-plugin-google-fonts', options: { - fonts: ['Lato:400,400i,500', 'Roboto Mono:400,700'] + fonts: ['Lato:300,400,400i,500,700', 'Roboto Mono:400,700'] } }, 'gatsby-plugin-sitemap', diff --git a/client/src/components/search/WithInstantSearch.js b/client/src/components/search/WithInstantSearch.js index 8ffb443420..0667fc7068 100644 --- a/client/src/components/search/WithInstantSearch.js +++ b/client/src/components/search/WithInstantSearch.js @@ -15,7 +15,7 @@ import { import { createSelector } from 'reselect'; -const DEBOUNCE_TIME = 400; +const DEBOUNCE_TIME = 100; const propTypes = { children: PropTypes.any, @@ -120,11 +120,11 @@ class InstantSearchRoot extends Component { - + {this.props.children} ); diff --git a/client/src/components/search/redux/index.js b/client/src/components/search/redux/index.js index ffcf545bdb..e7cf59c998 100644 --- a/client/src/components/search/redux/index.js +++ b/client/src/components/search/redux/index.js @@ -6,7 +6,7 @@ export const ns = 'search'; const initialState = { query: '', - indexName: 'query_suggestions', + indexName: 'news', isSearchDropdownEnabled: true, isSearchBarFocused: false }; diff --git a/client/src/components/search/searchBar/SearchBar.js b/client/src/components/search/searchBar/SearchBar.js index 4aeefc6e44..e3c3ad080f 100644 --- a/client/src/components/search/searchBar/SearchBar.js +++ b/client/src/components/search/searchBar/SearchBar.js @@ -4,7 +4,6 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { createSelector } from 'reselect'; import { SearchBox } from 'react-instantsearch-dom'; -import { navigate } from 'gatsby'; import { isSearchDropdownEnabledSelector, @@ -41,7 +40,7 @@ const mapDispatchToProps = dispatch => dispatch ); -const placeholder = 'Search 8,000+ lessons, articles, and videos'; +const placeholder = 'Search 5,000+ tutorials'; class SearchBar extends Component { constructor(props) { @@ -85,7 +84,13 @@ class SearchBar extends Component { if (query) { updateSearchQuery(query); } - return navigate('/search'); + // For Learn search results page + // return navigate('/search'); + + // Temporary redirect to News search results page + return window.location.assign( + `https://freecodecamp.org/news/search/?query=${query}` + ); } render() { diff --git a/client/src/components/search/searchBar/SearchHits.js b/client/src/components/search/searchBar/SearchHits.js index a5adf82e35..bf7d3f52a4 100644 --- a/client/src/components/search/searchBar/SearchHits.js +++ b/client/src/components/search/searchBar/SearchHits.js @@ -4,16 +4,19 @@ import isEmpty from 'lodash/isEmpty'; import Suggestion from './SearchSuggestion'; const CustomHits = connectHits(({ hits, currentRefinement, handleSubmit }) => { + const shortenedHits = hits.filter((hit, i) => i < 8); const defaultHit = [ { objectID: `default-hit-${currentRefinement}`, query: currentRefinement, _highlightResult: { query: { - value: - 'Search for "' + - currentRefinement + - '"' + value: ` + See all results for + + ${currentRefinement} + + ` } } } @@ -21,7 +24,7 @@ const CustomHits = connectHits(({ hits, currentRefinement, handleSubmit }) => { return (