1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

rename and add margin

This commit is contained in:
sveisvei 2016-12-22 10:57:32 +01:00
parent 7719f7ea42
commit e46f9c3f15
2 changed files with 14 additions and 8 deletions

View File

@ -5,7 +5,7 @@ import {
IconButton, Icon, IconButton, Icon,
} from 'react-mdl'; } from 'react-mdl';
import { Link } from 'react-router'; import { Link } from 'react-router';
import StrategyInputPersentage from './strategy-input-persentage'; import StrategyInputPercentage from './strategy-input-percentage';
import StrategyInputList from './strategy-input-list'; import StrategyInputList from './strategy-input-list';
const style = { const style = {
@ -15,6 +15,12 @@ const style = {
margin: '5px 20px 15px 0px', margin: '5px 20px 15px 0px',
background: '#f2f9fc', background: '#f2f9fc',
}; };
const helpText = {
color: 'rgba(0,0,0, 0.54)',
fontSize: '12px',
lineHeight: '14px',
};
class StrategyConfigure extends React.Component { class StrategyConfigure extends React.Component {
static propTypes () { static propTypes () {
@ -58,11 +64,11 @@ class StrategyConfigure extends React.Component {
} }
return ( return (
<div key={name}> <div key={name}>
<StrategyInputPersentage <StrategyInputPercentage
name={name} name={name}
onChange={this.handleConfigChange.bind(this, name)} onChange={this.handleConfigChange.bind(this, name)}
value={1 * value} /> value={1 * value} />
{description && <p>{description}</p>} {description && <p style={helpText}>{description}</p>}
</div> </div>
); );
} else if (type === 'list') { } else if (type === 'list') {
@ -76,7 +82,7 @@ class StrategyConfigure extends React.Component {
return ( return (
<div key={name}> <div key={name}>
<StrategyInputList name={name} list={list} setConfig={this.setConfig} /> <StrategyInputList name={name} list={list} setConfig={this.setConfig} />
{description && <p>{description}</p>} {description && <p style={helpText}>{description}</p>}
</div> </div>
); );
} else if (type === 'number') { } else if (type === 'number') {
@ -93,7 +99,7 @@ class StrategyConfigure extends React.Component {
onChange={this.handleConfigChange.bind(this, name)} onChange={this.handleConfigChange.bind(this, name)}
value={value} value={value}
/> />
{description && <p>{description}</p>} {description && <p style={helpText}>{description}</p>}
</div> </div>
); );
} else { } else {
@ -101,7 +107,7 @@ class StrategyConfigure extends React.Component {
<div key={name}> <div key={name}>
<Textfield <Textfield
floatingLabel floatingLabel
rows={2} rows={1}
style={{ width: '100%' }} style={{ width: '100%' }}
required={required} required={required}
name={name} name={name}
@ -109,7 +115,7 @@ class StrategyConfigure extends React.Component {
onChange={this.handleConfigChange.bind(this, name)} onChange={this.handleConfigChange.bind(this, name)}
value={value} value={value}
/> />
{description && <p>{description}</p>} {description && <p style={helpText}>{description}</p>}
</div> </div>
); );
} }

View File

@ -9,7 +9,7 @@ const labelStyle = {
}; };
export default ({ name, value, onChange }) => ( export default ({ name, value, onChange }) => (
<div> <div style={{ marginBottom: '20px' }}>
<div style={labelStyle}>{name}: {value}%</div> <div style={labelStyle}>{name}: {value}%</div>
<Slider min={0} max={100} defaultValue={value} value={value} onChange={onChange} label={name} /> <Slider min={0} max={100} defaultValue={value} value={value} onChange={onChange} label={name} />
</div> </div>