Add ability to set search placeholder text

This commit is contained in:
Brandon Dean 2021-07-10 13:44:39 -04:00
parent cd22b904ee
commit d9dfa0d15e
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

@ -44,6 +44,7 @@ export interface ISearchProviderProps {
}
export interface ISearchProps {
placeholder: string;
defaultProvider: string;
providers: Array<ISearchProviderProps> | undefined;
}
@ -104,6 +105,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: [],
},