Skip to content

Commit

Permalink
fix: voting duration and networks icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Argeare5 committed Jan 6, 2024
1 parent 76d6593 commit fb0d88c
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 16 deletions.
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.10",
"@bgd-labs/aave-governance-ui-helpers": "^1.0.11",
"@bgd-labs/frontend-web3-utils": "^1.0.3",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.3",
Expand Down
15 changes: 14 additions & 1 deletion public/images/networks/arbitrum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion public/images/networks/polygon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/proposals/components/proposal/ProposalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,14 @@ export function ProposalPage({
<LeftPanelWrapper>
<NoSSR>
{proposal.data.payloads.some((payload) => !payload?.state) && (
<BlockWrapper contentColor="$mainAgainst">
<BlockWrapper toBottom contentColor="$mainAgainst">
{proposal.data.payloads
.filter((payload) => !payload?.state)
.map((payload) => (
<Box
key={payload.id}
component="p"
sx={{
mt: 8,
typography: 'descriptor',
color: '$light',
textAlign: 'center',
Expand Down
3 changes: 2 additions & 1 deletion src/proposals/components/proposal/ProposalTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const TimelineItem = ({
top: 'calc(100% + 12px)',
color: finished ? '$text' : '$textSecondary',
[theme.breakpoints.up('lg')]: {
minWidth: 100,
minWidth: 95,
},
},
}}>
Expand Down Expand Up @@ -625,6 +625,7 @@ export function ProposalTimeline({
sx={{
overflowX: 'auto',
px: 40,
pl: 60,
width: '100%',
'@media only screen and (min-width: 960px)': { overflowX: 'hidden' },
}}>
Expand Down
6 changes: 5 additions & 1 deletion src/proposals/store/proposalsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export const createProposalsSlice: StoreSlice<
}),
);

if (!get().representativeLoading) {
if (!get().representativeLoading && !!get().configs[0].votingDuration) {
const isProposalNotInCache = !ids.filter(
(proposalId) =>
proposalId ===
Expand All @@ -576,6 +576,7 @@ export const createProposalsSlice: StoreSlice<
);

proposalsData = await get().govDataService.getDetailedProposalsData(
get().configs,
fr <= 0 ? (get().totalProposalCount > PAGE_SIZE - 1 ? 1 : 0) : fr,
to <= 0 ? 0 : to,
userAddress,
Expand All @@ -585,6 +586,7 @@ export const createProposalsSlice: StoreSlice<
);
} else if ((from || from === 0 || from === -1) && isProposalNotInCache) {
proposalsData = await get().govDataService.getDetailedProposalsData(
get().configs,
from < 0 ? 0 : from,
0,
userAddress,
Expand All @@ -594,6 +596,7 @@ export const createProposalsSlice: StoreSlice<
);
} else if (from && from > 0 && to && to > 0 && isProposalNotInCache) {
proposalsData = await get().govDataService.getDetailedProposalsData(
get().configs,
from,
to,
userAddress,
Expand All @@ -604,6 +607,7 @@ export const createProposalsSlice: StoreSlice<
} else if (!isProposalNotInCache) {
const proposals = ids.map((id) => get().detailedProposalsData[id]);
proposalsData = await get().govDataService.getOnlyVotingMachineData(
get().configs,
proposals,
userAddress,
representativeAddress as Hex,
Expand Down
5 changes: 4 additions & 1 deletion src/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ export const initialRpcUrls: Record<number, string[]> = {
'https://rpc.mevblocker.io',
],
[polygon.id]: [
'https://polygon.blockpi.network/v1/rpc/public',
'https://polygon-pokt.nodies.app',
'https://polygon.llamarpc.com',
'https://polygon-bor.publicnode.com',
'https://endpoints.omniatech.io/v1/matic/mainnet/public',
],
[avalanche.id]: [
'https://api.avax.network/ext/bc/C/rpc',
'https://avalanche.drpc.org',
'https://avax.meowrpc.com',
'https://avalanche.blockpi.network/v1/rpc/public',
],
[bsc.id]: ['https://binance.llamarpc.com', 'https://bsc.meowrpc.com'],
[base.id]: [
'https://base.blockpi.network/v1/rpc/public',
'https://base.llamarpc.com',
'https://base-mainnet.public.blastapi.io',
'https://base.meowrpc.com',
Expand All @@ -51,8 +54,8 @@ export const initialRpcUrls: Record<number, string[]> = {
'https://metis.api.onfinality.io/public',
],
[optimism.id]: [
'https://optimism.llamarpc.com',
'https://optimism.blockpi.network/v1/rpc/public',
'https://optimism.llamarpc.com',
'https://optimism.publicnode.com',
],
[gnosis.id]: [
Expand Down
11 changes: 7 additions & 4 deletions src/web3/components/wallet/CurrentPowers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,18 @@ export function CurrentPowers() {
<Box sx={{ display: 'flex', justifyContent: 'flex-start' }}>
<Box
onClick={() => {
setAccountInfoModalOpen(false);
setPowersInfoModalOpen(true);
if (!!currentPowersAll) {
setAccountInfoModalOpen(false);
setPowersInfoModalOpen(true);
}
}}
sx={{
typography: 'descriptorAccent',
mt: 12,
cursor: 'pointer',
cursor: !currentPowersAll ? 'not-allowed' : 'pointer',
transition: 'all 0.2s ease',
hover: { opacity: '0.7' },
opacity: !currentPowersAll ? '0.4' : 1,
hover: { opacity: !currentPowersAll ? '0.4' : '0.7' },
}}>
Details
</Box>
Expand Down
5 changes: 5 additions & 0 deletions src/web3/services/govDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
updateVotingMachineData,
VMProposalStructOutput,
VotersData,
VotingConfig,
votingMachineContract,
votingMachineDataHelperContract,
} from '@bgd-labs/aave-governance-ui-helpers';
Expand Down Expand Up @@ -396,6 +397,7 @@ export class GovDataService {
}

async getDetailedProposalsData(
configs: VotingConfig[],
from: number,
to?: number,
userAddress?: Hex,
Expand Down Expand Up @@ -431,13 +433,15 @@ export class GovDataService {
);

return getDetailedProposalsData(
configs,
govCoreDataHelperData,
votingMachineDataHelperData as VMProposalStructOutput[],
proposalsIds,
);
}

async getOnlyVotingMachineData(
configs: VotingConfig[],
proposals: ProposalData[],
userAddress?: Hex,
representative?: Hex,
Expand All @@ -463,6 +467,7 @@ export class GovDataService {
);

return updateVotingMachineData(
configs,
proposals,
votingMachineDataHelperData as VMProposalStructOutput[],
proposalsIds,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1281,10 +1281,10 @@
resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.13.3.tgz#a115c2677aeadd0398caa096436395fe07f4cf48"
integrity sha512-9WQekYTCjeAuqjRouLHvYdE9R86Hp4m5v9QJhr9zGpsl8OE/YxpmI6QEz6o0gHMB3D6DhqwAZ3nakCouz7Cb+w==

"@bgd-labs/aave-governance-ui-helpers@^1.0.10":
version "1.0.10"
resolved "https://registry.yarnpkg.com/@bgd-labs/aave-governance-ui-helpers/-/aave-governance-ui-helpers-1.0.10.tgz#3047067487385faa547cc59713af4f72798cf7d5"
integrity sha512-qp60bruzMbWEJ2SoQAwbrADs4Mvt8ymACbcpriO+bwGAkVZBgj8ALwMp74kwivKd04AMPnvbPMW/MtiA/lf+Dg==
"@bgd-labs/aave-governance-ui-helpers@^1.0.11":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@bgd-labs/aave-governance-ui-helpers/-/aave-governance-ui-helpers-1.0.11.tgz#0a08bf2fdfdc852198e14b4e2f5306ff850bf87c"
integrity sha512-i7UZd2YHEeRgIB1Y1F7cT9d3Gkm+jomhwJcfhoE5XeEmNnbR15uuRlpWcCyjBaxZ/EeMf60tFIFYYxg0UDLcMw==
dependencies:
bs58 "^5.0.0"
dayjs "^1.11.10"
Expand Down

1 comment on commit fb0d88c

@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.