forked from yuristrelets/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.js
More file actions
41 lines (37 loc) · 1.67 KB
/
input.js
File metadata and controls
41 lines (37 loc) · 1.67 KB
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
31
32
33
34
35
36
37
38
39
40
41
import React from 'react';
import Input from '../../components/input';
class InputTest extends React.Component {
state = {
normal: 'Tony Stark',
fixedLabel: '',
withIcon: '',
withCustomIcon: '',
withHintCustomIcon: '',
multilineHint: 'Long Description here'
};
handleChange = (name, value) => {
this.setState({...this.state, [name]: value});
};
render () {
return (
<section>
<h5>Inputs</h5>
<p>lorem ipsum...</p>
<Input
type='text'
value={this.state.normal}
label='First Name' onChange={this.handleChange.bind(this, 'normal')}
maxLength={12}
/>
<Input type='email' value={this.state.fixedLabel} label='Label fixed' floating={false} onChange={this.handleChange.bind(this, 'fixedLabel')} />
<Input type='text' value='Read only' readOnly label='Phone Number' />
<Input type='email' value={this.state.multilineHint} label='Description' hint='Enter Description' multiline onChange={this.handleChange.bind(this, 'multilineHint')} />
<Input type='text' label='Disabled field' disabled />
<Input type='tel' value={this.state.withIcon} required label='With icon' onChange={this.handleChange.bind(this, 'withIcon')} icon='phone' />
<Input type='tel' value={this.state.withCustomIcon} label='With custom icon' onChange={this.handleChange.bind(this, 'withCustomIcon')} icon={<span>P</span>} />
<Input type='text' value={this.state.withHintCustomIcon} label='With Hint Text Icon' hint='Hint Text' onChange={this.handleChange.bind(this, 'withHintCustomIcon')} icon={<span>J</span>} />
</section>
);
}
}
export default InputTest;