Skip to content

Commit

Permalink
Merge pull request #137 from valory-xyz/tanya/hide-epoch-change
Browse files Browse the repository at this point in the history
(govern) chore: improve votes accuracy, hide epoch section
  • Loading branch information
Tanya-atatakai authored Nov 28, 2024
2 parents 6d23740 + 501aaf2 commit cf3bb7e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
8 changes: 4 additions & 4 deletions apps/govern/components/Contracts/ContractsList.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ describe('<ContractsList />', () => {
expect(screen.getByText(/Ethereum/)).toBeInTheDocument();

// current weight column
expect(screen.getByText(/10.12%/)).toBeInTheDocument();
expect(screen.getByText(/298.89K veOLAS/)).toBeInTheDocument();
expect(screen.getByText(/10.123%/)).toBeInTheDocument();
expect(screen.getByText(/298.892K veOLAS/)).toBeInTheDocument();

// next weight column
expect(screen.getByText(/25.56%/)).toBeInTheDocument();
expect(screen.getByText(/297.43K veOLAS/)).toBeInTheDocument();
expect(screen.getByText(/25.556%/)).toBeInTheDocument();
expect(screen.getByText(/297.434K veOLAS/)).toBeInTheDocument();
});

describe('Already voted', () => {
Expand Down
16 changes: 13 additions & 3 deletions apps/govern/components/Contracts/ContractsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ const getColumns = ({
dataIndex: 'currentWeight',
render: (currentWeight) => (
<Space size={2} direction="vertical">
<Text>{`${currentWeight?.percentage.toFixed(2)}%`}</Text>
<Text>{`${formatWeiNumber({
value: currentWeight?.percentage,
maximumFractionDigits: 3,
})}%`}</Text>
<Text type="secondary">{`${formatWeiNumber({
value: currentWeight?.value,
maximumFractionDigits: 3,
})} veOLAS`}</Text>
</Space>
),
Expand All @@ -71,8 +75,14 @@ const getColumns = ({
dataIndex: 'nextWeight',
render: (nextWeight) => (
<Space size={2} direction="vertical">
<Text>{`${nextWeight?.percentage.toFixed(2)}%`}</Text>
<Text type="secondary">{`${formatWeiNumber({ value: nextWeight?.value })} veOLAS`}</Text>
<Text>{`${formatWeiNumber({
value: nextWeight?.percentage,
maximumFractionDigits: 3,
})}%`}</Text>
<Text type="secondary">{`${formatWeiNumber({
value: nextWeight?.value,
maximumFractionDigits: 3,
})} veOLAS`}</Text>
</Space>
),
},
Expand Down
5 changes: 3 additions & 2 deletions apps/govern/components/Donate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Alert, Button, Card, Skeleton, Typography } from 'antd';
import { ethers } from 'ethers';
import isNumber from 'lodash/isNumber';
Expand Down Expand Up @@ -169,7 +170,7 @@ export const DonatePage = () => {
<DonateForm isLoading={isDonationLoading} onSubmit={onDepositServiceDonationSubmit} />
</Card>

<Card className="last-epoch-section">
{/* <Card className="last-epoch-section">
<Title level={2} className="mt-0">
Epoch Status
</Title>
Expand Down Expand Up @@ -197,7 +198,7 @@ export const DonatePage = () => {
</Button>
<Text type="secondary">New epochs must be manually triggered by community members</Text>
</EpochCheckpointRow>
</Card>
</Card> */}
</DonateContainer>
);
};

0 comments on commit cf3bb7e

Please sign in to comment.