diff --git a/src/views/Governance/Governance.tsx b/src/views/Governance/Governance.tsx index 21a78fd25..8c5c769fa 100644 --- a/src/views/Governance/Governance.tsx +++ b/src/views/Governance/Governance.tsx @@ -10,7 +10,7 @@ import { TableRow, Typography, } from "@mui/material"; -import { PrimaryButton } from "@olympusdao/component-library"; +import { InfoNotification, PrimaryButton } from "@olympusdao/component-library"; import { useState } from "react"; import { InPageConnectButton } from "src/components/ConnectButton/ConnectButton"; import PageTitle from "src/components/PageTitle"; @@ -22,7 +22,7 @@ import { GovernanceTableRow } from "src/views/Governance/GovernanceTableRow"; import { useCheckDelegation } from "src/views/Governance/hooks/useCheckDelegation"; import { useGetClearingHouse } from "src/views/Lending/Cooler/hooks/useGetClearingHouse"; import { useGetCoolerForWallet } from "src/views/Lending/Cooler/hooks/useGetCoolerForWallet"; -import { useAccount } from "wagmi"; +import { useAccount, useBalance } from "wagmi"; export const Governance = () => { const { address, isConnected } = useAccount(); @@ -47,7 +47,20 @@ export const Governance = () => { }); const { data: coolerV1DelegationAddress } = useCheckDelegation({ address: coolerAddressV1 }); const { data: coolerV2DelegationAddress } = useCheckDelegation({ address: coolerAddressV2 }); + const { data: gohmCoolerV2Balance } = useBalance({ + address: coolerAddressV2 as `0x${string}`, + token: GOHM_ADDRESSES[networks.MAINNET] as `0x${string}`, + }); + const { data: gohmCoolerV1Balance } = useBalance({ + address: coolerAddressV1 as `0x${string}`, + token: GOHM_ADDRESSES[networks.MAINNET] as `0x${string}`, + }); + const { data: gohmBalance } = useBalance({ + address: address as `0x${string}`, + token: GOHM_ADDRESSES[networks.MAINNET] as `0x${string}`, + }); + console.log(gohmCoolerV2Balance, "balance"); const [delegateVoting, setDelegateVoting] = useState< { delegatorAddress: string; currentDelegatedToAddress?: string } | undefined >(undefined); @@ -59,9 +72,11 @@ export const Governance = () => { Proposals - - View Proposals on Snapshot - + + + View Proposals on Snapshot + + Delegate Voting @@ -74,11 +89,18 @@ export const Governance = () => { ) : ( <> + {(coolerAddressV1 || coolerAddressV2) && ( + + To make gOHM in Cooler Loans votable, you must delegate it to yourself + + )} + Address + Amount Delegation Status @@ -88,26 +110,29 @@ export const Governance = () => { {address && ( )} {coolerAddressV1 && ( )} {coolerAddressV2 && ( )} diff --git a/src/views/Governance/GovernanceTableRow.tsx b/src/views/Governance/GovernanceTableRow.tsx index e3fa12c5a..d56596784 100644 --- a/src/views/Governance/GovernanceTableRow.tsx +++ b/src/views/Governance/GovernanceTableRow.tsx @@ -9,6 +9,7 @@ export const GovernanceTableRow = ({ delegationAddress, delegatorAddress, setDelegateVoting, + balance, }: { tokenName: string; delegationAddress?: string; @@ -22,6 +23,7 @@ export const GovernanceTableRow = ({ | undefined > >; + balance?: string; }) => { const delegateVoting = useDelegateVoting(); @@ -30,9 +32,13 @@ export const GovernanceTableRow = ({ {tokenName} + + {Number(balance || 0).toFixed(2)} gOHM + {delegationAddress ? `Delegated to ${truncateEthereumAddress(delegationAddress)} ` : "Undelegated"} +