mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
[Ivan Diaz] - Add Input Styling
This commit is contained in:
parent
c25fb16ae2
commit
9db6ed6479
@ -4,8 +4,9 @@ import React from 'react/addons';
|
|||||||
import {Link} from 'react-router';
|
import {Link} from 'react-router';
|
||||||
import DocumentTitle from 'react-document-title';
|
import DocumentTitle from 'react-document-title';
|
||||||
|
|
||||||
import Button from 'core-components/button.js';
|
import Button from 'core-components/button';
|
||||||
import Widget from 'core-components/widget.js';
|
import Input from 'core-components/input';
|
||||||
|
import Widget from 'core-components/widget';
|
||||||
|
|
||||||
var DemoPage = React.createClass({
|
var DemoPage = React.createClass({
|
||||||
|
|
||||||
@ -29,6 +30,12 @@ var DemoPage = React.createClass({
|
|||||||
<Button type="primary">SIGN UP</Button>
|
<Button type="primary">SIGN UP</Button>
|
||||||
</Widget>
|
</Widget>
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Input',
|
||||||
|
render: (
|
||||||
|
<Input placeholder="placeholder"/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
var Input = React.createClass({
|
var Input = React.createClass({
|
||||||
|
|
||||||
@ -8,12 +10,6 @@ var Input = React.createClass({
|
|||||||
onChange: React.PropTypes.func
|
onChange: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
|
||||||
return {
|
|
||||||
value: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<input {...this.getProps()} />
|
<input {...this.getProps()} />
|
||||||
@ -21,7 +17,22 @@ var Input = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getProps() {
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
11
src/core-components/input.scss
Normal file
11
src/core-components/input.scss
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
@import "../scss/vars";
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: 1px solid $grey;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 8px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: $dark-grey;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user