Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating committed Nov 27, 2023
1 parent ba48c8c commit 9696c60
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions components/DaoMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = {
value: T;
Expand All @@ -20,7 +20,7 @@ type Props<T> = {

const DaoMenu = <T,>(props: Props<T>) => {
const config = useConfig();
const pathName= usePathname();
const pathName = usePathname();

return (
<Menu as="div" className={`relative inline-block text-left ${props.className}`}>
Expand Down Expand Up @@ -54,7 +54,7 @@ const DaoMenu = <T,>(props: Props<T>) => {
{({ active }) => {
return (
<Link
href={`/${option.value}/${pathName.split("/").slice(-1)}`}
href={`/${option.value}/${pathName.split('/').slice(-1)}`}
className={clsx(
active ? ' flex bg-gray-100 text-gray-900' : 'text-gray-700',
'flex block px-4 py-2 text-sm'
Expand Down
6 changes: 3 additions & 3 deletions components/ProposalRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ export default function ProposalRow({
}

const ProposalState = ({ status }: { status: string }) => {
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<string, string[]> = {
suceeded: green,
executed: green,
Expand Down
18 changes: 9 additions & 9 deletions hooks/useProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -129,7 +129,7 @@ export const useL1Proposals = ({fetchProposalState}: {fetchProposalState?: boole
};
}),
});
const {
const {
data: proposalState,
isLoading: proposalStateIsLoading,
error: proposalStateError,
Expand All @@ -143,15 +143,15 @@ export const useL1Proposals = ({fetchProposalState}: {fetchProposalState?: boole
args: [proposal.proposalId || '0'],
};
}),
enabled: Boolean(fetchProposalState),
enabled: Boolean(fetchProposalState),
});

const data = proposalData?.map((proposal, i) => {
return {
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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9696c60

Please sign in to comment.