Skip to content

Commit

Permalink
Show total count on admin view for New grants and Completed grants (#121
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Pabl0cks authored Apr 25, 2024
1 parent e58bff5 commit d34fcc0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/nextjs/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,17 @@ const AdminPage = () => {
<div className="flex flex-col lg:flex-row gap-12 mt-4">
<div className="p-8 bg-warning/5 lg:w-1/2">
<div className="flex justify-between items-center">
<h2 className="font-bold text-xl">New Grant Proposals</h2>
<h2 className="font-bold text-xl">
New Grant Proposals {newGrants && newGrants.length > 0 && <>({newGrants.length})</>}
</h2>
{newGrants && newGrants.length !== 0 && (
<button
className="btn btn-sm btn-primary"
onClick={() => handleBatchAction(newGrants, "approve")}
disabled={selectedApproveGrants.length === 0}
>
Batch Send + Approve
Batch Send + Approve{" "}
{selectedApproveGrants && selectedApproveGrants.length > 0 && <>({selectedApproveGrants.length})</>}
</button>
)}
</div>
Expand All @@ -205,14 +208,19 @@ const AdminPage = () => {
</div>
<div className="p-8 bg-success/5 lg:w-1/2">
<div className="flex justify-between items-center">
<h2 className="font-bold text-xl">Completed Grants</h2>
<h2 className="font-bold text-xl">
Completed Grants {completedGrants && completedGrants.length > 0 && <>({completedGrants.length})</>}
</h2>
{completedGrants && completedGrants.length !== 0 && (
<button
className="btn btn-sm btn-primary"
onClick={() => handleBatchAction(completedGrants, "complete")}
disabled={selectedCompleteGrants.length === 0}
>
Batch Send + Complete
Batch Send + Complete{" "}
{selectedCompleteGrants && selectedCompleteGrants.length > 0 && (
<>({selectedCompleteGrants.length})</>
)}
</button>
)}
</div>
Expand Down

0 comments on commit d34fcc0

Please sign in to comment.