diff --git a/components/bounty-detail/bounty-detail-client.tsx b/components/bounty-detail/bounty-detail-client.tsx index 6d6ed5c7..455943a6 100644 --- a/components/bounty-detail/bounty-detail-client.tsx +++ b/components/bounty-detail/bounty-detail-client.tsx @@ -168,6 +168,19 @@ export function BountyDetailClient({ bountyId }: { bountyId: string }) { (bounty as { submissions?: CompetitionSubmissionEntry[] | null }) .submissions ?? []; + const mySubmission = bounty.submissions?.find( + (s) => s.submittedBy === session?.user?.id, + ); + const hasRevision = + mySubmission?.status === "REVISION_REQUESTED" && + !!mySubmission?.reviewComments; + const showSubmitPanel = + bounty.type === "MILESTONE_BASED" && + isAssignedApplicant && + !!walletAddress && + (bounty.status === "IN_PROGRESS" || + (bounty.status === "UNDER_REVIEW" && hasRevision)); + return (
{/* Main content */} @@ -240,15 +253,17 @@ export function BountyDetailClient({ bountyId }: { bountyId: string }) { /> )} - {bounty.type === "MILESTONE_BASED" && - isAssignedApplicant && - walletAddress && - bounty.status === "IN_PROGRESS" && ( - - )} + {showSubmitPanel && ( + + )} {bounty.type === "MILESTONE_BASED" && isCreator && @@ -256,6 +271,7 @@ export function BountyDetailClient({ bountyId }: { bountyId: string }) { + {revisionFeedback && ( +
+
+ +
+

+ Revision Requested +

+

+ {revisionFeedback} +

+
+
+
+ )}
- {/* Revision Section - Coming Soon */} + {/* Revision Section */}
-
- -

- Needs Changes? -

-

- Request revisions before releasing the escrow. -

- -
+ {!showRevisionForm ? ( +
+ +

+ Needs Changes? +

+

+ Request revisions before releasing the escrow. +

+ +
+ ) : ( +
+
+ +

+ Describe what needs to change before you can approve. +

+