Skip to content

Commit

Permalink
fix: ui bugs (#50)
Browse files Browse the repository at this point in the history
* fix: rpc logic

* fix: tutorial tx list styles for mobile

* fix: voting modal and timeline

* fix: against required voting power

* fix: voters list styles

* fix: will fail for list

* fix: balances logic
  • Loading branch information
Argeare5 authored Jan 9, 2024
1 parent 88ba467 commit 8a443ac
Show file tree
Hide file tree
Showing 37 changed files with 372 additions and 539 deletions.
19 changes: 0 additions & 19 deletions app/proposal-create-overview-v2/page.page.tsx

This file was deleted.

7 changes: 3 additions & 4 deletions app/proposal/page.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default async function ProposalPage({
(config) => config.accessLevel === cachedDetailsData?.proposal.accessLevel,
)[0];

const executionPayloadTime = Math.max.apply(
const executionDelay = Math.max.apply(
null,
cachedDetailsData?.payloads.map((payload) => payload.delay) || [0],
);
Expand All @@ -146,7 +146,7 @@ export default async function ProposalPage({
timings: {
cooldownPeriod: contractsConstants.cooldownPeriod,
expirationTime: contractsConstants.expirationTime,
executionPayloadTime,
executionDelay,
},
};

Expand All @@ -156,8 +156,7 @@ export default async function ProposalPage({
differential: proposalDataWithoutState.config.differential,
precisionDivider: proposalDataWithoutState.precisionDivider,
cooldownPeriod: proposalDataWithoutState.timings.cooldownPeriod,
executionPayloadTime:
proposalDataWithoutState.timings.executionPayloadTime,
executionDelay: proposalDataWithoutState.timings.executionDelay,
});

proposalDataSSR = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"@bgd-labs/aave-address-book": "^2.13.3",
"@bgd-labs/aave-governance-ui-helpers": "^1.0.12",
"@bgd-labs/aave-governance-ui-helpers": "^1.0.15-3a0b4f08fbd9e1650f3a570b83b76f5a90872d88.0",
"@bgd-labs/frontend-web3-utils": "^1.0.4-19dbd66bffa6f9723784771409aaa219bbe57b98.0",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.3",
Expand Down

This file was deleted.

113 changes: 0 additions & 113 deletions src/proposalCreateOverviewV2/store/proposalCreateOverviewV2Slice.ts

This file was deleted.

23 changes: 7 additions & 16 deletions src/proposals/components/ProposalEstimatedStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ProposalEstimatedState } from '@bgd-labs/aave-governance-ui-helpers';
import { Box, SxProps } from '@mui/system';
import { useEffect } from 'react';

import { useStore } from '../../store';
import { Timer } from '../../ui';
Expand All @@ -11,7 +10,7 @@ interface ProposalEstimatedStatusProps {
timestamp: number;
isSecondary?: boolean;
css?: SxProps;

isForModal?: boolean;
isForHelpModal?: boolean;
}

Expand All @@ -21,20 +20,10 @@ export function ProposalEstimatedStatus({
timestamp,
isSecondary,
css,
isForModal,
isForHelpModal,
}: ProposalEstimatedStatusProps) {
const { activeWallet, getDetailedProposalsData, getL1Balances } = useStore();

useEffect(() => {
if (
activeWallet?.isActive &&
estimatedStatus &&
estimatedStatus < ProposalEstimatedState.ProposalExecuted &&
!isForHelpModal
) {
getL1Balances([proposalId]);
}
}, [estimatedStatus]);
const { getDetailedProposalsData } = useStore();

const statusTextStringArray = estimatedStatus.split(' ');
statusTextStringArray.splice(-1);
Expand All @@ -54,7 +43,9 @@ export function ProposalEstimatedStatus({
mr: 4,
color:
estimatedStatus === ProposalEstimatedState.Defeated
? '$mainAgainst'
? isForModal
? '$mainAgainst'
: '$text'
: estimatedStatus === ProposalEstimatedState.Succeed
? '$mainFor'
: estimatedStatus === ProposalEstimatedState.Expired
Expand All @@ -66,7 +57,7 @@ export function ProposalEstimatedStatus({
<Box component="span" sx={{ typography: 'body', color: '$text' }}>
{statusText}
</Box>{' '}
{status}
{isForModal ? status : status === 'fail' ? 'end' : status}
</Box>

<Box component="p" sx={{ typography: 'body', color: '$textSecondary' }}>
Expand Down
4 changes: 3 additions & 1 deletion src/proposals/components/VoteBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface VoteBarProps {
withAnim?: boolean;
startValueForCountUp?: number | string;
startRequiredValueForCountUp?: number | string;
isRequiredAgainstVisible?: boolean;
}

export function VoteBar({
Expand All @@ -28,6 +29,7 @@ export function VoteBar({
withAnim,
startValueForCountUp,
startRequiredValueForCountUp,
isRequiredAgainstVisible,
}: VoteBarProps) {
const theme = useTheme();

Expand Down Expand Up @@ -116,7 +118,7 @@ export function VoteBar({
startNumber={startValueForCountUp}
/>

{!isFinished && (
{!isFinished && (type !== 'against' || isRequiredAgainstVisible) && (
<NumberWithValue
text={texts.other.required}
number={requiredValue}
Expand Down
Loading

1 comment on commit 8a443ac

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.