add qr-code border

This commit is contained in:
Travis Eden 2018-06-13 11:43:04 -04:00
parent a2a12ef6cd
commit f6ed24a1d6
3 changed files with 8 additions and 7 deletions

View file

@ -7,18 +7,16 @@ type Props = {
value: string,
paddingRight?: boolean,
paddingTop?: boolean,
size?: number,
};
class QRCode extends React.Component<Props> {
static defaultProps = {
paddingRight: false,
paddingTop: false,
size: 128,
};
render() {
const { value, paddingRight, paddingTop, size } = this.props;
const { value, paddingRight, paddingTop } = this.props;
return (
<div
className={classnames('qr-code', {
@ -26,7 +24,7 @@ class QRCode extends React.Component<Props> {
'qr-code--top-padding': paddingTop,
})}
>
<QRCodeElement value={value} size={size} />
<QRCodeElement value={value} />
</div>
);
}

View file

@ -67,7 +67,7 @@ class WalletAddress extends React.PureComponent<Props> {
</div>
<div className="card__content">
{showQR && <QRCode value={receiveAddress} paddingTop size={256} />}
{showQR && <QRCode value={receiveAddress} paddingTop />}
</div>
<div className="card__content">

View file

@ -356,10 +356,13 @@ p {
}
.qr-code {
border: 3px solid var(--color-white);
height: 134px;
width: 134px;
&.qr-code--right-padding {
padding-right: $spacing-vertical * 2/3;
margin-right: $spacing-vertical * 2/3;
}
&.qr-code--top-padding {
padding-top: $spacing-vertical * 2/3;
margin-top: $spacing-vertical * 2/3;
}
}