Skip to content

Commit 087381c

Browse files
finished supercharging update
1 parent 581d83f commit 087381c

File tree

18 files changed

+505
-486
lines changed

18 files changed

+505
-486
lines changed

components/FundBounty/hooks/useFundBounty/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useContext } from 'react';
33
import StoreContext from '../../../../store/Store/StoreContext';
44
import FundContext from '../../FundStore/FundContext';
55
import useWeb3 from '../../../../hooks/useWeb3';
6+
import { ethers } from 'ethers';
67
import { getBigNumberVol } from '../../../../services/utils/lib';
78

89
const useFundBounty = () => {
@@ -32,11 +33,10 @@ const useFundBounty = () => {
3233
let fundTxnReceipt;
3334
fundTxnReceipt = await openQClient.fundBounty(
3435
library,
35-
bounty.bountyAddress,
36+
ethers.utils.getAddress(bounty.bountyAddress),
3637
token.address,
3738
bigNumberVolumeInWei,
38-
depositPeriodDays,
39-
accountData.id
39+
depositPeriodDays
4040
);
4141
const transactionDispatch = {
4242
type: 'SET_TRANSACTION_HASH',

components/Hackathon/CreateHackathonButton/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const CreateHackathonButton = ({ teamAccountId, isEditing, hackathonProductInsta
5353
{responseMap[createHackathonResponse].text}
5454
<Loader />
5555
</button>
56-
<button className='btn-default'>Preview</button>
56+
{/* <button className='btn-default'>Preview</button>*/}
5757
</div>
5858
{error && <div className='text-red-500'>{error}</div>}
5959
</div>

components/Hackathon/HackathonCard/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const HackathonCard = ({ repository }) => {
3333
</h3>
3434
</div>
3535
<div>
36-
{repository.isDraft && <button className='btn-default bg-input-bg mx-4'>Preview</button>}
36+
{/*repository.isDraft && <button className='btn-default bg-input-bg mx-4'>Preview</button>*/}
3737
{teamAccountId && (
3838
<Link href={`/hackathons/${repository.id}/edit`} className='btn-default bg-input-bg mx-4'>
3939
Edit
@@ -47,10 +47,12 @@ const HackathonCard = ({ repository }) => {
4747
{monthsToStart ? `about ${monthsToStart} month${getPlural(monthsToStart)} left` : 'Happening this month.'}
4848
</div>
4949
<div className='flex justify-between'>
50-
<div className=''>
51-
<span className='font-bold'>$100,500</span> <span> in prizes</span>
52-
<span></span>
53-
</div>
50+
{repository.prizePool && (
51+
<div className=''>
52+
<span className='font-bold'>{repository.prizePool}</span> <span> in prizes</span>
53+
<span></span>
54+
</div>
55+
)}
5456
<div className='flex gap-2 items-center'>
5557
<CalendarIcon />
5658
<NoSSRWrapper>
@@ -64,7 +66,7 @@ const HackathonCard = ({ repository }) => {
6466
<div className='border-x border-y rounded-b border-web-gray flex items-center justify-between p-4'>
6567
<div className='flex gap-8'>
6668
<div className='flex gap-2 items-center'>
67-
<LocationIcon className='' /> <span>{repository.city}</span>
69+
<LocationIcon className='' /> <span>{repository.isIrl ? repository.city : 'Virtual'}</span>
6870
</div>
6971
<div className='flex gap-2'>
7072
{repository?.topic?.map((topic, index) => {

components/Hackathon/HackathonDefinition/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import HackathonContext from '../HackathonStore/HackathonContext';
33
import { handleDispatch } from '../../../services/utils/lib';
44
const HackathonDefinition = ({ isEditing }) => {
55
const [hackathonState, hackathonDispatch] = useContext(HackathonContext);
6-
const { eventOrganizer, eventName, repositoryUrl, description } = hackathonState;
6+
const { eventOrganizer, eventName, repositoryUrl, description, prizePool } = hackathonState;
77
const handleUpdateGithubRepositoryUrl = async (e) => {
88
const urlInput = e.target.value;
99
const ownerRegex = /github.com\/([a-zA-Z0-9-]+)\/([a-zA-Z0-9-]+)/;
@@ -89,6 +89,18 @@ const HackathonDefinition = ({ isEditing }) => {
8989
onChange={(e) => handleDispatch(e, 'SET_DESCRIPTION', hackathonDispatch)}
9090
/>
9191
</div>
92+
<div className='my-2 mb-4'>
93+
<label className='font-semibold text-lg block my-2' htmlFor={'name'}>
94+
Prize Pool
95+
</label>
96+
97+
<input
98+
className='input-field w-full h-8'
99+
id={'prize pool'}
100+
value={prizePool}
101+
onChange={(e) => handleDispatch(e, 'SET_PRIZE_POOL', hackathonDispatch)}
102+
/>
103+
</div>
92104
</>
93105
);
94106
};

components/Hackathon/HackathonStore/HackathonReducer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const HackathonReducer = (state, action) => {
66
return { ...state, eventName: action.payload };
77
case 'SET_DESCRIPTION':
88
return { ...state, description: action.payload };
9+
case 'SET_PRIZE_POOL':
10+
return { ...state, prizePool: action.payload };
911
case 'SET_REPOSITORY_URL':
1012
return { ...state, repositoryUrl: action.payload };
1113
case 'SET_IS_IRL':

components/Hackathon/HackathonTime/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const HackathonTime = () => {
3030
};
3131
return (
3232
<>
33-
<div className='my-2'>
33+
<div className='my-2 hidden'>
3434
<label className='font-semibold text-lg block my-2 ' htmlFor={'teamAccount'}>
3535
Timezone
3636
</label>
@@ -77,7 +77,7 @@ const HackathonTime = () => {
7777
</div>
7878
</div>
7979
</div>
80-
<div className='my-2'>
80+
<div className='my-2 hidden'>
8181
<label className='font-semibold text-lg my-2 max-w-xs flex content-center gap-2 items-center'>
8282
Enable Registration Deadline
8383
<InfoInToolTip toolTipText={'Choose the start and end dates for your hackathon'} />

components/Submissions/CreateSubmission/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import React, { useContext, useState } from 'react';
22
import StoreContext from '../../../store/Store/StoreContext';
33

44
import { marked } from 'marked';
5+
import { useRouter } from 'next/router';
56

67
const CreateSubmission = ({ bounties, githubRepository }) => {
7-
console.log(bounties, 'my bounties');
8+
const router = useRouter();
89
const [writingState, setWritingState] = useState('Write');
910
const [title, setTitle] = useState('');
1011
const [selectedBounties, setSelectedBounties] = useState([]);
@@ -75,6 +76,8 @@ const CreateSubmission = ({ bounties, githubRepository }) => {
7576
coverImage,
7677
teamName,
7778
});
79+
80+
router.push(`${router.asPath}?tab=submissions`);
7881
};
7982

8083
const selectedClasses = ' border-web-gray rounded-t-sm ';

components/Submissions/SubmissionCard/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const SubmissionCard = ({ submission, bounty, refreshBounty }) => {
3232

3333
const linkedPrize = tierWon >= 0 && tierWon + 1;
3434

35-
const bodyTextString = submission.bodyHTML
35+
const bodyTextString = submission.overviewHTML
3636
.replace(/<\/?[^>]+(>|$)/g, '')
3737
.replace(/<\/?[^>]+(>|$)/g, '')
3838
.replace(/\s+/g, ' ')
@@ -59,7 +59,7 @@ const SubmissionCard = ({ submission, bounty, refreshBounty }) => {
5959
<div className='w-16 h-16 relative'>
6060
<Image
6161
className='rounded-full'
62-
src={submission?.thumbnail}
62+
src={submission?.coverImage}
6363
placeholder={'blur'}
6464
blurDataURL={'/diverse/placeholder-px.png'}
6565
alt='n/a'

components/Submissions/Submissions/index.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ const Submissions = ({ bounty, refreshBounty }) => {
66
console.log(bounty, 'bounty');
77
return (
88
<>
9-
<div className='w-full bg-info border-info-strong border-2 p-3 rounded-sm'>
10-
Don't see your submission yet? Click 'Refresh' above to get the latest pull requests from Github.
11-
</div>
129
<div className='grid gap-8 w-full pt-8 justify-between justify-items-center grid-cols-[repeat(auto-fit,_minmax(300px,_1fr))]'>
1310
{submissions?.map((submission, index) => {
1411
return <SubmissionCard refreshBounty={refreshBounty} key={index} submission={submission} bounty={bounty} />;

pages/contract/[id]/[address].js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ export const getServerSideProps = async (context) => {
325325
bountyMetadata = await openQPrismaClient.instance.getBounty(ethers.utils.getAddress(address));
326326
console.log(bountyMetadata, 'bountyMetadata');
327327
} catch (err) {
328+
console.log(err.networkError.result.errors, 'my error');
328329
logger.error(err, null, '[address.js]3');
329330
}
330331

0 commit comments

Comments
 (0)