Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/components/Common/QRCode.js
import React, { useState } from 'react'; | import React, { useState } from 'react'; | ||||
import styled from 'styled-components'; | import styled from 'styled-components'; | ||||
import RawQRCode from 'qrcode.react'; | import { default as ReactQRCode } from 'react-qr-code'; | ||||
import { currency } from '@components/Common/Ticker.js'; | import { currency } from '@components/Common/Ticker.js'; | ||||
import { CopyToClipboard } from 'react-copy-to-clipboard'; | import { CopyToClipboard } from 'react-copy-to-clipboard'; | ||||
import { Event } from '@utils/GoogleAnalytics'; | import { Event } from '@utils/GoogleAnalytics'; | ||||
export const StyledRawQRCode = styled(RawQRCode)` | export const StyledQRCode = styled(ReactQRCode)` | ||||
cursor: pointer; | cursor: pointer; | ||||
border-radius: 23px; | border-radius: 23px; | ||||
background: #ffffff; | background: #ffffff; | ||||
box-shadow: rgba(0, 0, 0, 0.01) 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 4px 8px, | box-shadow: rgba(0, 0, 0, 0.01) 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 4px 8px, | ||||
rgba(0, 0, 0, 0.04) 0px 16px 24px, rgba(0, 0, 0, 0.01) 0px 24px 32px; | rgba(0, 0, 0, 0.04) 0px 16px 24px, rgba(0, 0, 0, 0.01) 0px 24px 32px; | ||||
margin-bottom: 10px; | margin-bottom: 10px; | ||||
border: 1px solid #e9eaed; | border: 1px solid #e9eaed; | ||||
path:first-child { | path:first-child { | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | return ( | ||||
<div style={{ position: 'relative' }} onClick={handleOnClick}> | <div style={{ position: 'relative' }} onClick={handleOnClick}> | ||||
<Copied | <Copied | ||||
bch={address && address.includes('bitcoin') ? 1 : 0} | bch={address && address.includes('bitcoin') ? 1 : 0} | ||||
style={{ display: visible ? null : 'none' }} | style={{ display: visible ? null : 'none' }} | ||||
> | > | ||||
Copied | Copied | ||||
</Copied> | </Copied> | ||||
<StyledRawQRCode | <StyledQRCode | ||||
id="borderedQRCode" | id="borderedQRCode" | ||||
value={address || ''} | value={address || ''} | ||||
size={size} | size={size} | ||||
bch={address && address.includes('bitcoin') ? 1 : 0} | bch={address && address.includes('bitcoin') ? 1 : 0} | ||||
renderAs={'svg'} | renderAs={'svg'} | ||||
includeMargin | includeMargin | ||||
imageSettings={{ | imageSettings={{ | ||||
src: | src: | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |