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": {
|
"search": {
|
||||||
|
"placeholder": "",
|
||||||
"defaultProvider": "https://google.com/search?q=",
|
"defaultProvider": "https://google.com/search?q=",
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,7 @@ export interface ISearchProviderProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ISearchProps {
|
export interface ISearchProps {
|
||||||
|
placeholder: string;
|
||||||
defaultProvider: string;
|
defaultProvider: string;
|
||||||
providers: Array<ISearchProviderProps> | undefined;
|
providers: Array<ISearchProviderProps> | undefined;
|
||||||
}
|
}
|
||||||
|
@ -104,6 +105,7 @@ const SearchBar = ({ search }: ISearchBarProps) => {
|
||||||
type="text"
|
type="text"
|
||||||
data-testid="search-input"
|
data-testid="search-input"
|
||||||
value={input}
|
value={input}
|
||||||
|
placeholder={search.placeholder}
|
||||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
||||||
setInput(e.target.value)
|
setInput(e.target.value)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"search": {
|
"search": {
|
||||||
|
"placeholder": "",
|
||||||
"defaultProvider": "https://google.com/search?q=",
|
"defaultProvider": "https://google.com/search?q=",
|
||||||
"providers": [
|
"providers": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,6 +68,7 @@ export const defaults = {
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
search: {
|
search: {
|
||||||
|
placeholder: '',
|
||||||
defaultProvider: "https://google.com/search?q=",
|
defaultProvider: "https://google.com/search?q=",
|
||||||
providers: [],
|
providers: [],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue