add placeholders for InputClickToEdit for the new provider table row
parent
c7cb94f650
commit
8dff94b7f8
|
@ -62,12 +62,14 @@ class ProvidersTableRowNew extends Component {
|
||||||
wrapperClass="fancytable--td provider--provider"
|
wrapperClass="fancytable--td provider--provider"
|
||||||
onUpdate={this.handleChangeProvider}
|
onUpdate={this.handleChangeProvider}
|
||||||
tabIndex={rowIndex}
|
tabIndex={rowIndex}
|
||||||
|
placeholder="google"
|
||||||
/>
|
/>
|
||||||
<InputClickToEdit
|
<InputClickToEdit
|
||||||
value={providerOrganization}
|
value={providerOrganization}
|
||||||
wrapperClass="fancytable--td provider--providerorg"
|
wrapperClass="fancytable--td provider--providerorg"
|
||||||
onUpdate={this.handleChangeProviderOrg}
|
onUpdate={this.handleChangeProviderOrg}
|
||||||
tabIndex={rowIndex}
|
tabIndex={rowIndex}
|
||||||
|
placeholder="*"
|
||||||
/>
|
/>
|
||||||
<div className="fancytable--td provider--arrow">
|
<div className="fancytable--td provider--arrow">
|
||||||
<span />
|
<span />
|
||||||
|
|
|
@ -46,7 +46,9 @@ class InputClickToEdit extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {isEditing, value} = this.state
|
const {isEditing, value} = this.state
|
||||||
const {wrapperClass, disabled, tabIndex} = this.props
|
const {wrapperClass, disabled, tabIndex, placeholder} = this.props
|
||||||
|
|
||||||
|
const divStyle = value ? 'input-cte' : 'input-cte__empty'
|
||||||
|
|
||||||
return disabled
|
return disabled
|
||||||
? <div className={wrapperClass}>
|
? <div className={wrapperClass}>
|
||||||
|
@ -66,14 +68,15 @@ class InputClickToEdit extends Component {
|
||||||
onFocus={this.handleFocus}
|
onFocus={this.handleFocus}
|
||||||
ref={r => (this.inputRef = r)}
|
ref={r => (this.inputRef = r)}
|
||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
|
placeholder={placeholder}
|
||||||
/>
|
/>
|
||||||
: <div
|
: <div
|
||||||
className="input-cte"
|
className={divStyle}
|
||||||
onClick={this.handleInputClick}
|
onClick={this.handleInputClick}
|
||||||
onFocus={this.handleInputClick}
|
onFocus={this.handleInputClick}
|
||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
>
|
>
|
||||||
{value}
|
{value || placeholder}
|
||||||
<span className="icon pencil" />
|
<span className="icon pencil" />
|
||||||
</div>}
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
|
@ -88,6 +91,7 @@ InputClickToEdit.propTypes = {
|
||||||
onUpdate: func.isRequired,
|
onUpdate: func.isRequired,
|
||||||
disabled: bool,
|
disabled: bool,
|
||||||
tabIndex: number,
|
tabIndex: number,
|
||||||
|
placeholder: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default InputClickToEdit
|
export default InputClickToEdit
|
||||||
|
|
|
@ -51,3 +51,13 @@
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
color: $g9-mountain;
|
color: $g9-mountain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input-cte__empty {
|
||||||
|
@extend .input-cte;
|
||||||
|
font-style: italic;
|
||||||
|
color: $g9-mountain;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: $g9-mountain;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue