Skip to content

Commit 5dbccfd

Browse files
badgooooorSgtPooki
andauthored
feat: add QR Code to ShareModal (#2320)
* add dependency * add qr code to share modal * remove share file icon and increase size of qr code * chore: fix dep-check --------- Co-authored-by: Russell Dempsey <[email protected]>
1 parent 878975a commit 5dbccfd

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

.aegir.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default {
2828
'react-identicons',
2929
'react-joyride',
3030
'react-overlays',
31+
'react-qr-code',
3132
'react-virtualized',
3233
'redux-bundler-react',
3334
'tachyons',

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"react-identicons": "^1.2.4",
9797
"react-joyride": "^2.3.0",
9898
"react-overlays": "^2.1.1",
99+
"react-qr-code": "^2.0.15",
99100
"react-scripts": "5.0.1",
100101
"react-virtualized": "^9.22.3",
101102
"redux-bundler": "^26.1.0",

src/files/modals/share-modal/ShareModal.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import ShareIcon from '../../../icons/StrokeShare.js'
3+
import QRCode from 'react-qr-code'
44
import Button from '../../../components/button/button.tsx'
55
import { withTranslation } from 'react-i18next'
66
import { CopyToClipboard } from 'react-copy-to-clipboard'
77
import { Modal, ModalActions, ModalBody } from '../../../components/modal/Modal.js'
88

99
const ShareModal = ({ t, tReady, onLeave, link, className, ...props }) => (
1010
<Modal {...props} className={className} onCancel={onLeave} >
11-
<ModalBody title={t('shareModal.title')} Icon={ShareIcon}>
12-
<p className='charcoal w-90 tl center'>{t('shareModal.description')}</p>
13-
11+
<ModalBody title={t('shareModal.title')}>
12+
<p className='charcoal w-90 center'>{t('shareModal.description')}</p>
13+
<div className='flex justify-center pb3'>
14+
<QRCode
15+
size={180}
16+
value={link}
17+
/>
18+
</div>
1419
<div className='flex center w-90 pb2'>
1520
<input
1621
value={link}

0 commit comments

Comments
 (0)