make placeholders overwritable

This commit is contained in:
Eduard Heimbuch
2020-11-03 13:30:00 +01:00
parent 9c96445b7a
commit 2f87afdbc2

View File

@@ -30,6 +30,7 @@ type Props = WithTranslation & {
filter: (p: string) => void; filter: (p: string) => void;
value?: string; value?: string;
testId?: string; testId?: string;
placeholder?: string;
}; };
type State = { type State = {
@@ -70,14 +71,14 @@ class FilterInput extends React.Component<Props, State> {
}; };
render() { render() {
const { t, testId } = this.props; const { t, testId, placeholder } = this.props;
return ( return (
<form className="input-field" onSubmit={this.handleSubmit} {...createAttributesForTesting(testId)}> <form className="input-field" onSubmit={this.handleSubmit} {...createAttributesForTesting(testId)}>
<div className="control has-icons-left"> <div className="control has-icons-left">
<FixedHeightInput <FixedHeightInput
className="input" className="input"
type="search" type="search"
placeholder={t("filterEntries")} placeholder={placeholder || t("filterEntries")}
value={this.state.value} value={this.state.value}
onChange={this.handleChange} onChange={this.handleChange}
/> />