2015-10-11 20:07:09 +03:00
|
|
|
import React from 'react';
|
2015-10-09 20:48:30 +03:00
|
|
|
import Input from '../../components/input';
|
|
|
|
|
2015-11-08 01:38:26 +03:00
|
|
|
class InputTest extends React.Component {
|
|
|
|
state = {
|
2015-11-21 16:26:17 +03:00
|
|
|
normal: 'Tony Stark',
|
2015-11-08 01:38:26 +03:00
|
|
|
fixedLabel: '',
|
|
|
|
withIcon: ''
|
|
|
|
};
|
|
|
|
|
2015-11-29 03:25:21 +03:00
|
|
|
handleChange = (name, value) => {
|
2015-11-08 01:38:26 +03:00
|
|
|
const newState = {};
|
2015-11-29 03:25:21 +03:00
|
|
|
newState[[name]] = value;
|
2015-11-08 01:38:26 +03:00
|
|
|
this.setState(newState);
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<section>
|
|
|
|
<h5>Inputs</h5>
|
|
|
|
<p>lorem ipsum...</p>
|
2015-11-18 11:19:58 +03:00
|
|
|
<Input
|
|
|
|
type='text'
|
|
|
|
value={this.state.normal}
|
|
|
|
label='Firstname' onChange={this.handleChange.bind(this, 'normal')}
|
|
|
|
maxLength={12}
|
|
|
|
/>
|
2015-11-08 01:38:26 +03:00
|
|
|
<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='text' label='Disabled field' disabled />
|
|
|
|
<Input type='tel' value={this.state.withIcon} label='With icon' onChange={this.handleChange.bind(this, 'withIcon')} icon='phone' />
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2015-10-09 20:48:30 +03:00
|
|
|
|
2015-10-20 08:40:51 +03:00
|
|
|
export default InputTest;
|