From 0cc8688ae1302cb4572d83bb002ccbe709fd147c Mon Sep 17 00:00:00 2001 From: Raja Ilayaperumal Date: Wed, 7 Sep 2022 13:08:46 +0530 Subject: [PATCH] fix: .btc holders were not able to vote. Copy share link and QR code both are introduced. --- common/constants.js | 4 +- components/builder/BuilderComponent.js | 18 ++- components/common/HeaderComponent.js | 101 ++++++++++++---- components/common/InformationComponent.js | 3 +- .../dashboard/DashboardAllPollsComponent.js | 6 +- .../dashboard/DashboardMenuComponent.js | 21 +++- components/poll/PollComponent.js | 13 +- components/poll/QRCodePopup.js | 113 ++++++++++++++++++ node_modules/.package-lock.json | 8 ++ package-lock.json | 15 +++ package.json | 1 + pages/index.js | 21 +++- pages/p/[[...id]].js | 12 +- public/images/logo/ballot.png | Bin 5079 -> 2208 bytes services/contract.js | 5 +- styles/QRCodePopup.module.css | 27 +++++ yarn.lock | 5 + 17 files changed, 318 insertions(+), 55 deletions(-) create mode 100644 components/poll/QRCodePopup.js create mode 100644 styles/QRCodePopup.module.css diff --git a/common/constants.js b/common/constants.js index 9e4c2cfc..02e0b469 100644 --- a/common/constants.js +++ b/common/constants.js @@ -5,7 +5,7 @@ export const Constants = { GAIA_HUB_PREFIX: "https://gaia.blockstack.org/hub/", // IPFS gateway - IPFS_GATEWAY: "https://ipfs.owl.link/ipfs/", + IPFS_GATEWAY: "https://cloudflare-ipfs.com/ipfs/", // FAQs FAQ: [ @@ -31,7 +31,7 @@ export const Constants = { }, { question: "Who are the developers of Ballot.gg?", - answer: `We are developers from Team BlockSurvey.`, + answer: `We are developers from Team BlockSurvey ↗.`, } ] }; diff --git a/components/builder/BuilderComponent.js b/components/builder/BuilderComponent.js index a2c8225d..cb6becc6 100644 --- a/components/builder/BuilderComponent.js +++ b/components/builder/BuilderComponent.js @@ -7,6 +7,7 @@ import { getRecentBlock } from "../../services/utils"; import { getFileFromGaia, getMyStxAddress, getUserData, putFileToGaia } from "../../services/auth.js"; import styles from "../../styles/Builder.module.css"; import PreviewComponent from "./Preview.component"; +import { nanoid } from 'nanoid' export default function BuilderComponent(props) { // Variables @@ -327,7 +328,7 @@ export default function BuilderComponent(props) { pollObject['endAtBlock'] = calculateBlockTime(new Date(pollObject?.endAtDate).getTime(), currentBlock?.height); } - const contractName = "ballot-" + getTitleWithOutSpecialChar(); + const contractName = "ballot-" + getTitleWithOutSpecialChar() + "-" + nanoid(5); pollObject["publishedInfo"] = { "contractAddress": getMyStxAddress(), "contractName": contractName @@ -338,7 +339,7 @@ export default function BuilderComponent(props) { const publishContract = (contractName) => { // Publish contract - deployContract(pollObject, contractName, callbackFunction); + deployContract(pollObject, contractName, callbackFunction, cancelCallbackFunction); } const callbackFunction = (data) => { @@ -353,6 +354,10 @@ export default function BuilderComponent(props) { } } + const cancelCallbackFunction = (data) => { + window.location.reload(); + } + const publishPollToIPFS = async () => { setCurrentProgressMessage("Publishing to IPFS ..."); @@ -390,7 +395,7 @@ export default function BuilderComponent(props) { } const getTitleWithOutSpecialChar = () => { - return pollObject?.title?.replace(/[^a-zA-Z0-9]/g, ''); + return pollObject?.title?.replace(/\s+/g, '-').replace(/[^a-zA-Z0-9-]/g, '').substr(0, 16); } return ( @@ -404,7 +409,7 @@ export default function BuilderComponent(props) {

{pollId && pollId === "new" ? "New" : "Edit"} Poll

{pollObject && pollObject.id ? -
+ Title @@ -491,6 +496,7 @@ export default function BuilderComponent(props) { id="voting-strategy-id" name="votingStrategyFlag" onChange={handleChange} + checked={pollObject.votingStrategyFlag} /> @@ -498,7 +504,9 @@ export default function BuilderComponent(props) { <> Default strategy - + diff --git a/components/common/HeaderComponent.js b/components/common/HeaderComponent.js index 391388b2..da79da20 100644 --- a/components/common/HeaderComponent.js +++ b/components/common/HeaderComponent.js @@ -1,11 +1,25 @@ import { formStacksExplorerUrl } from "../../services/utils"; - +import Tooltip from "react-bootstrap/Tooltip"; +import { useState } from "react"; +import OverlayTrigger from "react-bootstrap/OverlayTrigger"; +import QRCodePopup from "../poll/QRCodePopup"; export default function HeaderComponent(props) { // Variables - const { pollObject } = props; + const { pollObject, publicUrl } = props; + + const [copyText, setCopyText] = useState("Copy"); + const [showQRCodePopupFlag, setShowQRCodePopupFlag] = useState(false); // Function + const copyToClipBoard = () => { + if (pollObject?.id) { + // Update tooltip message + setCopyText("Copied"); + + navigator.clipboard.writeText(publicUrl); + } + }; // Design return ( @@ -16,29 +30,63 @@ export default function HeaderComponent(props) {

{pollObject?.title}

{/* Info Bar */} -
- {pollObject?.status == "draft" ? "Draft" : "Active"} {' '} - {pollObject?.userStxAddress && - - - {pollObject?.userStxAddress?.substring(0, 10)} { } - - - - - - } +
+ {/* Status */} +
+ {pollObject?.status == "draft" ? "Draft" : "Active"} {' '} +
+ + {/* Created by */} +
+ Created by {' '} + {pollObject?.userStxAddress && + + + {pollObject?.userStxAddress?.substring(0, 10)} { } + + + + + + } +
+ + {/* Copy link */} + {copyText}}> + + + + {/* QR code */} + QR code}> + +
{/* Description */} @@ -50,6 +98,9 @@ export default function HeaderComponent(props) {
} + + ); } \ No newline at end of file diff --git a/components/common/InformationComponent.js b/components/common/InformationComponent.js index 56477761..806784e4 100644 --- a/components/common/InformationComponent.js +++ b/components/common/InformationComponent.js @@ -1,3 +1,4 @@ +import { Constants } from "../../common/constants"; import { convertToDisplayDateFormat, formStacksExplorerUrl } from "../../services/utils"; @@ -47,7 +48,7 @@ export default function InformationComponent(props) { pollObject?.ipfsLocation && diff --git a/components/dashboard/DashboardMenuComponent.js b/components/dashboard/DashboardMenuComponent.js index c6054468..7c5fe0a9 100644 --- a/components/dashboard/DashboardMenuComponent.js +++ b/components/dashboard/DashboardMenuComponent.js @@ -1,5 +1,6 @@ import Link from "next/link"; import { Container, Row, Col, Button } from "react-bootstrap"; +import { signOut } from "../../services/auth"; export default function DashboardMenuComponent() { @@ -8,23 +9,35 @@ export default function DashboardMenuComponent() { -

Ballot

+
-
-
+
-
+ +
+ +
diff --git a/components/poll/PollComponent.js b/components/poll/PollComponent.js index 1174d6d8..1db17df1 100644 --- a/components/poll/PollComponent.js +++ b/components/poll/PollComponent.js @@ -23,7 +23,8 @@ export default function PollComponent(props) { noHoldingToken, holdingTokenArr, holdingTokenIdArr, - votingPower } = props; + votingPower, + publicUrl } = props; // Capture the vote const [voteObject, setVoteObject] = useState({}); @@ -82,7 +83,7 @@ export default function PollComponent(props) { {/* Left Side */}
{/* Header */} - + {/* Cast your vote */}
@@ -103,13 +104,13 @@ export default function PollComponent(props) { ))} {userSession && userSession.isUserSignedIn() ? - : - @@ -125,7 +126,7 @@ export default function PollComponent(props) { {/* Already voted */} {alreadyVoted &&
- You have already cast your vote. + Your vote has already been cast.
} @@ -204,7 +205,7 @@ export default function PollComponent(props) { Information - Successfully! You have cast your vote. Check your transaction status on explorer + Voted successfully! Your vote has been cast. Here is a link to your transaction status { + props.setShowQRCodePopupFlag(false); + }; + + // Functions + // Download QR code + const downloadQRCode = () => { + const qrCodeURL = document + .getElementById("qrCodeEl") + .toDataURL("image/png") + .replace("image/png", "image/octet-stream"); + let aEl = document.createElement("a"); + aEl.href = qrCodeURL; + aEl.download = "Ballot_" + (pollObject?.title ? pollObject?.title.replaceAll(".", "_") : "") + ".png"; + document.body.appendChild(aEl); + aEl.click(); + document.body.removeChild(aEl); + }; + + // View + return ( + <> + {/* QR code */} + + {/* Header */} +
+
Ballot QR code
+ +
+ + {/* Body */} +
+ + + ); +} diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 7ad205a0..e85c1fce 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -3112,6 +3112,14 @@ "node": ">=6" } }, + "node_modules/qrcode.react": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz", + "integrity": "sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/query-string": { "version": "6.14.1", "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz", diff --git a/package-lock.json b/package-lock.json index afa70cfa..e7cf2d40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "lodash": "^4.17.21", "nanoid": "^4.0.0", "next": "12.2.5", + "qrcode.react": "^3.1.0", "react": "18.2.0", "react-bootstrap": "^2.5.0", "react-dom": "18.2.0", @@ -3315,6 +3316,14 @@ "node": ">=6" } }, + "node_modules/qrcode.react": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz", + "integrity": "sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/query-string": { "version": "6.14.1", "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz", @@ -6365,6 +6374,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "qrcode.react": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz", + "integrity": "sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==", + "requires": {} + }, "query-string": { "version": "6.14.1", "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz", diff --git a/package.json b/package.json index 79431a7d..ff5b0ca9 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "lodash": "^4.17.21", "nanoid": "^4.0.0", "next": "12.2.5", + "qrcode.react": "^3.1.0", "react": "18.2.0", "react-bootstrap": "^2.5.0", "react-dom": "18.2.0", diff --git a/pages/index.js b/pages/index.js index d28103e9..c2f559b4 100644 --- a/pages/index.js +++ b/pages/index.js @@ -155,9 +155,9 @@ export default function Home() { {/* Steps */}
-
+
{/* Step 1 */} -
+
{/* Image */}
@@ -168,7 +168,7 @@ export default function Home() { {/* Text */}

- Sign in to Ballot.gg
using Hiro Wallet + Sign in to Ballot.gg using Hiro Wallet.

@@ -179,9 +179,7 @@ export default function Home() {
-
-
{/* Step 2 */}
{/* Image */} @@ -261,8 +259,19 @@ export default function Home() { */} + {/* GitHub */} + + + + {/* Discard */} - +
diff --git a/public/images/logo/ballot.png b/public/images/logo/ballot.png index 92dbfcb3aa58fe209798bfa2ffe11584797642d3..dfc4c0dc7edaec42ed768427d1e78f09a151e22a 100644 GIT binary patch delta 2161 zcmV-%2#)vHC!i6KD+>z~000XU0RWnu7?Cy~e+V^6L_t(|0qxySP!vZL2JqLt&ghMJN z)&P3Lok_oeB?!3ePWS9i&wjtEt%YUvvR}P^)7{f6$N<-Mt1?6_o+q266t#lV&D_0R0~v z?-ZfJB#0PLLAqFIkO~UWbN9ss1Si=9$)0zdw=d@Z{yeCvQ}>GGUG?TBg2Yq(>r4fC z2lA;#a=SOoyDyJrNKPO;E&*hv#FslND{pRmc~gM6Vdn9VFl@o=7EVeeN)+ix7u$fwI*gPt|79j3>xC1AEtu;M+?)I#IVQmOo9lD+nKyEyg?NUS8e**uq zR)Lm1*+T%^t9s?psq8O71w!?K0kuZ>eDEFEL}iIeCN%!I}!nM zK!89G0t8wRAkcyUfffV^v>-sBf2D$AZikbmxT&tGp>#SOJZjX>)zvjr-_W2QyMy1$ ziI{g6eTuO-1}GN}*WTu4YHMp(&-*Cp5TFQU!_;-=Y+@@D0#qce?d^#S5}N2DxidIO zA2c@5_upNnBtZo#0Up}!-5*XwH9`d{fw|dP`s~w>X?kjkY=;1qNK!(Ce*l%x;^Lz9 zAwqykj6-zvNPF;XBLpZ0csR55>I?yjiT=JmdNe*xwn2bm#KtO=_<10nYiU*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hTcE-)L@`6 zaGPGO&!5pnJcx0k4Rv7zWT*=xAVXcCfQn!+)J73w&=MF7H9?9NE!$IIFw_7Ad(NVS z6u@Ap0ZK{U%2-A~hT6#3R>6YRa)C+7_(6thDdqFO$y@pSSP6(_tdOB9DA2#+p67uG zl-~e@p*r5de}9}rVj1$L88f7YLh)~BPMpG*TtL{2Q45R}GNgkrgX7|LWmv0p%vd2q z8c5lGRlN2DWUP=O4TREHnO2J8y{|LXu|lSA%n$);!=~f%A)kQI3K3!-27^HXCG@Cl zeUQ-D%HpMeeY9)$w|fYXZ-c?$LV&*U*E1)M2ahYqe*;-%dXzcTCb?*Ez@`f|p+G4h z-jvz&hsGZ=pazI-KgD}26vWQE%;gRZP|JFcl^OuU`lBMAVpNgDY5Yb+>y#AYK@!JA z;|1_Sra4?g{_^002ovPDHLkV1h$|wpaiF diff --git a/services/contract.js b/services/contract.js index 98c37a92..87f9334e 100644 --- a/services/contract.js +++ b/services/contract.js @@ -2,7 +2,7 @@ import { openContractCall, openContractDeploy } from "@stacks/connect"; import { AnchorMode, bufferCV, listCV, stringAsciiCV, uintCV } from "@stacks/transactions"; import { getNetworkType } from "../services/auth"; -export async function deployContract(pollObject, contractName, callbackFunction) { +export async function deployContract(pollObject, contractName, callbackFunction, cancelCallbackFunction) { const contract = getContract(pollObject); // Transaction options @@ -16,6 +16,7 @@ export async function deployContract(pollObject, contractName, callbackFunction) icon: window.location.origin + "/images/logo/ballot.png" }, onFinish: callbackFunction, + onCancel: cancelCallbackFunction }; // Call contract function @@ -324,7 +325,7 @@ export async function castMyVoteContractCall(contractAddress, contractName, vote network: getNetworkType(), appDetails: { name: "Ballot", - icon: window.location.origin + "/images/logo/owllink.png", + icon: window.location.origin + "/images/logo/ballot.png", }, onFinish: callbackFunction, }; diff --git a/styles/QRCodePopup.module.css b/styles/QRCodePopup.module.css new file mode 100644 index 00000000..5cd47cd4 --- /dev/null +++ b/styles/QRCodePopup.module.css @@ -0,0 +1,27 @@ +/* Modal */ +.dashboard_modal_header_box { + position: relative; + padding: 20px; + font-size: 18px; + font-weight: 500; +} +.dashboard_modal_close_icon_btn_box { + position: absolute; + right: 20px; + top: 20px; + width: 24px; + height: 24px; + border-radius: 50%; + border: none; + display: flex; + align-items: center; + justify-content: center; + transition: 0.3s all ease; +} +.dashboard_modal_body_box { + padding: 14px 20px; +} +.dashboard_transactions_modal_body_box { + max-height: 360px; + overflow: auto; +} diff --git a/yarn.lock b/yarn.lock index 9f45d508..338a18a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1780,6 +1780,11 @@ "resolved" "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz" "version" "1.3.2" +"qrcode.react@^3.1.0": + "integrity" "sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==" + "resolved" "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz" + "version" "3.1.0" + "query-string@^6.13.1": "integrity" "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==" "resolved" "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz"