forked from kriasoft/react-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextBox.js
More file actions
30 lines (23 loc) · 734 Bytes
/
TextBox.js
File metadata and controls
30 lines (23 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */
import React, { PropTypes, Component } from 'react';
import withStyles from '../../decorators/withStyles';
import styles from './TextBox.scss';
@withStyles(styles)
class TextBox extends Component {
static propTypes = {
maxLines: PropTypes.number,
};
static defaultProps = {
maxLines: 1,
};
render() {
return (
<div className="TextBox">
{this.props.maxLines > 1 ?
<textarea {...this.props} className="TextBox-input" ref="input" key="input" rows={this.props.maxLines} /> :
<input {...this.props} className="TextBox-input" ref="input" key="input" />}
</div>
);
}
}
export default TextBox;