mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-04 01:18:20 +02:00
Parameter type as menu dropdown
This commit is contained in:
parent
da968cbc2c
commit
80ea827c41
@ -1,6 +1,6 @@
|
|||||||
import React, { PropTypes } from 'react';
|
import React, { PropTypes } from 'react';
|
||||||
|
|
||||||
import { Textfield, IconButton } from 'react-mdl';
|
import { Textfield, IconButton, Menu, MenuItem } from 'react-mdl';
|
||||||
import { HeaderTitle, FormButtons } from '../common';
|
import { HeaderTitle, FormButtons } from '../common';
|
||||||
|
|
||||||
|
|
||||||
@ -30,14 +30,18 @@ const genParams = (input, num = 0, setValue) => (<div>{gerArrayWithEntries(num).
|
|||||||
name={key}
|
name={key}
|
||||||
onChange={({ target }) => setValue(key, target.value)}
|
onChange={({ target }) => setValue(key, target.value)}
|
||||||
value={input[key]} />
|
value={input[key]} />
|
||||||
<Textfield
|
<div style={{ position: 'relative', display: 'inline-block' }}>
|
||||||
style={{ width: '50%' }}
|
<span id={`${key}-type-menu`}>
|
||||||
floatingLabel
|
{input[typeKey] || 'string'}
|
||||||
label={`Type ${i + 1}`}
|
<IconButton name="arrow_drop_down" onClick={(evt) => evt.preventDefault()} />
|
||||||
name={typeKey}
|
</span>
|
||||||
onChange={({ target }) => setValue(typeKey, target.value)}
|
<Menu target={`${key}-type-menu`} align="right">
|
||||||
value={input[typeKey]} />
|
<MenuItem onClick={() => setValue(typeKey, 'string')}>String</MenuItem>
|
||||||
|
<MenuItem onClick={() => setValue(typeKey, 'percentage')}>Percentage</MenuItem>
|
||||||
|
<MenuItem onClick={() => setValue(typeKey, 'list')}>List of values</MenuItem>
|
||||||
|
<MenuItem onClick={() => setValue(typeKey, 'number')}>Number</MenuItem>
|
||||||
|
</Menu>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}</div>);
|
})}</div>);
|
||||||
|
Loading…
Reference in New Issue
Block a user