From a094d212c4e53336f9c778bfe458c385ed30ec21 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Mon, 7 Aug 2023 15:26:35 +0530 Subject: [PATCH 1/9] updated banner --- src/components/common/ProgressTracker.jsx | 62 +++++++++++++------ .../fractalVerification/SuccessPage.jsx | 57 ++++++++++++++--- .../fractalVerification/TabScreens.jsx | 11 ++-- 3 files changed, 96 insertions(+), 34 deletions(-) diff --git a/src/components/common/ProgressTracker.jsx b/src/components/common/ProgressTracker.jsx index 91d9381..23a7e8f 100644 --- a/src/components/common/ProgressTracker.jsx +++ b/src/components/common/ProgressTracker.jsx @@ -9,6 +9,7 @@ const ProgressTracker = () => { const ProgressMeterMax = process.env.REACT_APP_PROGRESS_METER_MAX ?? 3000; const [humansRegistered, setHumansRegistered] = useState(0); const { showTracker } = useSelector((state) => state[ReducerNames.PROGRESS]); + const { fvToken } = useSelector((state) => state[ReducerNames.SBT]); const fetchHumansRegistered = async () => { try { @@ -71,26 +72,47 @@ const ProgressTracker = () => { JOIN {humansRegistered} HUMANS TO REACH {ReadableNumber} VOTERS - -
-

- JOIN THE HUMANS OF NEAR -

-

- Unlock Elections, Governance, & Community Treasury with{' '} - {ReadableNumber} Humans on NEAR -

- +
+ {fvToken ? ( +
+

+ Learn about how to protect integrity of the election and how + to submit to the Whistleblower Bounty Program +

+ +
+ ) : ( +
+

+ JOIN THE HUMANS OF NEAR +

+

+ Unlock Elections, Governance, & Community Treasury with{' '} + {ReadableNumber} Humans on NEAR +

+ +
+ )}
diff --git a/src/components/fractalVerification/SuccessPage.jsx b/src/components/fractalVerification/SuccessPage.jsx index 696f3c9..2699fae 100644 --- a/src/components/fractalVerification/SuccessPage.jsx +++ b/src/components/fractalVerification/SuccessPage.jsx @@ -23,18 +23,55 @@ export const SuccesVerification = () => { height={document.body.offsetHeight} /> )} -
-
-
- +
+
+
+
+ +
+
+

Success!

+

+ Check out your newly minted Soul Bound Tokens! You can now + participate in Near Digital Collective (NDC) governance. Share the + good news! +

+ +
+
+

+ Before you vote in the general election, learn about the + Whistleblower Bounty Program. +

+

+ The{' '} + window.open('', '_blank')} + className="text-purple-300" + > + Whistleblower bounty program + {' '} + offers up to 2,000 NEAR for whistleblowers who come forward to share + instances of vote buying, account buying, election fraud, and other + violations of the{' '} + window.open('', '_blank')} + className="text-purple-300" + > + Fair voting policy. + +
+ Please make sure to read and understand the Fair voting policy, + which outlines the responsibilities of each voter. Cancel I + understand my responsibilities as a voter +

+
+ +
-

Success!

-

- Check out your newly minted Soul Bound Tokens! You can now participate - in Near Digital Collective (NDC) governance. Share the good news! -

-
); diff --git a/src/components/fractalVerification/TabScreens.jsx b/src/components/fractalVerification/TabScreens.jsx index 5235968..9539a1f 100644 --- a/src/components/fractalVerification/TabScreens.jsx +++ b/src/components/fractalVerification/TabScreens.jsx @@ -132,13 +132,16 @@ export const MintSBT = ({ setError, isError }) => {

- We will be back in a bit. + We will be back in a bit! We will be back in a bit.

- This system is undergoing maintenance to ensure you get - the best experience. Please check back later! + We have been impacted by the Aug 2, 2023 NEAR mainnet + upgrade which unfortunately contained a runtime error and + caused unexpected contract behavior. The Pagoda protocol + team is working on patching the mainnet. Please check back + later!

-

Thank you for your understanding!

+

Thank you for your patience!

From ddd9d098a05040fd9ea5e5807f1deebf82d8b32e Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Mon, 7 Aug 2023 23:21:10 +0530 Subject: [PATCH 2/9] updated maintenance banner text, added whistleblower banner --- src/components/common/ProgressTracker.jsx | 2 +- .../fractalVerification/SuccessPage.jsx | 58 ++++++++++++------- src/utils/constants.js | 2 + 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/components/common/ProgressTracker.jsx b/src/components/common/ProgressTracker.jsx index 23a7e8f..d918542 100644 --- a/src/components/common/ProgressTracker.jsx +++ b/src/components/common/ProgressTracker.jsx @@ -83,7 +83,7 @@ const ProgressTracker = () => { className="bg-yellow-300 rounded-lg py-1.5 px-2 text-sm" onClick={() => window.open( - 'https://pages.near.org/blog/ndc-v1-governance-elections-faq/', + 'https://medium.com/@neardigitalcollective/introducing-ndc-whistleblower-bounty-program-d4fe1b9fc5a0', '_blank' ) } diff --git a/src/components/fractalVerification/SuccessPage.jsx b/src/components/fractalVerification/SuccessPage.jsx index 2699fae..e61b0fe 100644 --- a/src/components/fractalVerification/SuccessPage.jsx +++ b/src/components/fractalVerification/SuccessPage.jsx @@ -2,6 +2,8 @@ import React, { useEffect, useState } from 'react'; import ReactConfetti from 'react-confetti'; import { CircleWavyCheck } from '../../images/CircleWavyCheck'; import TokensGrid from '../common/TokensGrid'; +import { OutlineButton, PrimaryButton } from '../common/Buttons'; +import { ImageSrc } from '../../utils/constants'; export const SuccesVerification = () => { const [showConfetti, setShowConfetti] = useState(true); @@ -15,6 +17,17 @@ export const SuccesVerification = () => { }; }, []); + const Link = ({ link, text }) => { + return ( + window.open(link, '_blank')} + className="text-purple-600 cursor-pointer decoration-solid underline" + > + {text} + + ); + }; + return (
{showConfetti && ( @@ -40,36 +53,41 @@ export const SuccesVerification = () => {

-
-

+
+ +

Before you vote in the general election, learn about the Whistleblower Bounty Program.

The{' '} - window.open('', '_blank')} - className="text-purple-300" - > - Whistleblower bounty program - {' '} + {' '} offers up to 2,000 NEAR for whistleblowers who come forward to share instances of vote buying, account buying, election fraud, and other - violations of the{' '} - window.open('', '_blank')} - className="text-purple-300" - > - Fair voting policy. - + violations of the +

- Please make sure to read and understand the Fair voting policy, - which outlines the responsibilities of each voter. Cancel I - understand my responsibilities as a voter + Please make sure to read and understand the{' '} + , which outlines the + responsibilities of each voter.

- - + + Cancel + + +

+ I understand my responsibilities as a voter +

+

diff --git a/src/utils/constants.js b/src/utils/constants.js index 03d2d23..8bf0d3f 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -95,4 +95,6 @@ export const ImageSrc = { 'https://bafkreialtxsodm5coxfkkec4ybakyghk7horpxnyuifg4la4ye6vjhlf64.ipfs.nftstorage.link/', CommunityFund: 'https://bafkreicvwvjtybib7nodjus5ynomjasp3xskz2et5tkrx6k7t3h7dsq2za.ipfs.nftstorage.link/', + ELECTION_ICON: + 'https://bafkreidrd4ci3p23e7zttaq5ukpzeddyzvfdm37x3xomju3rgeq77f2dba.ipfs.nftstorage.link/', }; From 5da8301c563caddfd4973bfc9d3ae2d33d93f60e Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Mon, 7 Aug 2023 23:42:28 +0530 Subject: [PATCH 3/9] updated UI for banner --- .../FvVerificationTabs.jsx | 15 +- .../fractalVerification/SuccessPage.jsx | 162 ++++++++++-------- src/redux/reducer/commonReducer.js | 5 + 3 files changed, 106 insertions(+), 76 deletions(-) diff --git a/src/components/fractalVerification/FvVerificationTabs.jsx b/src/components/fractalVerification/FvVerificationTabs.jsx index 6a00a45..e1b51de 100644 --- a/src/components/fractalVerification/FvVerificationTabs.jsx +++ b/src/components/fractalVerification/FvVerificationTabs.jsx @@ -10,10 +10,13 @@ import { updateResponse } from '../../redux/reducer/oracleReducer'; import { insertUserData, log_event } from '../../utils/utilityFunctions'; import ReactConfetti from 'react-confetti'; import { ImageSrc, ReducerNames } from '../../utils/constants'; -import { setActivePageIndex } from '../../redux/reducer/commonReducer'; +import { + setActivePageIndex, + updateShowConfetti, +} from '../../redux/reducer/commonReducer'; const FvVerificationTabs = ({ tabs, error }) => { - const { activePageIndex, isSuccessSBTPage } = useSelector( + const { activePageIndex, isSuccessSBTPage, showConfetti } = useSelector( (state) => state[ReducerNames.COMMON] ); const dispatch = useDispatch(); @@ -23,7 +26,6 @@ const FvVerificationTabs = ({ tabs, error }) => { redirect_uri: '', }); const [loading, setLoading] = useState(true); - const [showConfetti, setShowConfetti] = useState(false); const { executeRecaptcha } = useGoogleReCaptcha(); async function checkIsUserVerified() { @@ -92,16 +94,15 @@ const FvVerificationTabs = ({ tabs, error }) => { }, [executeRecaptcha]); useEffect(() => { - if (isSuccessSBTPage) { - setShowConfetti(true); + if (showConfetti) { let timer = setTimeout(() => { - setShowConfetti(false); + dispatch(updateShowConfetti(false)); }, 5000); return () => { clearTimeout(timer); }; } - }, [isSuccessSBTPage]); + }, [showConfetti]); return ( <> diff --git a/src/components/fractalVerification/SuccessPage.jsx b/src/components/fractalVerification/SuccessPage.jsx index e61b0fe..3fa16eb 100644 --- a/src/components/fractalVerification/SuccessPage.jsx +++ b/src/components/fractalVerification/SuccessPage.jsx @@ -1,21 +1,15 @@ -import React, { useEffect, useState } from 'react'; -import ReactConfetti from 'react-confetti'; +import React, { Fragment, useState } from 'react'; import { CircleWavyCheck } from '../../images/CircleWavyCheck'; import TokensGrid from '../common/TokensGrid'; import { OutlineButton, PrimaryButton } from '../common/Buttons'; import { ImageSrc } from '../../utils/constants'; +import { Dialog, Transition } from '@headlessui/react'; +import { useDispatch } from 'react-redux'; +import { updateShowConfetti } from '../../redux/reducer/commonReducer'; export const SuccesVerification = () => { - const [showConfetti, setShowConfetti] = useState(true); - - useEffect(() => { - let timer = setTimeout(() => { - setShowConfetti(false); - }, 5000); - return () => { - clearTimeout(timer); - }; - }, []); + const [showModal, setShowModal] = useState(true); + const dispatch = useDispatch(); const Link = ({ link, text }) => { return ( @@ -28,68 +22,98 @@ export const SuccesVerification = () => { ); }; + function removeModal() { + setShowModal(false); + dispatch(updateShowConfetti(true)); + } + return ( -
- {showConfetti && ( - - )} -
-
-
-
- +
+ + + +
+ + +
+
+ + +
+ +

+ Before you vote in the general election, learn about the + Whistleblower Bounty Program. +

+

+ The{' '} + {' '} + offers up to 2,000 NEAR for whistleblowers who come + forward to share instances of vote buying, account buying, + election fraud, and other violations of the{' '} + +
+
+ Please make sure to read and understand the{' '} + , which + outlines the responsibilities of each voter. +

+
+ + Cancel + + +

+ I understand my responsibilities as a voter +

+
+
+
+
+
-

Success!

-

- Check out your newly minted Soul Bound Tokens! You can now - participate in Near Digital Collective (NDC) governance. Share the - good news! -

- -
-
- -

- Before you vote in the general election, learn about the - Whistleblower Bounty Program. -

-

- The{' '} - {' '} - offers up to 2,000 NEAR for whistleblowers who come forward to share - instances of vote buying, account buying, election fraud, and other - violations of the -
-
- Please make sure to read and understand the{' '} - , which outlines the - responsibilities of each voter. -

-
- - Cancel - - -

- I understand my responsibilities as a voter -

-
+
+
+
+
+
+
+

Success!

+

+ Check out your newly minted Soul Bound Tokens! You can now participate + in Near Digital Collective (NDC) governance. Share the good news! +

+
); diff --git a/src/redux/reducer/commonReducer.js b/src/redux/reducer/commonReducer.js index b244c27..c265b32 100644 --- a/src/redux/reducer/commonReducer.js +++ b/src/redux/reducer/commonReducer.js @@ -8,6 +8,7 @@ export const commonReducer = createSlice({ isAdmin: false, activePageIndex: null, // for verification screens isSuccessSBTPage: false, // to show success page + showConfetti: false, }, reducers: { updateUserLogin: (state, action) => { @@ -22,6 +23,9 @@ export const commonReducer = createSlice({ updateAdminLogin: (state, action) => { state.isAdmin = action.payload; }, + updateShowConfetti: (state, action) => { + state.showConfetti = action.payload; + }, }, }); @@ -30,6 +34,7 @@ export const { setActivePageIndex, setSuccessSBTPage, updateAdminLogin, + updateShowConfetti, } = commonReducer.actions; export default commonReducer.reducer; From 3df2d1655c4e842919460ab252bcf0b4fa52f9df Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Mon, 7 Aug 2023 23:43:47 +0530 Subject: [PATCH 4/9] updated storage deposit gas --- src/utils/nearWallet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/nearWallet.js b/src/utils/nearWallet.js index 6219ffd..341123b 100644 --- a/src/utils/nearWallet.js +++ b/src/utils/nearWallet.js @@ -49,7 +49,7 @@ const meteorWallet = setupMeteorWallet({ iconUrl: meteorIconUrl, }); -const DEFAULT_TGAS = '60000000000000'; +const DEFAULT_TGAS = '90000000000000'; const NO_DEPOSIT = '0'; // Wallet that simplifies using the wallet selector From ee281a392f59239b2c786ba295b8bf77d6097637 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Mon, 7 Aug 2023 23:53:50 +0530 Subject: [PATCH 5/9] added some styling --- src/components/fractalVerification/SuccessPage.jsx | 12 ++++++------ src/redux/reducer/commonReducer.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/fractalVerification/SuccessPage.jsx b/src/components/fractalVerification/SuccessPage.jsx index 3fa16eb..cfbab8e 100644 --- a/src/components/fractalVerification/SuccessPage.jsx +++ b/src/components/fractalVerification/SuccessPage.jsx @@ -54,11 +54,11 @@ export const SuccesVerification = () => { leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" > - -
+ +
@@ -79,8 +79,8 @@ export const SuccesVerification = () => {

Please make sure to read and understand the{' '} - , which - outlines the responsibilities of each voter. + , which outlines + the responsibilities of each voter.

Date: Tue, 8 Aug 2023 13:36:24 +0530 Subject: [PATCH 6/9] bug fix --- src/redux/reducer/commonReducer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/redux/reducer/commonReducer.js b/src/redux/reducer/commonReducer.js index cd38ea8..c265b32 100644 --- a/src/redux/reducer/commonReducer.js +++ b/src/redux/reducer/commonReducer.js @@ -6,8 +6,8 @@ export const commonReducer = createSlice({ initialState: { isUserLogin: false, isAdmin: false, - activePageIndex: 2, // for verification screens - isSuccessSBTPage: true, // to show success page + activePageIndex: null, // for verification screens + isSuccessSBTPage: false, // to show success page showConfetti: false, }, reducers: { From 4299b13d22c87677028b03b3076cd3a34de8586c Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Tue, 8 Aug 2023 13:37:54 +0530 Subject: [PATCH 7/9] text update --- src/components/fractalVerification/TabScreens.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/fractalVerification/TabScreens.jsx b/src/components/fractalVerification/TabScreens.jsx index 9539a1f..0d7340c 100644 --- a/src/components/fractalVerification/TabScreens.jsx +++ b/src/components/fractalVerification/TabScreens.jsx @@ -132,7 +132,7 @@ export const MintSBT = ({ setError, isError }) => {

- We will be back in a bit! We will be back in a bit. + We will be back in a bit.

We have been impacted by the Aug 2, 2023 NEAR mainnet From 6c6972fa47d14c08b2c33b1264e604dba7871fb0 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Tue, 8 Aug 2023 19:16:49 +0530 Subject: [PATCH 8/9] added links --- src/components/common/Buttons.jsx | 18 ++++++++-- src/components/common/ProgressTracker.jsx | 9 ++--- .../fractalVerification/SuccessPage.jsx | 33 ++++++++++++++----- src/utils/constants.js | 4 +++ 4 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/components/common/Buttons.jsx b/src/components/common/Buttons.jsx index 3637301..592fdfa 100644 --- a/src/components/common/Buttons.jsx +++ b/src/components/common/Buttons.jsx @@ -1,8 +1,15 @@ import React from 'react'; -export const OutlineButton = ({ onClick, children, classes, disabled }) => { +export const OutlineButton = ({ + onClick, + children, + classes, + disabled, + ref, +}) => { return ( diff --git a/src/components/fractalVerification/SuccessPage.jsx b/src/components/fractalVerification/SuccessPage.jsx index cfbab8e..2716bea 100644 --- a/src/components/fractalVerification/SuccessPage.jsx +++ b/src/components/fractalVerification/SuccessPage.jsx @@ -1,8 +1,8 @@ -import React, { Fragment, useState } from 'react'; +import React, { Fragment, useRef, useState } from 'react'; import { CircleWavyCheck } from '../../images/CircleWavyCheck'; import TokensGrid from '../common/TokensGrid'; import { OutlineButton, PrimaryButton } from '../common/Buttons'; -import { ImageSrc } from '../../utils/constants'; +import { ImageSrc, Links } from '../../utils/constants'; import { Dialog, Transition } from '@headlessui/react'; import { useDispatch } from 'react-redux'; import { updateShowConfetti } from '../../redux/reducer/commonReducer'; @@ -27,10 +27,17 @@ export const SuccesVerification = () => { dispatch(updateShowConfetti(true)); } + const cancelButtonRef = useRef(null); + return (

- + { The{' '} {' '} offers up to 2,000 NEAR for whistleblowers who come forward to share instances of vote buying, account buying, election fraud, and other violations of the{' '} - +

Please make sure to read and understand the{' '} - , which outlines - the responsibilities of each voter. + + , which outlines the responsibilities of each voter.

Cancel - +

I understand my responsibilities as a voter

diff --git a/src/utils/constants.js b/src/utils/constants.js index d150923..af7f832 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -102,4 +102,8 @@ export const ImageSrc = { export const Links = { KUDOS_WIDGET: 'https://near.org/kudos.ndctools.near/widget/NDC.Kudos.Main', + WHISTLEBLOWER: + 'https://medium.com/@neardigitalcollective/introducing-ndc-whistleblower-bounty-program-d4fe1b9fc5a0', + FAIR_VOTING_POLICY: + 'https://bafkreifb4ahfglbq3knjtecqfvyhwb2nycozc3azn3gzanwzbe2xpynniu.ipfs.nftstorage.link/', }; From 4ee351e665350987860238e3dfe2928bc3bb119c Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 Date: Tue, 8 Aug 2023 19:24:49 +0530 Subject: [PATCH 9/9] added I voted sbt to community SBTs page --- src/pages/CommunitySBT.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/CommunitySBT.jsx b/src/pages/CommunitySBT.jsx index 64b0c6a..4661a8e 100644 --- a/src/pages/CommunitySBT.jsx +++ b/src/pages/CommunitySBT.jsx @@ -127,6 +127,11 @@ const CommunitySBTPage = () => { title="Genius" description="This SBT is a testament to your genius and visionary prowess, propelling the NEAR ecosystem to new heights with brilliant ideas. Unleash its power and shape the future like never before!" /> +