diff --git a/packages/round-manager/src/context/round/RoundContext.tsx b/packages/round-manager/src/context/round/RoundContext.tsx index 50132fda4..d2bf2de20 100644 --- a/packages/round-manager/src/context/round/RoundContext.tsx +++ b/packages/round-manager/src/context/round/RoundContext.tsx @@ -261,6 +261,7 @@ export const useRoundsByAddress = (chainIds: number[], address?: string) => { address.toLowerCase() ); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [switchToVersion]); return { ...context.state, dispatch: context.dispatch }; diff --git a/packages/round-manager/src/features/api/AlloWrapper.tsx b/packages/round-manager/src/features/api/AlloWrapper.tsx index 1578331d5..679d51dce 100644 --- a/packages/round-manager/src/features/api/AlloWrapper.tsx +++ b/packages/round-manager/src/features/api/AlloWrapper.tsx @@ -57,7 +57,7 @@ function AlloWrapper({ children }: { children: JSX.Element | JSX.Element[] }) { } return alloBackend; - }, [address, chainID]); + }, [address, chain?.id, chainID]); return ( diff --git a/packages/round-manager/src/features/program/ProgramListPage.tsx b/packages/round-manager/src/features/program/ProgramListPage.tsx index f1cda9207..a3eb51316 100644 --- a/packages/round-manager/src/features/program/ProgramListPage.tsx +++ b/packages/round-manager/src/features/program/ProgramListPage.tsx @@ -1,29 +1,16 @@ import React from "react"; import { Link } from "react-router-dom"; -import { - ArrowNarrowRightIcon, - ChevronUpIcon, - PlusIcon, -} from "@heroicons/react/solid"; +import { ArrowNarrowRightIcon, PlusIcon } from "@heroicons/react/solid"; import { Spinner } from "../common/Spinner"; -import Navbar from "../common/Navbar"; -// import { ReactComponent as Banner } from "../../assets/programs/city-voxel.svg"; -import Footer from "common/src/components/Footer"; import { datadogLogs } from "@datadog/browser-logs"; import { usePrograms } from "../../context/program/ReadProgramContext"; import { ProgressStatus } from "../api/types"; import { useAlloVersion } from "common/src/components/AlloVersionSwitcher"; import { ExclamationCircleIcon } from "@heroicons/react/solid"; -import { allChains } from "../../app/wagmi"; -import { useRoundsByAddress } from "../../context/round/RoundContext"; -import { useAccount } from "wagmi"; -import { getChainById, stringToBlobUrl } from "common"; import { ProgramCard } from "./ProgramCard"; -import { RoundCard } from "../round/RoundCard"; const maxProgramsPerRow = 4; -const maxRoundsPerSite = 5; const startAProgramCard = ( @@ -43,27 +30,20 @@ const startAProgramCard = ( ); function ListPrograms() { - datadogLogs.logger.info("====> Route: /"); + datadogLogs.logger.info("====> Route: /ProgramListPage.tsx"); datadogLogs.logger.info(`====> URL: ${window.location.href}`); - const { address } = useAccount(); const { version, switchToVersion } = useAlloVersion(); const { programs, fetchProgramsStatus, listProgramsError } = usePrograms(); - const { data: rounds } = useRoundsByAddress( - allChains.map((chain) => chain.id), - address - ); const [viewAllPrograms, setViewAllPrograms] = React.useState(false); - const [viewAllRounds, setViewAllRounds] = React.useState(false); + const isSuccess = + fetchProgramsStatus === ProgressStatus.IS_SUCCESS && !listProgramsError; function hasNoPrograms() { return !programs || programs.length === 0; } - const isSuccess = - fetchProgramsStatus === ProgressStatus.IS_SUCCESS && !listProgramsError; - - const programList = programs.map((program, key) => ( + const ProgramList = programs.map((program, key) => ( )); - const roundList = rounds.map((round, key) => { - if (!round.chainId) return; - const chain = getChainById(round.chainId); - return ( - - -
- {/* todo: add the chain/network icon */} - Chain - {chain.prettyName} -
- - } - /> - - ); - }); - return (
{fetchProgramsStatus === ProgressStatus.IN_PROGRESS && ( @@ -155,8 +108,8 @@ function ListPrograms() { )}
-
-
+
+
Programs @@ -169,7 +122,7 @@ function ListPrograms() { {viewAllPrograms ? "View less" : "View all"}
-
+
@@ -179,12 +132,12 @@ function ListPrograms() {
-
+
{isSuccess && hasNoPrograms() && startAProgramCard}
{viewAllPrograms - ? programList - : programList.slice(0, maxProgramsPerRow * 2)} + ? ProgramList + : ProgramList.slice(0, maxProgramsPerRow * 2)}
diff --git a/packages/round-manager/src/features/round/ApplicationDirectPayout.tsx b/packages/round-manager/src/features/round/ApplicationDirectPayout.tsx index a45ae71d7..29cd3bb02 100644 --- a/packages/round-manager/src/features/round/ApplicationDirectPayout.tsx +++ b/packages/round-manager/src/features/round/ApplicationDirectPayout.tsx @@ -7,7 +7,6 @@ import { useWallet } from "../common/Auth"; import { useForm } from "react-hook-form"; import { yupResolver } from "@hookform/resolvers/yup"; import * as yup from "yup"; - import { ExternalLinkIcon } from "@heroicons/react/outline"; import { Erc20__factory } from "../../types/generated/typechain"; import { usePayout } from "../../context/application/usePayout"; @@ -322,7 +321,7 @@ export default function ApplicationDirectPayout({ round, application }: Props) { setPayoutTokensMap(map); }; createPayoutTokenMap(); - }, [fetchTokenData, application.applicationIndex, payouts]); + }, [fetchTokenData, application.applicationIndex, payouts, chain.id]); return ( <> diff --git a/packages/round-manager/src/features/round/RoundListPage.tsx b/packages/round-manager/src/features/round/RoundListPage.tsx index 72666a4f2..8630d6512 100644 --- a/packages/round-manager/src/features/round/RoundListPage.tsx +++ b/packages/round-manager/src/features/round/RoundListPage.tsx @@ -1,11 +1,8 @@ import React from "react"; import { Link } from "react-router-dom"; -import { ChevronUpIcon, PlusIcon } from "@heroicons/react/solid"; +import { ChevronUpIcon } from "@heroicons/react/solid"; import { Spinner } from "../common/Spinner"; -import Navbar from "../common/Navbar"; -// import { ReactComponent as Banner } from "../../assets/programs/city-voxel.svg"; -import Footer from "common/src/components/Footer"; import { datadogLogs } from "@datadog/browser-logs"; import { ProgressStatus } from "../api/types"; import { useAlloVersion } from "common/src/components/AlloVersionSwitcher"; @@ -19,7 +16,7 @@ import { RoundCard } from "./RoundCard"; const maxRoundsPerSite = 5; function ListRounds() { - datadogLogs.logger.info("====> Route: /"); + datadogLogs.logger.info("====> Route: /RoundListPage.tsx"); datadogLogs.logger.info(`====> URL: ${window.location.href}`); const { address } = useAccount(); @@ -32,7 +29,6 @@ function ListRounds() { allChains.map((chain) => chain.id), address ); - const [viewAllPrograms, setViewAllPrograms] = React.useState(false); const [viewAllRounds, setViewAllRounds] = React.useState(false); function hasNoRounds() { diff --git a/packages/round-manager/src/features/round/ViewFundGrantees.tsx b/packages/round-manager/src/features/round/ViewFundGrantees.tsx index 2d9f6decc..6c69611e2 100644 --- a/packages/round-manager/src/features/round/ViewFundGrantees.tsx +++ b/packages/round-manager/src/features/round/ViewFundGrantees.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { Tab } from "@headlessui/react"; import { ExclamationCircleIcon as NonFinalizedRoundIcon } from "@heroicons/react/outline"; @@ -56,13 +57,13 @@ export default function ViewFundGrantees(props: { } setPaidProjects(projects["paid"]); setUnpaidProjects(projects["unpaid"]); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [projects]); return (

Fund Grantees

{props.isRoundFinalized ? ( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion (false); const [showInfoModal, setShowInfoModal] = useState(false); - const [ openReadyForDistributionProgressModal, setOpenReadyForDistributionProgressModal, ] = useState(false); - const [finalizingDistributionStatus, setFinalizingDistributionStatus] = useState(ProgressStatus.IN_PROGRESS); - const [indexingStatus, setIndexingStatus] = useState( ProgressStatus.NOT_STARTED ); - const tokenDetail = props.token.address == ethers.constants.AddressZero ? { address: assertAddress(props.round?.payoutStrategy.id) } @@ -235,10 +229,8 @@ export function PayProjectsTable(props: { address: assertAddress(props.round?.payoutStrategy.id), token: assertAddress(props.token.address), }; - const tokenBalance = useBalance(tokenDetail); const navigate = useNavigate(); - const distributionSteps: ProgressStep[] = [ { name: "Distributing Funds", diff --git a/packages/round-manager/src/index.tsx b/packages/round-manager/src/index.tsx index 3e623535a..dadfd2f3b 100644 --- a/packages/round-manager/src/index.tsx +++ b/packages/round-manager/src/index.tsx @@ -28,7 +28,6 @@ import AccessDenied from "./features/common/AccessDenied"; import Auth from "./features/common/Auth"; import NotFound from "./features/common/NotFoundPage"; import CreateProgram from "./features/program/CreateProgramPage"; -import Program from "./features/program/ProgramListPage"; import LandingPage from "./features/common/LandingPage"; import ViewProgram from "./features/program/ViewProgramPage"; import CreateRound from "./features/round/CreateRoundPage";