[Ivan Diaz] - Add Input Styling

This commit is contained in:
Ivan Diaz 2015-09-23 21:33:25 -03:00
parent c25fb16ae2
commit 9db6ed6479
3 changed files with 40 additions and 11 deletions

View File

@ -4,8 +4,9 @@ import React from 'react/addons';
import {Link} from 'react-router';
import DocumentTitle from 'react-document-title';
import Button from 'core-components/button.js';
import Widget from 'core-components/widget.js';
import Button from 'core-components/button';
import Input from 'core-components/input';
import Widget from 'core-components/widget';
var DemoPage = React.createClass({
@ -29,7 +30,13 @@ var DemoPage = React.createClass({
<Button type="primary">SIGN UP</Button>
</Widget>
)
}
},
{
title: 'Input',
render: (
<Input placeholder="placeholder"/>
)
}
],
render() {

View File

@ -1,4 +1,6 @@
import React from 'react';
import React from 'react';
import classNames from 'classnames';
import _ from 'lodash';
var Input = React.createClass({
@ -8,12 +10,6 @@ var Input = React.createClass({
onChange: React.PropTypes.func
},
getDefaultProps() {
return {
value: ''
};
},
render() {
return (
<input {...this.getProps()} />
@ -21,7 +17,22 @@ var Input = React.createClass({
},
getProps() {
return this.props;
var props = _.clone(this.props);
props.className = this.getClass();
props.type = 'text';
return props;
},
getClass() {
var classes = {
'input': true
};
classes[this.props.className] = (this.props.className);
return classNames(classes);
}
});

View File

@ -0,0 +1,11 @@
@import "../scss/vars";
.input {
border: 1px solid $grey;
border-radius: 3px;
padding: 8px;
&:hover {
border-color: $dark-grey;
}
}