Skip to content

Commit

Permalink
Merge pull request #377 from picsoritdidnthappen/database-staging
Browse files Browse the repository at this point in the history
fix: open bounties
  • Loading branch information
picsoritdidnthappen authored Nov 15, 2024
2 parents 419564d + a98c2b4 commit 3739cec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 35 deletions.
48 changes: 15 additions & 33 deletions src/components/bounty/ClaimItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default function ClaimItem({
issuer,
bountyId,
accepted,
isMultiplayer,
url,
}: {
id: string;
Expand All @@ -32,7 +31,6 @@ export default function ClaimItem({
issuer: string;
bountyId: string;
accepted: boolean;
isMultiplayer: boolean;
url: string;
}) {
const account = useAccount();
Expand Down Expand Up @@ -189,43 +187,27 @@ export default function ClaimItem({
/>
<div className='p-[2px] text-white relative bg-[#F15E5F] border-[#F15E5F] border-2 rounded-xl '>
<div className='left-5 top-5 absolute flex flex-col text-white'>
{isMultiplayer && account.address === issuer && (
<button
className='submitForVote cursor-pointer text-[#F15E5F] hover:text-white hover:bg-[#F15E5F] border border-[#F15E5F] rounded-[8px] py-2 px-5 '
onClick={() => {
if (account.isConnected) {
submitForVoteMutation.mutate({
bountyId: BigInt(bountyId),
claimId: BigInt(id),
});
} else {
toast.error('Please connect wallet to continue');
}
}}
>
submit for vote
</button>
)}

{bounty.data &&
bounty.data.inProgress &&
!isMultiplayer &&
account.address === bounty.data.issuer && (
<div
<button
className='cursor-pointer mt-5 text-white hover:bg-[#F15E5F] border border-[#F15E5F] rounded-[8px] py-2 px-5'
onClick={() => {
if (account.isConnected) {
acceptClaimMutation.mutate({
bountyId: BigInt(bountyId),
claimId: BigInt(id),
});
} else {
toast.error('Please connect wallet to continue');
}
bounty.data.participants.length > 1
? submitForVoteMutation.mutate({
bountyId: BigInt(bountyId),
claimId: BigInt(id),
})
: acceptClaimMutation.mutate({
bountyId: BigInt(bountyId),
claimId: BigInt(id),
});
}}
className='acceptButton cursor-pointer mt-5 text-white hover:bg-[#F15E5F] border border-[#F15E5F] rounded-[8px] py-2 px-5'
>
accept
</div>
{bounty.data.participants.length > 1
? 'submit for vote'
: 'accept'}
</button>
)}
</div>

Expand Down
2 changes: 0 additions & 2 deletions src/components/bounty/ClaimList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function ClaimList({
{votingClaim && (
<div className='lg:col-span-4'>
<ClaimItem
isMultiplayer={isMultiplayer}
bountyId={bountyId}
id={votingClaim.id}
title={votingClaim.title}
Expand All @@ -60,7 +59,6 @@ export default function ClaimList({
.map((claim) => (
<div key={claim.id} className='lg:col-span-4 otherClaims'>
<ClaimItem
isMultiplayer={isMultiplayer}
bountyId={bountyId}
id={claim.id}
title={claim.title}
Expand Down
5 changes: 5 additions & 0 deletions src/trpc/routers/_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export const appRouter = createTRPCRouter({
claims: {
take: 1,
},
participants: {
select: {
user: true,
},
},
},
});

Expand Down

0 comments on commit 3739cec

Please sign in to comment.