Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add QR Code to ShareModal #2320

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"react-identicons": "^1.2.4",
"react-joyride": "^2.3.0",
"react-overlays": "^2.1.1",
"react-qr-code": "^2.0.15",
"react-scripts": "5.0.1",
"react-virtualized": "^9.22.3",
"redux-bundler": "^26.1.0",
Expand Down
10 changes: 8 additions & 2 deletions src/files/modals/share-modal/ShareModal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import QRCode from 'react-qr-code'
import ShareIcon from '../../../icons/StrokeShare.js'
import Button from '../../../components/button/button.tsx'
import { withTranslation } from 'react-i18next'
Expand All @@ -9,8 +10,13 @@ import { Modal, ModalActions, ModalBody } from '../../../components/modal/Modal.
const ShareModal = ({ t, tReady, onLeave, link, className, ...props }) => (
<Modal {...props} className={className} onCancel={onLeave} >
<ModalBody title={t('shareModal.title')} Icon={ShareIcon}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if we show QR code, we should not waste vertical space for Icon:

image

Then, thanks to reclaimed space, you can make QR code bigger.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited as suggested

image

<p className='charcoal w-90 tl center'>{t('shareModal.description')}</p>

<p className='charcoal w-90 center'>{t('shareModal.description')}</p>
<div className='flex justify-center pb3'>
<QRCode
size={100}
value={link}
/>
</div>
<div className='flex center w-90 pb2'>
<input
value={link}
Expand Down
Loading