Skip to content

Commit

Permalink
Implement in Address Details modal
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Mar 15, 2023
1 parent db53a0b commit d1422df
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ui/components/multichain/address-copy-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const AddressCopyButton = ({
paddingRight={3}
paddingLeft={3}
size={Size.SM}
style={{ borderRadius: '999px' }}
style={{ borderRadius: '999px', ...(wrap ? { height: 'auto' } : {}) }}
>
<Text
variant={TextVariant.bodyXs}
Expand Down
44 changes: 26 additions & 18 deletions ui/components/ui/qr-code/qr-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { toChecksumHexAddress } from '../../../../shared/modules/hexstring-utils
import Tooltip from '../tooltip';
import { useI18nContext } from '../../../hooks/useI18nContext';
import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
import { AddressCopyButton } from '../../multichain/address-copy-button';
import Box from '../box/box';

export default connect(mapStateToProps)(QrCodeView);

Expand Down Expand Up @@ -56,25 +58,31 @@ function QrCodeView(props) {
__html: qrImage.createTableTag(4),
}}
/>
<Tooltip
wrapperClassName="qr-code__address-container__tooltip-wrapper"
position="bottom"
title={copied ? t('copiedExclamation') : t('copyToClipboard')}
>
<div
className="qr-code__address-container"
onClick={() => {
handleCopy(toChecksumHexAddress(data));
}}
{process.env.MULTICHAIN ? (
<Box marginLeft={2} marginRight={2}>
<AddressCopyButton wrap address={toChecksumHexAddress(data)} />
</Box>
) : (
<Tooltip
wrapperClassName="qr-code__address-container__tooltip-wrapper"
position="bottom"
title={copied ? t('copiedExclamation') : t('copyToClipboard')}
>
<div className="qr-code__address">{toChecksumHexAddress(data)}</div>
<Icon
name={copied ? ICON_NAMES.COPY_SUCCESS : ICON_NAMES.COPY}
size={ICON_SIZES.SM}
marginInlineStart={3}
/>
</div>
</Tooltip>
<div
className="qr-code__address-container"
onClick={() => {
handleCopy(toChecksumHexAddress(data));
}}
>
<div className="qr-code__address">{toChecksumHexAddress(data)}</div>
<Icon
name={copied ? ICON_NAMES.COPY_SUCCESS : ICON_NAMES.COPY}
size={ICON_SIZES.SM}
marginInlineStart={3}
/>
</div>
</Tooltip>
)}
</div>
);
}
Expand Down

0 comments on commit d1422df

Please sign in to comment.