diff --git a/src/modules/lite/explorer/components/Choices.tsx b/src/modules/lite/explorer/components/Choices.tsx index 95e4f9b2..6361a10d 100644 --- a/src/modules/lite/explorer/components/Choices.tsx +++ b/src/modules/lite/explorer/components/Choices.tsx @@ -95,7 +95,9 @@ export const Choices: React.FC = ({ choices, submitForm, isLoading, votingS const liteDAOId = data?.liteDAOData?._id ? data?.liteDAOData?._id : id const tokenAddress = useToken(liteDAOId) const { data: userBalance } = useUserTokenBalance(tokenAddress) + console.log("userBalance: ", userBalance) const canCreateProposal = userBalance && new BigNumber(userBalance).gt(0) ? true : false + console.log("canCreateProposal: ", canCreateProposal) return ( @@ -193,7 +195,7 @@ export const Choices: React.FC = ({ choices, submitForm, isLoading, votingS {!isLoading ? ( - + Create Proposal ) : ( diff --git a/src/modules/lite/explorer/pages/ProposalDetails/index.tsx b/src/modules/lite/explorer/pages/ProposalDetails/index.tsx index 75ce4d1f..1e91affc 100644 --- a/src/modules/lite/explorer/pages/ProposalDetails/index.tsx +++ b/src/modules/lite/explorer/pages/ProposalDetails/index.tsx @@ -18,6 +18,8 @@ import { BackButton } from "modules/lite/components/BackButton" import { voteOnLiteProposal } from "services/services/lite/lite-services" import { useDelegationStatus } from "services/contracts/token/hooks/useDelegationStatus" import { useDAO } from "services/services/dao/hooks/useDAO" +import { useDelegationVoteWeight } from "services/contracts/token/hooks/useDelegationVoteWeight" +import BigNumber from "bignumber.js" const PageContainer = styled("div")({ marginBottom: 50, @@ -61,7 +63,7 @@ export const ProposalDetails: React.FC<{ id: string }> = ({ id }) => { const community = useCommunity(id) const poll = useSinglePoll(proposalId, id, community) const choices = usePollChoices(poll, refresh) - const { data: delegatedTo } = useDelegationStatus(dao?.data.token.contract) + const { data: voteWeight } = useDelegationVoteWeight(dao?.data.token.contract) const [selectedVotes, setSelectedVotes] = useState([]) useEffect(() => { @@ -158,7 +160,7 @@ export const ProposalDetails: React.FC<{ id: string }> = ({ id }) => { {poll?.isActive === ProposalStatus.ACTIVE ? (