Skip to content

showing application count on home screen #3764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/data-layer/src/data-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,6 @@ export class DataLayer {
orderBy,
filter,
whitelistedPrograms,
query = getRoundsQuery,
}: {
chainIds: number[];
first: number;
Expand All @@ -955,7 +954,7 @@ export class DataLayer {
whitelistedPrograms?: string[];
query?: string | undefined;
}): Promise<{ rounds: RoundGetRound[] }> {
return await request(this.gsIndexerEndpoint, query, {
return await request(this.gsIndexerEndpoint, getRoundsQuery, {
orderBy: orderBy ?? "NATURAL",
chainIds,
first,
Expand Down
29 changes: 0 additions & 29 deletions packages/data-layer/src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,35 +605,6 @@ export const getBlockNumberQuery = gql`
`;

export const getRoundsQuery = gql`
query GetRounds(
$first: Int
$orderBy: [RoundsOrderBy!]
$filter: RoundFilter
) {
rounds(first: $first, orderBy: $orderBy, filter: $filter) {
id
chainId
tags
roundMetadata
roundMetadataCid
applicationsStartTime
applicationsEndTime
donationsStartTime
donationsEndTime
matchAmountInUsd
matchAmount
matchTokenAddress
strategyId
strategyName
strategyAddress
applications(first: 1000, filter: { status: { equalTo: APPROVED } }) {
id
}
}
}
`;

export const getRoundsQueryWithAllApplications = gql`
query GetRounds(
$first: Int
$orderBy: [RoundsOrderBy!]
Expand Down
4 changes: 1 addition & 3 deletions packages/grant-explorer/src/features/api/rounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { RoundGetRound, RoundsQueryVariables, useDataLayer } from "data-layer";
export const useRounds = (
variables: RoundsQueryVariables,
chainIds: number[],
onlywWhitelistedPrograms = false,
gqlQuery: string | undefined
onlywWhitelistedPrograms = false
): SWRResponse<RoundGetRound[]> => {
const dataLayer = useDataLayer();

Expand All @@ -27,7 +26,6 @@ export const useRounds = (
first: 500,
chainIds,
whitelistedPrograms,
query: gqlQuery,
}),
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { getExplorerPageTitle } from "./utils/getExplorerPageTitle";
import { RoundsGrid } from "./RoundsGrid";
import { getEnabledChains } from "../../app/chainConfig";
import { useMemo } from "react";
import { getRoundsQueryWithAllApplications } from "data-layer/src/queries";

const ExploreRoundsPage = () => {
const [params] = useSearchParams();
Expand All @@ -20,8 +19,7 @@ const ExploreRoundsPage = () => {
const rounds = useFilterRounds(
filter,
getEnabledChains(),
filter.status.includes("verified"),
getRoundsQueryWithAllApplications
filter.status.includes("verified")
);

const publicRounds = useMemo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export const ROUNDS_ENDING_SOON_FILTER: RoundSelectionParams & {
export const useFilterRounds = (
where: RoundSelectionParams,
chains: TChain[],
onlywWhitelistedPrograms?: boolean,
gqlQuery?: string | undefined
onlywWhitelistedPrograms?: boolean
): SWRResponse<RoundGetRound[]> => {
const chainIds =
where.network === undefined || where.network.trim() === ""
Expand Down Expand Up @@ -104,7 +103,7 @@ export const useFilterRounds = (
const orderBy =
where.orderBy === undefined ? "CREATED_AT_BLOCK_DESC" : where.orderBy;
const vars = { orderBy, filter };
return useRounds(vars, chainIds, onlywWhitelistedPrograms, gqlQuery);
return useRounds(vars, chainIds, onlywWhitelistedPrograms);
};

const createRoundWhereFilter = (
Expand Down
Loading