Add ability to set search placeholder text
This commit is contained in:
parent
cd22b904ee
commit
d9dfa0d15e
4 changed files with 5 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"search": {
|
||||
"placeholder": "",
|
||||
"defaultProvider": "https://google.com/search?q=",
|
||||
"providers": [
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"search": {
|
||||
"placeholder": "",
|
||||
"defaultProvider": "https://google.com/search?q=",
|
||||
"providers": [
|
||||
{
|
||||
|
|
|
@ -68,6 +68,7 @@ export const defaults = {
|
|||
},
|
||||
search: {
|
||||
search: {
|
||||
placeholder: '',
|
||||
defaultProvider: "https://google.com/search?q=",
|
||||
providers: [],
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue