aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/fields/StringField.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/components/fields/StringField.js')
-rw-r--r--frontend/src/components/fields/StringField.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/frontend/src/components/fields/StringField.js b/frontend/src/components/fields/StringField.js
new file mode 100644
index 0000000..09fe24d
--- /dev/null
+++ b/frontend/src/components/fields/StringField.js
@@ -0,0 +1,31 @@
+import React, {Component} from 'react';
+import './StringField.scss';
+
+const classNames = require('classnames');
+
+class StringField extends Component {
+
+ render() {
+ return (
+ <div className={classNames("field", "d-inline-block", {"field-active" : this.props.isActive},
+ {"field-invalid": this.props.isInvalid})}>
+ <div className="input-group">
+ <div className="field-name-wrapper">
+ <span className="field-name" id={`field-${this.props.name}`}>{this.props.name}:</span>
+ </div>
+ <input placeholder={this.props.defaultValue} aria-label={this.props.name}
+ aria-describedby={`filter-${this.props.name}`} className="field-value"
+ onChange={this.props.onValueChanged} value={this.props.value} />
+ </div>
+
+ { this.props.active &&
+ <div className="field-clear">
+ <span className="filter-delete-icon" onClick={() => this.props.onValueChanged("")}>del</span>
+ </div>
+ }
+ </div>
+ );
+ }
+}
+
+export default StringField;