From 7e9031292b1f0f1e210c3a77213a833ebf2e5370 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Thu, 4 Aug 2022 15:24:25 -0600 Subject: [PATCH] Put sharing qr code in modal --- web/pages/challenges/index.tsx | 147 ++++++++++++++++++--------------- 1 file changed, 80 insertions(+), 67 deletions(-) diff --git a/web/pages/challenges/index.tsx b/web/pages/challenges/index.tsx index 9553bb95..40e00084 100644 --- a/web/pages/challenges/index.tsx +++ b/web/pages/challenges/index.tsx @@ -27,6 +27,8 @@ import { Button } from 'web/components/button' import { ClipboardCopyIcon, QrcodeIcon } from '@heroicons/react/outline' import { copyToClipboard } from 'web/lib/util/copy' import toast from 'react-hot-toast' +import { Modal } from 'web/components/layout/modal' +import { QRCode } from 'web/components/qr-code' dayjs.extend(customParseFormat) const columnClass = 'sm:px-5 px-2 py-3.5 max-w-[100px] truncate' @@ -107,79 +109,90 @@ function YourChallengesTable(props: { links: Challenge[] }) { function YourLinkSummaryRow(props: { challenge: Challenge }) { const { challenge } = props const { acceptances } = challenge - + const [open, setOpen] = React.useState(false) const className = clsx( 'whitespace-nowrap text-sm hover:cursor-pointer text-gray-500 hover:bg-sky-50 bg-white' ) return ( - - - - {formatMoney(challenge.creatorAmount)} - - - - - - - - - - - - {acceptances.length > 0 ? ( - <> - - - - ) : ( - - No one - - {challenge.expiresTime && - ` (expires ${fromNow(challenge.expiresTime)})`} - + + - - + > + + + + + + + + + + {acceptances.length > 0 ? ( + <> + + + + ) : ( + + No one - + {challenge.expiresTime && + ` (expires ${fromNow(challenge.expiresTime)})`} + + )} + + + + ) }