add qrcode to receive page

This commit is contained in:
fmtabbara
2021-09-12 01:03:21 +01:00
parent bacbd3dfce
commit b299c9e4b5
3 changed files with 60 additions and 9 deletions
+2
View File
@@ -18,6 +18,7 @@
"@types/react-dom": "^17.0.9",
"bs58": "^4.0.1",
"clsx": "^1.1.1",
"qrcode.react": "^1.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-error-boundary": "^3.1.3",
@@ -34,6 +35,7 @@
"@tauri-apps/api": "^1.0.0-beta.6",
"@tauri-apps/cli": "^1.0.0-beta.9",
"@types/bs58": "^4.0.1",
"@types/qrcode.react": "^1.0.2",
"@types/react-router-dom": "^5.1.8",
"@types/semver": "^7.3.8",
"babel-loader": "^8.2.2",
+35 -7
View File
@@ -1,5 +1,6 @@
import React, { useContext } from 'react'
import { Card, Grid, Typography } from '@material-ui/core'
import QRCode from 'qrcode.react'
import { Box, Card, Grid, Typography } from '@material-ui/core'
import { Alert } from '@material-ui/lab'
import { useMediaQuery } from '@material-ui/core'
import { CopyToClipboard, NymCard } from '../components'
@@ -31,13 +32,40 @@ export const Receive = () => {
}}
variant="outlined"
>
<Typography
variant={matches ? 'h5' : 'subtitle1'}
style={{ wordBreak: 'break-word' }}
<Grid
container
direction="column"
spacing={4}
alignItems="center"
>
{clientDetails?.client_address}
</Typography>
<CopyToClipboard text={clientDetails?.client_address || ''} />
<Grid item>
<Typography
variant={matches ? 'h5' : 'subtitle1'}
style={{
wordBreak: 'break-word',
marginRight: theme.spacing(1),
}}
component="span"
>
{clientDetails?.client_address}
</Typography>
<CopyToClipboard text={clientDetails?.client_address || ''} />
</Grid>
<Grid item>
<Box
style={{
display: 'flex',
justifyContent: 'center',
marginBottom: theme.spacing(2),
}}
component="div"
>
{clientDetails && (
<QRCode value={clientDetails.client_address} />
)}
</Box>
</Grid>
</Grid>
</Card>
</Grid>
</Grid>
+23 -2
View File
@@ -1516,6 +1516,13 @@
"resolved" "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.4.tgz"
"version" "15.7.4"
"@types/qrcode.react@^1.0.2":
"integrity" "sha512-I9Oq5Cjlkgy3Tw7krCnCXLw2/zMhizkTere49OOcta23tkvH0xBTP0yInimTh0gstLRtb8Ki9NZVujE5UI6ffQ=="
"resolved" "https://registry.npmjs.org/@types/qrcode.react/-/qrcode.react-1.0.2.tgz"
"version" "1.0.2"
dependencies:
"@types/react" "*"
"@types/react-dom@^17.0.9":
"integrity" "sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg=="
"resolved" "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.9.tgz"
@@ -6082,7 +6089,7 @@
"resolved" "https://registry.npmjs.org/process/-/process-0.11.10.tgz"
"version" "0.11.10"
"prop-types@^15.0.0", "prop-types@^15.6.2", "prop-types@^15.7.2":
"prop-types@^15.0.0", "prop-types@^15.6.0", "prop-types@^15.6.2", "prop-types@^15.7.2":
"integrity" "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ=="
"resolved" "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz"
"version" "15.7.2"
@@ -6149,6 +6156,20 @@
dependencies:
"escape-goat" "^2.0.0"
"qr.js@0.0.0":
"integrity" "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8="
"resolved" "https://registry.npmjs.org/qr.js/-/qr.js-0.0.0.tgz"
"version" "0.0.0"
"qrcode.react@^1.0.1":
"integrity" "sha512-8d3Tackk8IRLXTo67Y+c1rpaiXjoz/Dd2HpcMdW//62/x8J1Nbho14Kh8x974t9prsLHN6XqVgcnRiBGFptQmg=="
"resolved" "https://registry.npmjs.org/qrcode.react/-/qrcode.react-1.0.1.tgz"
"version" "1.0.1"
dependencies:
"loose-envify" "^1.4.0"
"prop-types" "^15.6.0"
"qr.js" "0.0.0"
"qs@~6.5.2":
"integrity" "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
"resolved" "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz"
@@ -6287,7 +6308,7 @@
"loose-envify" "^1.4.0"
"prop-types" "^15.6.2"
"react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0", "react@^16.8.0 || ^17", "react@^16.8.0 || ^17.0.0", "react@^17.0.2", "react@>=15", "react@>=16.13.1", "react@>=16.6.0", "react@17.0.2":
"react@^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0", "react@^15.5.3 || ^16.0.0 || ^17.0.0", "react@^16.8.0 || ^17", "react@^16.8.0 || ^17.0.0", "react@^17.0.2", "react@>=15", "react@>=16.13.1", "react@>=16.6.0", "react@17.0.2":
"integrity" "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA=="
"resolved" "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz"
"version" "17.0.2"