Skip to content

Commit 6bd5da4

Browse files
committed
add verified filter
1 parent 559611b commit 6bd5da4

File tree

7 files changed

+20
-11
lines changed

7 files changed

+20
-11
lines changed

packages/grant-explorer/src/features/api/rounds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const useRounds = (
1313
const query = useSWR(
1414
// Cache requests on chainIds and variables as keys (when these are the
1515
// same, cache will be used instead of new requests)
16-
["rounds", chainIds, variables],
16+
["rounds", chainIds, variables, onlywWhitelistedPrograms],
1717
async () => {
1818
const whitelistedPrograms = onlywWhitelistedPrograms
1919
? await getWhitelistedPrograms()

packages/grant-explorer/src/features/discovery/ExploreRoundsPage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ import { getExplorerPageTitle } from "./utils/getExplorerPageTitle";
1111
import { RoundsGrid } from "./RoundsGrid";
1212
import { getEnabledChains } from "../../app/chainConfig";
1313
import { useMemo } from "react";
14-
import { getWhitelistedPrograms } from "common";
1514

1615
const ExploreRoundsPage = () => {
1716
const [params] = useSearchParams();
1817
const filter = getRoundSelectionParamsFromUrlParams(params);
1918
// Pass the filter from the search params and build the graphql query
20-
const rounds = useFilterRounds(filter, getEnabledChains(), true);
19+
const rounds = useFilterRounds(
20+
filter,
21+
getEnabledChains(),
22+
filter.status.includes("verified")
23+
);
2124

2225
const publicRounds = useMemo(
2326
() =>

packages/grant-explorer/src/features/discovery/FilterDropdown.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ export const FILTER_OPTIONS: RoundFilterUiOption[] = [
4141
},
4242
],
4343
},
44-
4544
{
4645
label: "Status",
4746
value: "status",
4847
children: [
48+
{
49+
label: "Verified",
50+
value: "verified",
51+
},
4952
{
5053
label: "Active",
5154
value: RoundStatus.active,
@@ -75,7 +78,6 @@ export function FilterDropdown() {
7578

7679
const filter = getRoundSelectionParamsFromUrlParams(params);
7780
const { status = "", type = "", network = "" } = filter;
78-
7981
const selected = getFilterLabel({ status, type, network });
8082
return (
8183
<Dropdown
@@ -133,7 +135,7 @@ export function FilterDropdown() {
133135
>
134136
<Disclosure.Panel
135137
static
136-
className=" mt-1 w-full overflow-auto p-2"
138+
className="mt-1 w-full overflow-auto p-2"
137139
>
138140
{children
139141
?.filter((child) => !child.hide)

packages/grant-explorer/src/features/discovery/LandingPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const LandingPage = () => {
8383
<ViewAllLink
8484
to={`/rounds?${toQueryString({
8585
orderBy: ROUNDS_ENDING_SOON_FILTER.orderBy,
86-
status: RoundStatus.active,
86+
status: `${RoundStatus.active},verified`,
8787
})}`}
8888
>
8989
View all

packages/grant-explorer/src/features/discovery/LandingTabs.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ export default function LandingTabs() {
3131
{
3232
to: `/rounds?${toQueryString({
3333
orderBy: "MATCH_AMOUNT_IN_USD_DESC",
34-
status: [RoundStatus.active, RoundStatus.taking_applications].join(","),
34+
status: [
35+
RoundStatus.active,
36+
RoundStatus.taking_applications,
37+
"verified",
38+
].join(","),
3539
})}`,
3640
activeRegExp: /^\/rounds/,
3741
children: isDesktop ? "Explore rounds" : "Rounds",

packages/grant-explorer/src/features/discovery/hooks/useFilterRounds.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export enum RoundStatus {
5757

5858
export const ACTIVE_ROUNDS_FILTER: RoundSelectionParams = {
5959
orderBy: "MATCH_AMOUNT_IN_USD_DESC",
60-
status: RoundStatus.active,
60+
status: `${RoundStatus.active},verified`,
6161
type: "allov2.DonationVotingMerkleDistributionDirectTransferStrategy,allov1.QF",
6262
network: "",
6363
};
@@ -69,7 +69,7 @@ export const ROUNDS_ENDING_SOON_FILTER: RoundSelectionParams & {
6969
orderBy: "DONATIONS_END_TIME_ASC",
7070
type: "",
7171
network: "",
72-
status: RoundStatus.ending_soon,
72+
status: `${RoundStatus.ending_soon},verified`,
7373
};
7474

7575
export const useFilterRounds = (

packages/grant-explorer/src/features/discovery/utils/createRoundsStatusFilter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function createRoundsStatusFilter(
4848
): TimeFilterVariables[] {
4949
// Default to all filters
5050
const selectedFilters =
51-
status ||
51+
status.replace(",verified", "") ||
5252
[
5353
RoundStatus.active,
5454
RoundStatus.taking_applications,

0 commit comments

Comments
 (0)