From 087381cd8b1dbc4977053affada7a6f6bc0776c6 Mon Sep 17 00:00:00 2001 From: Christopher Stevers Date: Sun, 3 Sep 2023 03:09:58 -0400 Subject: [PATCH] finished supercharging update --- .../FundBounty/hooks/useFundBounty/index.jsx | 6 +- .../Hackathon/CreateHackathonButton/index.js | 2 +- components/Hackathon/HackathonCard/index.js | 14 +- .../Hackathon/HackathonDefinition/index.js | 14 +- .../HackathonStore/HackathonReducer.js | 2 + components/Hackathon/HackathonTime/index.js | 4 +- .../Submissions/CreateSubmission/index.jsx | 5 +- .../Submissions/SubmissionCard/index.jsx | 4 +- components/Submissions/Submissions/index.jsx | 3 - pages/contract/[id]/[address].js | 1 + pages/hackathons/[id]/index.js | 26 +- pages/hackathons/index.js | 7 +- pages/pro/[id]/createHackathon.js | 6 +- pages/pro/[id]/index.js | 13 +- services/ethers/OpenQClient.js | 2 + services/openq-api/OpenQPrismaClient.js | 1 + services/openq-api/graphql/query.js | 7 +- services/utils/lib.js | 874 +++++++++--------- 18 files changed, 505 insertions(+), 486 deletions(-) diff --git a/components/FundBounty/hooks/useFundBounty/index.jsx b/components/FundBounty/hooks/useFundBounty/index.jsx index 1d89e8a0f..c5bc0a881 100644 --- a/components/FundBounty/hooks/useFundBounty/index.jsx +++ b/components/FundBounty/hooks/useFundBounty/index.jsx @@ -3,6 +3,7 @@ import { useContext } from 'react'; import StoreContext from '../../../../store/Store/StoreContext'; import FundContext from '../../FundStore/FundContext'; import useWeb3 from '../../../../hooks/useWeb3'; +import { ethers } from 'ethers'; import { getBigNumberVol } from '../../../../services/utils/lib'; const useFundBounty = () => { @@ -32,11 +33,10 @@ const useFundBounty = () => { let fundTxnReceipt; fundTxnReceipt = await openQClient.fundBounty( library, - bounty.bountyAddress, + ethers.utils.getAddress(bounty.bountyAddress), token.address, bigNumberVolumeInWei, - depositPeriodDays, - accountData.id + depositPeriodDays ); const transactionDispatch = { type: 'SET_TRANSACTION_HASH', diff --git a/components/Hackathon/CreateHackathonButton/index.js b/components/Hackathon/CreateHackathonButton/index.js index 20a539391..8aef3e27d 100644 --- a/components/Hackathon/CreateHackathonButton/index.js +++ b/components/Hackathon/CreateHackathonButton/index.js @@ -53,7 +53,7 @@ const CreateHackathonButton = ({ teamAccountId, isEditing, hackathonProductInsta {responseMap[createHackathonResponse].text} - + {/* */} {error &&
{error}
} diff --git a/components/Hackathon/HackathonCard/index.js b/components/Hackathon/HackathonCard/index.js index f08869e03..b99d190de 100644 --- a/components/Hackathon/HackathonCard/index.js +++ b/components/Hackathon/HackathonCard/index.js @@ -33,7 +33,7 @@ const HackathonCard = ({ repository }) => {
- {repository.isDraft && } + {/*repository.isDraft && */} {teamAccountId && ( Edit @@ -47,10 +47,12 @@ const HackathonCard = ({ repository }) => { {monthsToStart ? `about ${monthsToStart} month${getPlural(monthsToStart)} left` : 'Happening this month.'}
-
- $100,500 in prizes - -
+ {repository.prizePool && ( +
+ {repository.prizePool} in prizes + +
+ )}
@@ -64,7 +66,7 @@ const HackathonCard = ({ repository }) => {
- {repository.city} + {repository.isIrl ? repository.city : 'Virtual'}
{repository?.topic?.map((topic, index) => { diff --git a/components/Hackathon/HackathonDefinition/index.js b/components/Hackathon/HackathonDefinition/index.js index 005f8d798..e69d3acb6 100644 --- a/components/Hackathon/HackathonDefinition/index.js +++ b/components/Hackathon/HackathonDefinition/index.js @@ -3,7 +3,7 @@ import HackathonContext from '../HackathonStore/HackathonContext'; import { handleDispatch } from '../../../services/utils/lib'; const HackathonDefinition = ({ isEditing }) => { const [hackathonState, hackathonDispatch] = useContext(HackathonContext); - const { eventOrganizer, eventName, repositoryUrl, description } = hackathonState; + const { eventOrganizer, eventName, repositoryUrl, description, prizePool } = hackathonState; const handleUpdateGithubRepositoryUrl = async (e) => { const urlInput = e.target.value; const ownerRegex = /github.com\/([a-zA-Z0-9-]+)\/([a-zA-Z0-9-]+)/; @@ -89,6 +89,18 @@ const HackathonDefinition = ({ isEditing }) => { onChange={(e) => handleDispatch(e, 'SET_DESCRIPTION', hackathonDispatch)} />
+
+ + + handleDispatch(e, 'SET_PRIZE_POOL', hackathonDispatch)} + /> +
); }; diff --git a/components/Hackathon/HackathonStore/HackathonReducer.js b/components/Hackathon/HackathonStore/HackathonReducer.js index e73a7f97b..d5e544c14 100644 --- a/components/Hackathon/HackathonStore/HackathonReducer.js +++ b/components/Hackathon/HackathonStore/HackathonReducer.js @@ -6,6 +6,8 @@ const HackathonReducer = (state, action) => { return { ...state, eventName: action.payload }; case 'SET_DESCRIPTION': return { ...state, description: action.payload }; + case 'SET_PRIZE_POOL': + return { ...state, prizePool: action.payload }; case 'SET_REPOSITORY_URL': return { ...state, repositoryUrl: action.payload }; case 'SET_IS_IRL': diff --git a/components/Hackathon/HackathonTime/index.js b/components/Hackathon/HackathonTime/index.js index 389c4e125..c80c01be0 100644 --- a/components/Hackathon/HackathonTime/index.js +++ b/components/Hackathon/HackathonTime/index.js @@ -30,7 +30,7 @@ const HackathonTime = () => { }; return ( <> -
+
@@ -77,7 +77,7 @@ const HackathonTime = () => {
-
+