Skip to content

Commit

Permalink
map gg20 rounds as passport-mbds rounds (#3420)
Browse files Browse the repository at this point in the history
* feat: gg20Rounds to be passport-mbds rounds

* feat: update cluster match option text in round results

* chore: update gg20 rounds

* fix: explorer ui issue once a round has ended
  • Loading branch information
bhargavaparoksham authored May 8, 2024
1 parent 2b91133 commit 13813a9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 25 deletions.
19 changes: 19 additions & 0 deletions packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,22 @@ export function isChainIdSupported(chainId: number) {
}
return Object.values(ChainId).includes(chainId);
}

const gg20Rounds = [
//GG20 rounds
{ roundId: "23", chainId: 42161 }, // Hackathon Alumni
{ roundId: "24", chainId: 42161 }, // ENS
{ roundId: "25", chainId: 42161 }, // dApps & Apps
{ roundId: "26", chainId: 42161 }, // WEB3 Infrastructure
{ roundId: "27", chainId: 42161 }, // Developer Tooling
{ roundId: "28", chainId: 42161 }, // Hypercerts Ecosystem
{ roundId: "29", chainId: 42161 }, // Climate Solutions
{ roundId: "31", chainId: 42161 }, // Open Civics
{ roundId: "36", chainId: 42161 }, // Regenerative Land Projects
{ roundId: "39", chainId: 42161 }, // DeSci
{ roundId: "9", chainId: 10 }, // Token Engineering Commons (TEC)
];

export function isGG20Round(roundId: string, chainId: number) {
return gg20Rounds.some((r) => r.roundId === roundId && r.chainId === chainId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export default function ViewProjectDetails() {
round?.roundMetadata?.quadraticFundingConfig?.sybilDefense !== "none";

const { grants } = useGap(projectToRender?.projectRegistryId as string);
const { stats } = useOSO(projectToRender?.projectMetadata.projectGithub as string);
const { stats } = useOSO(
projectToRender?.projectMetadata.projectGithub as string
);

const currentTime = new Date();
const isAfterRoundEndDate =
Expand Down Expand Up @@ -229,7 +231,11 @@ export default function ViewProjectDetails() {
return (
<>
<DefaultLayout>
{isAfterRoundEndDate && <RoundEndedBanner />}
{isAfterRoundEndDate && (
<div className="relative top-6">
<RoundEndedBanner />
</div>
)}
<div className="flex flex-row justify-between my-8">
<div className="flex items-center pt-2" data-testid="bread-crumbs">
<Breadcrumb items={breadCrumbs} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ function AfterRoundStart(props: {
<DefaultLayout>
{showCartNotification && renderCartNotification()}
{props.isAfterRoundEndDate && (
<div className="relative top-16">
<div className="relative top-6">
<RoundEndedBanner />
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
UploadIcon,
} from "@heroicons/react/solid";
import { useDropzone } from "react-dropzone";
import { classNames } from "common";
import { classNames, isGG20Round } from "common";
import { Button } from "common/src/styles";
import { useDebugMode, useRoundMatchingFunds } from "../../../hooks";
import {
Expand Down Expand Up @@ -376,8 +376,9 @@ function ViewRoundResults({

const disableRoundSaturationControls = Math.round(roundSaturation) >= 100;

const sybilDefense =
round.roundMetadata?.quadraticFundingConfig?.sybilDefense;
const sybilDefense = isGG20Round(round.id, chain.id)
? "passport-mbds"
: round.roundMetadata?.quadraticFundingConfig?.sybilDefense;

const isCustomResults =
(sybilDefense === "passport-mbds" && isRecommendedDistribution) ||
Expand Down Expand Up @@ -473,13 +474,7 @@ function ViewRoundResults({
>
<RadioGroup.Option value={true}>
{({ checked }) => (
<div
className={classNames(
"cursor-pointer flex flex-row my-2",
disableRoundSaturationControls &&
"opacity-50 cursor-not-allowed"
)}
>
<div className="cursor-pointer flex flex-row my-2">
<input
type="radio"
className="text-indigo-600 items-start mt-0.5 focus:ring-indigo-500"
Expand All @@ -497,16 +492,23 @@ function ViewRoundResults({
<span className="text-sm mt-1 ml-2 text-gray-400">
Since you selected frictionless auto-sybil
detection at setup, select this option. Please
use{" "}
use this{" "}
<a
className="underline"
target="_blank"
href={`https://qf-calculator.fly.dev/?round_id=${round.id}&chain_id=${chain.id}`}
>
cluster matching template
</a>{" "}
to calculate your results. Click{" "}
<a
className="underline"
target="_blank"
href="https://roundoperations.gitcoin.co/round-operations/post-round/cluster-matching-and-csv-upload"
>
this{" "}
</a>
cluster matching template to calculate your
results.
here
</a>{" "}
to learn more.
</span>
</div>
) : sybilDefense === "passport" ? (
Expand Down Expand Up @@ -539,13 +541,7 @@ function ViewRoundResults({
</RadioGroup.Option>
<RadioGroup.Option value={false}>
{({ checked }) => (
<div
className={classNames(
"cursor-pointer flex my-2",
disableRoundSaturationControls &&
"opacity-50 cursor-not-allowed"
)}
>
<div className="cursor-pointer flex my-2">
<input
type="radio"
className="text-indigo-600 items-start mt-0.5 focus:ring-indigo-500"
Expand Down

0 comments on commit 13813a9

Please sign in to comment.