diff --git a/packages/builder/src/components/grants/ApplicationCard.tsx b/packages/builder/src/components/grants/ApplicationCard.tsx index 53e3c82e4..3f0e53980 100644 --- a/packages/builder/src/components/grants/ApplicationCard.tsx +++ b/packages/builder/src/components/grants/ApplicationCard.tsx @@ -10,7 +10,6 @@ import { useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; import { Link } from "react-router-dom"; import { loadRound } from "../../actions/rounds"; -import { roundApplicationViewPath } from "../../routes"; import { ApplicationCardType, RoundSupport } from "../../types"; import { formatDate, @@ -196,17 +195,8 @@ export default function ApplicationCard({ return null; } - const applicationStartTime = new Date(props.round.applicationsStartTime); - const showCheckerLink = - applicationStartTime >= new Date("2024-12-01T00:00:00Z"); - - const applicationViewLink = showCheckerLink - ? `https://beta.checker.gitcoin.co/view/application/${applicationData.chainId}/${applicationData.roundID}/${applicationData.application.id}` - : roundApplicationViewPath( - applicationData.chainId.toString(), - applicationData.roundID, - applicationData.application.metadataCid || "" - ); + const applicationViewLink = `https://beta.checker.gitcoin.co/view/application/ + ${applicationData.chainId}/${applicationData.roundID}/${applicationData.application.id}`; return ( - new Date(unixTS).toLocaleDateString(undefined); - -function ViewApplication() { - const params = useParams(); - const navigate = useNavigate(); - const dispatch = useDispatch(); - const allo = useAllo(); - - const dataLayer = useDataLayer(); - - const { chainId, roundId, ipfsHash } = params; - - const props = useSelector((state: RootState) => { - const roundState = state.rounds[roundId!]; - const roundStatus = roundState ? roundState.status : RoundStatus.Undefined; - const applicationState = state.roundApplication[roundId!]; - const applicationStatus: ApplicationStatus = applicationState - ? applicationState.status - : ApplicationStatus.Undefined; - - const roundError = roundState ? roundState.error : undefined; - const round = roundState ? roundState.round : undefined; - const publishedApplicationMetadata = applicationState - ? applicationState.metadataFromIpfs![ipfsHash!] - : undefined; - const showErrorModal = - !!publishedApplicationMetadata?.publishedApplicationData?.error; - - const roundApplicationStatus = - publishedApplicationMetadata?.status ?? "IN_REVIEW"; - - const web3ChainId = state.web3.chainID; - const roundChainId = Number(chainId); - const projectId = - publishedApplicationMetadata?.publishedApplicationData?.application - ?.project?.id; - - return { - roundState, - roundStatus, - roundError, - round, - applicationState, - applicationStatus, - applicationMetadata: round?.applicationMetadata, - publishedApplicationMetadata, - showErrorModal, - web3ChainId, - roundChainId, - projectId, - roundApplicationStatus, - }; - }, shallowEqual); - - useEffect(() => { - if (roundId !== undefined || !props.publishedApplicationMetadata) { - dispatch(unloadRounds()); - dispatch(loadRound(roundId!, dataLayer, props.roundChainId)); - } - }, [dispatch, roundId]); - - useEffect(() => { - if (!props.round) return; - - if (params.ipfsHash !== undefined) { - dispatch(fetchApplicationData(ipfsHash!, roundId!)); - } - }, [dispatch, params.ipfsHash, props.round]); - - if (props.roundStatus === RoundStatus.Error) { -
- navigate(grantsPath())} - onRetry={() => navigate(0)} - > - <> - There has been an error loading the grant round data. Please try - refreshing the page. If the issue persists, please reach out to us on{" "} - - Discord. - - - -
; - } - - const isDirectRound = props.round?.payoutStrategy === RoundCategory.Direct; - const roundInReview = props.roundApplicationStatus === "IN_REVIEW"; - const roundApproved = props.roundApplicationStatus === "APPROVED"; - const hasProperStatus = roundInReview || roundApproved; - - if ( - props.roundState === undefined || - props.round === undefined || - props.publishedApplicationMetadata === undefined - ) { - return ( - - ); - } - - return ( -
-
-

Grant Round Application

- -
-
-
-

Grant Round

-

{props.round.programName ?? ""}

-

{props.round.roundMetadata.name}

- {isDirectRound && hasProperStatus && ( - <> -

Contact Information:

- - {props.round.roundMetadata.support?.info} - - - )} - {!isDirectRound && ( - <> -

Application Period:

-

- {formatDate(props.round.applicationsStartTime * 1000)} -{" "} - {isInfinite(props.round.applicationsEndTime) || - !props.round.applicationsEndTime - ? "No End Date" - : formatDate(props.round.applicationsEndTime * 1000)} -

- - )} -

Round Dates:

-

- {formatDate(props.round.roundStartTime * 1000)} -{" "} - {isInfinite(props.round.applicationsEndTime) || - !props.round.applicationsEndTime - ? "No End Date" - : formatDate(props.round.roundEndTime * 1000)} -

-

- Need Help? Check out the{" "} - - Builder Guide. - -

-
-
- {!props.applicationMetadata === undefined && ( - - )} - {props.applicationMetadata && ( -
{ - if (allo === null) { - return; - } - dispatch( - submitApplication( - props.round!.id, - answers, - allo, - createLinkedProject, - dataLayer - ) - ); - }} - readOnly - setCreateLinkedProject={() => {}} - /> - )} -
-
-
- ); -} - -export default ViewApplication; diff --git a/packages/builder/src/index.tsx b/packages/builder/src/index.tsx index 669fc512a..b067a84de 100644 --- a/packages/builder/src/index.tsx +++ b/packages/builder/src/index.tsx @@ -23,7 +23,6 @@ import NewProject from "./components/grants/New"; import Project from "./components/grants/Show"; import RoundApply from "./components/rounds/Apply"; import RoundShow from "./components/rounds/Show"; -import ViewApplication from "./components/rounds/ViewApplication"; import history from "./history"; import reportWebVitals from "./reportWebVitals"; import { slugs } from "./routes"; @@ -138,10 +137,6 @@ root.render( path={slugs.roundApplication} element={} /> - } - /> } /> diff --git a/packages/builder/src/routes.tsx b/packages/builder/src/routes.tsx index 680381b1d..13da63392 100644 --- a/packages/builder/src/routes.tsx +++ b/packages/builder/src/routes.tsx @@ -6,7 +6,6 @@ export const slugs = { newGrant: `/projects/new`, round: `/chains/:chainId/rounds/:roundId`, roundApplication: `/chains/:chainId/rounds/:roundId/apply`, - roundApplicationView: `/chains/:chainId/rounds/:roundId/view/:ipfsHash`, }; export const rootPath = () => slugs.root; @@ -39,9 +38,3 @@ export const roundApplicationPathForProject = ( roundId: string, projectId: string ) => `/round/${chainId}/${roundId}/${projectId}`; - -export const roundApplicationViewPath = ( - chainId: string, - roundId: string, - ipfsHash: string -) => `/chains/${chainId}/rounds/${roundId}/view/${ipfsHash}`;