Merge pull request #3604 from ethcore/jr-input-copy-button
align copy button to input field
This commit is contained in:
commit
0d6c2dd51d
@ -18,7 +18,7 @@
|
|||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: flex-end;
|
align-items: baseline;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,35 +144,17 @@ export default class Input extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderCopyButton () {
|
renderCopyButton () {
|
||||||
const { allowCopy, label, hint, floatCopy } = this.props;
|
const { allowCopy, hideUnderline } = this.props;
|
||||||
const { value } = this.state;
|
const { value } = this.state;
|
||||||
|
|
||||||
if (!allowCopy) {
|
if (!allowCopy) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const style = {
|
|
||||||
marginBottom: 13
|
|
||||||
};
|
|
||||||
|
|
||||||
const text = typeof allowCopy === 'string'
|
const text = typeof allowCopy === 'string'
|
||||||
? allowCopy
|
? allowCopy
|
||||||
: value;
|
: value;
|
||||||
|
|
||||||
if (!label) {
|
const style = hideUnderline ? {} : { position: 'relative', top: '2px' };
|
||||||
style.marginBottom = 2;
|
|
||||||
} else if (label && !hint) {
|
|
||||||
style.marginBottom = 4;
|
|
||||||
} else if (label && hint) {
|
|
||||||
style.marginBottom = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (floatCopy) {
|
|
||||||
style.position = 'absolute';
|
|
||||||
style.left = -24;
|
|
||||||
style.bottom = style.marginBottom;
|
|
||||||
style.marginBottom = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={ styles.copy } style={ style }>
|
<div className={ styles.copy } style={ style }>
|
||||||
|
Loading…
Reference in New Issue
Block a user