Merge pull request #32 from thedeany/add-placeholder-for-search

Add ability to set search placeholder text
This commit is contained in:
Bastian Meissner 2021-07-11 15:24:40 +02:00 committed by GitHub
commit c3188882d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 0 deletions

View file

@ -1,5 +1,6 @@
{
"search": {
"placeholder": "",
"defaultProvider": "https://google.com/search?q=",
"providers": [
{

View file

@ -42,6 +42,7 @@ export interface ISearchProviderProps {
}
export interface ISearchProps {
placeholder: string;
defaultProvider: string;
providers: Array<ISearchProviderProps> | undefined;
}
@ -102,6 +103,7 @@ const SearchBar = ({ search }: ISearchBarProps) => {
type="text"
data-testid="search-input"
value={input}
placeholder={search.placeholder}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setInput(e.target.value)
}

View file

@ -1,5 +1,6 @@
{
"search": {
"placeholder": "",
"defaultProvider": "https://google.com/search?q=",
"providers": [
{

View file

@ -68,6 +68,7 @@ export const defaults = {
},
search: {
search: {
placeholder: '',
defaultProvider: "https://google.com/search?q=",
providers: [],
},