Skip to content

Commit

Permalink
Feature/Added QR code in share survey modal
Browse files Browse the repository at this point in the history
  • Loading branch information
joharkhan99 authored Oct 15, 2024
1 parent 43b69cf commit 69d8551
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
34 changes: 34 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 @@ -40,6 +40,7 @@
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.2.0",
"react-qr-code": "^2.0.15",
"react-tooltip": "^5.25.1",
"recharts": "^2.4.3",
"sass": "^1.52.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Button, { ButtonVariant } from 'shared/components/Button/Button';
import StyledDialog from 'shared/components/StyledDialog/StyledDialog';
import useTranslation from 'next-translate/useTranslation';
import useCopyToClipboard from 'shared/hooks/useCopyToClipboard';
import QRCode from 'react-qr-code';

type ShareSurveyModalProps = {
surveyId: string;
Expand Down Expand Up @@ -32,6 +33,16 @@ export default function ShareSurveyModal({
title={t('shareSurveyModal.title')}
content={
<>
<div className="mt-4 flex justify-center">
<div className="w-1/2">
<QRCode
size={256}
style={{ height: 'auto', maxWidth: '100%', width: '100%' }}
value={link}
/>
</div>
</div>

<div className="mt-4">
<span className="scrollbar-hide block w-full select-all overflow-x-auto whitespace-nowrap rounded-md border border-gray-300 px-3 py-2 text-center text-sm focus:outline-none">
{link}
Expand Down

0 comments on commit 69d8551

Please sign in to comment.