Skip to content

Commit

Permalink
feat(milestone-list): complete app
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman-zishan committed Dec 13, 2023
1 parent 9e41db6 commit e1d203c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/pages/proposal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const ProposalPage = () => {
const { isSignedIn } = useAuth();
const { stxAddress } = useAccount();
const [proposalInfo, setProposalInfo] = React.useState<ProposalType>();
const [milestoneInfo, setMilestoneInfo] = React.useState<any>();

const { openContractCall } = useOpenContractCall();

Expand Down Expand Up @@ -138,6 +139,7 @@ const ProposalPage = () => {
});

console.log(cvToValue(result));
setMilestoneInfo(cvToValue(result));
} catch (error) {
console.error('Failed to fetch balance:', error);
}
Expand Down Expand Up @@ -240,6 +242,29 @@ const ProposalPage = () => {
</div>
</div>
</div>

{milestoneInfo && (
<div>
<h2 className="text-2xl font-bold mb-4 mt-4">
Milestones ({milestoneInfo.length})
</h2>
<div className="flex flex-col h-[200px] max-h-[500px] overflow-scroll gap-10">
{milestoneInfo.map((milestone: any) => (
<div className="grid grid-cols gap-4">
<div className="flex p-4 bg-blue-200 rounded-xl text-gray-800 gap-5">
<div className="font-bold text-xl leading-none">
milestone ID : {milestone.value.id.value}
</div>
<div className="font-bold text-xl leading-none">
Amount : {milestone.value.amount.value / 1000000}{' '}
STX
</div>
</div>
</div>
))}
</div>
</div>
)}
</div>
</div>
</div>
Expand Down

0 comments on commit e1d203c

Please sign in to comment.