Skip to content

Commit

Permalink
Merge pull request #115 from valory-xyz/tanya/proposals-update
Browse files Browse the repository at this point in the history
(govern): fix status, add proposal id
  • Loading branch information
DavidMinarsch authored Oct 14, 2024
2 parents e529161 + 919217b commit c93bed6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 3 additions & 1 deletion apps/govern/components/Proposals/ProposalDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const ProposalDetails = ({
)}
</Flex>
</Flex>
<Flex vertical gap={8}>
<Flex vertical gap={8} className="mb-16">
<Caption>Voters ({item.voteCasts?.length})</Caption>
{item.voteCasts.map((vote, index) => (
<Row key={vote.id} gutter={[0, 8]}>
Expand All @@ -85,6 +85,8 @@ export const ProposalDetails = ({
</Row>
))}
</Flex>
<Caption>Proposal ID</Caption>
<Paragraph className="mb-16">{item.id}</Paragraph>
</Flex>
);
};
16 changes: 6 additions & 10 deletions apps/govern/components/Proposals/ProposalsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ import { COLOR } from 'libs/ui-theme/src';
const { Text } = Typography;

const Status = ({ item, block }: { item: Proposal; block: bigint | undefined }) => {
if (item.isExecuted) return <Tag color="green"> Executed</Tag>;
if (item.isCancelled) return <Tag color="volcano"> Cancelled</Tag>;
if (item.isQueued) return <Tag color="gold"> Queued</Tag>;

// check if the current block is between proposal's start and end blocks
if (isOngoing(item, block)) {
return <Tag color="blue">Ongoing</Tag>;
}

return <Tag>Created</Tag>;
if (item.isExecuted) return <Tag color="green">Executed</Tag>;
if (item.isCancelled) return <Tag color="volcano">Cancelled</Tag>;
if (item.isQueued) return <Tag color="gold">Queued</Tag>;
if (isOngoing(item, block)) return <Tag color="blue">Ongoing</Tag>;
if (hasNotStarted(item, block)) return <Tag>Created</Tag>;
return <Tag>Waiting to queue</Tag>;
};

const getColumns = (
Expand Down

0 comments on commit c93bed6

Please sign in to comment.