From 9696c60bcb5afabf7541e755405738474a15fd63 Mon Sep 17 00:00:00 2001 From: keating Date: Mon, 27 Nov 2023 09:45:34 -0500 Subject: [PATCH] Fix build --- components/DaoMenu.tsx | 6 +++--- components/ProposalRow.tsx | 6 +++--- hooks/useProposals.ts | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/DaoMenu.tsx b/components/DaoMenu.tsx index 92ca10f..8b3a905 100644 --- a/components/DaoMenu.tsx +++ b/components/DaoMenu.tsx @@ -5,7 +5,7 @@ import clsx from 'clsx'; import { Menu, Transition } from '@headlessui/react'; import { ChevronDownIcon } from '@heroicons/react/20/solid'; import { useConfig } from '@/hooks/useConfig'; -import { usePathname } from 'next/navigation' +import { usePathname } from 'next/navigation'; type Option = { value: T; @@ -20,7 +20,7 @@ type Props = { const DaoMenu = (props: Props) => { const config = useConfig(); - const pathName= usePathname(); + const pathName = usePathname(); return ( @@ -54,7 +54,7 @@ const DaoMenu = (props: Props) => { {({ active }) => { return ( { - const green = ['bg-green-50', 'text-green-700', 'ring-green-600/20'] - const red = ['bg-red-50', 'text-red-700', 'ring-red-600/20'] - const gray = ['bg-gray-50', 'text-gray-700', 'ring-gray-600/20'] + const green = ['bg-green-50', 'text-green-700', 'ring-green-600/20']; + const red = ['bg-red-50', 'text-red-700', 'ring-red-600/20']; + const gray = ['bg-gray-50', 'text-gray-700', 'ring-gray-600/20']; const colors: Record = { suceeded: green, executed: green, diff --git a/hooks/useProposals.ts b/hooks/useProposals.ts index 44ee838..0e29c10 100644 --- a/hooks/useProposals.ts +++ b/hooks/useProposals.ts @@ -104,7 +104,7 @@ const createFetcher = ); }; -export const useL1Proposals = ({fetchProposalState}: {fetchProposalState?: boolean}) => { +export const useL1Proposals = ({ fetchProposalState }: { fetchProposalState?: boolean }) => { const { l1, id: daoId } = useConfig(); const publicClient = usePublicClient({ chainId: l1.chain.id }); const { address } = useAccount(); @@ -129,7 +129,7 @@ export const useL1Proposals = ({fetchProposalState}: {fetchProposalState?: boole }; }), }); - const { + const { data: proposalState, isLoading: proposalStateIsLoading, error: proposalStateError, @@ -143,7 +143,7 @@ export const useL1Proposals = ({fetchProposalState}: {fetchProposalState?: boole args: [proposal.proposalId || '0'], }; }), - enabled: Boolean(fetchProposalState), + enabled: Boolean(fetchProposalState), }); const data = proposalData?.map((proposal, i) => { @@ -151,7 +151,7 @@ export const useL1Proposals = ({fetchProposalState}: {fetchProposalState?: boole tallyLink: `${l1.tallyGovernorDomain}/proposal/${proposal.proposalId}`, ...proposal, votingPower: (votingPower?.[i]?.result as bigint) || BigInt(0), - status: proposalState?.[i].result, + status: proposalState?.[i].result as number, }; }); return { @@ -260,23 +260,23 @@ const statusLabel = (contractStatus?: number) => { }; export const useProposals = () => { - const { data: l1Proposals, isLoading: isL1Loading } = useL1Proposals({fetchProposalState: true}); + const { data: l1Proposals, isLoading: isL1Loading } = useL1Proposals({ + fetchProposalState: true, + }); const { data: l2Proposals, isLoading: isL2Loading } = useL2Proposals(l1Proposals); const { data: l2ProposalsState, isLoading: isL2StateLoading } = useL2ProposalsState(l1Proposals); const { l1 } = useConfig(); const { data: l1Block } = useBlockNumber({ chainId: l1.chain.id }); const data: Proposal[] | undefined = l1Proposals - ?.map((proposal, i) => { + ?.map((proposal) => { const l2Proposal = l2Proposals?.find( (l2Proposal) => l2Proposal.proposalId === proposal.proposalId ); const l2ProposalState = l2ProposalsState?.find( (l2ProposalState) => proposal.proposalId === l2ProposalState.proposalId )?.state; - const l1ProposalStatus = proposal.isCancelled - ? 'cancelled' - : statusLabel(proposal?.status); + const l1ProposalStatus = proposal.isCancelled ? 'cancelled' : statusLabel(proposal?.status); const l2ProposalStatus = !l2Proposal?.isCancelled && l2ProposalsState?.length && l2ProposalState ? statusLabel(l2ProposalState as number)