Skip to content

Commit

Permalink
Implement placeholder for the search input
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueCutOfficial committed Nov 3, 2023
1 parent 192dd96 commit b48623b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions addon/components/search-input.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
type='search'
value={{this.value}}
oninput={{perform this.search value='target.value'}}
placeholder="Search the guides"
placeholder={{this.strSearchInputPlaceholder}}
autocomplete="off"
>

Expand All @@ -24,7 +24,7 @@
<div class="algolia-docsearch-suggestion algolia-docsearch-suggestion__main">
<div class="algolia-docsearch-suggestion--category-header">
<span class="algolia-docsearch-suggestion--category-header-lvl0">
{{this.strSearchPlaceholder}}
{{this.strSearchResultsPlaceholder}}
</span>
</div>
<div class="algolia-docsearch-suggestion--wrapper"></div>
Expand Down
3 changes: 2 additions & 1 deletion addon/components/search-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default class SearchInputComponent extends Component {
this.searchFunction = true;
this.client = algoliasearch(algoliaId, algoliaKey);
this.index = this.client.initIndex(indexName);
this.strSearchPlaceholder = config.guidemaker.texts.searchPlaceholder;
this.strSearchResultsPlaceholder = config.guidemaker.texts.searchResultsPlaceholder;
this.strSearchInputPlaceholder = config.guidemaker.texts.searchInputPlaceholder;
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ module.exports = function (environment) {
},
// Everything in texts could be handle with an actual intl tool in a later time
texts: {
searchPlaceholder: 'Search results',
searchInputPlaceholder: 'Search the guides',
searchResultsPlaceholder: 'Search results',
currentChapter: 'We\'ve finished covering',
nextChapter: 'Next up:',
}
Expand Down

0 comments on commit b48623b

Please sign in to comment.