diff --git a/.env b/.env
index d466608671..83e442f22f 100644
--- a/.env
+++ b/.env
@@ -11,5 +11,4 @@ NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=d851f25304d67fc8e2dd3b354223e4fa
NEXT_PUBLIC_EDGE_CONFIG_ID=ecfg_buc5l6124c4koymyvseasbd1k3hs
NEXT_PUBLIC_EDGE_CONFIG_READ_ACCESS_TOKEN=8b337e65-3aa6-4949-97b8-c7eab7151128
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LcQm4onAAAAAOcoqkw9A5txg5SbuddONchMZKrF
-NEXT_PUBLIC_POLYGONID_API=https://guild-privacy.s.guild.xyz
NEXT_PUBLIC_BUGSNAG_KEY=4bd5799ac2cb4a34887513b80b845554
\ No newline at end of file
diff --git a/public/requirementLogos/polygonId.svg b/public/requirementLogos/polygonId.svg
deleted file mode 100644
index 55330eb3cd..0000000000
--- a/public/requirementLogos/polygonId.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-
diff --git a/public/requirementLogos/polygonId_white.svg b/public/requirementLogos/polygonId_white.svg
deleted file mode 100644
index 7d1250116a..0000000000
--- a/public/requirementLogos/polygonId_white.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
diff --git a/public/solutions/polygon-bg.jpg b/public/solutions/polygon-bg.jpg
deleted file mode 100644
index 771ca28cb6..0000000000
Binary files a/public/solutions/polygon-bg.jpg and /dev/null differ
diff --git a/src/app/globals.css b/src/app/globals.css
index 56cc700e65..024afcaabd 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -117,9 +117,6 @@
--github: 0 0% 20%;
--github-hover: 0 0% 18%;
--github-active: 0 0% 15%;
- --polygonid: 259 59% 59%;
- --polygonid-hover: 258 50% 52%;
- --polygonid-active: 256 44% 42%;
--farcaster: 261 55% 61%;
--farcaster-hover: 261 55% 55%;
@@ -235,8 +232,6 @@
--google-active: 212 96% 78%;
--github-hover: 0 0% 44%;
--github-active: 0 0% 68%;
- --polygonid-hover: 260 73% 70%;
- --polygonid-active: 262 81% 77%;
--farcaster-hover: 239 75% 75%;
--farcaster-active: 238 76% 81%;
}
diff --git a/src/components/[guild]/AddRewardButton/SelectRolePanel.tsx b/src/components/[guild]/AddRewardButton/SelectRolePanel.tsx
index da7c5336a8..065a484c0f 100644
--- a/src/components/[guild]/AddRewardButton/SelectRolePanel.tsx
+++ b/src/components/[guild]/AddRewardButton/SelectRolePanel.tsx
@@ -80,7 +80,7 @@ const SelectRolePanel = ({
const goBack = () => {
if (!rewards[selection].autoRewardSetup)
methods.reset(ADD_REWARD_FORM_DEFAULT_VALUES)
- setStep(selection === "POLYGON_ID" ? "HOME" : "REWARD_SETUP")
+ setStep("REWARD_SETUP")
}
return (
diff --git a/src/components/[guild]/JoinModal/JoinModal.tsx b/src/components/[guild]/JoinModal/JoinModal.tsx
index 6c18d6b796..1264afaead 100644
--- a/src/components/[guild]/JoinModal/JoinModal.tsx
+++ b/src/components/[guild]/JoinModal/JoinModal.tsx
@@ -31,7 +31,6 @@ import { useJoin } from "./hooks/useJoin"
import { JoinForm, Joinable } from "./types"
const customJoinStep: Partial>> = {
- POLYGON: dynamic(() => import("./components/ConnectPolygonIDJoinStep")),
CAPTCHA: dynamic(() => import("./components/CompleteCaptchaJoinStep")),
EMAIL: dynamic(() => import("./components/ConnectEmailJoinStep")),
}
diff --git a/src/components/[guild]/JoinModal/components/ConnectPolygonIDJoinStep.tsx b/src/components/[guild]/JoinModal/components/ConnectPolygonIDJoinStep.tsx
deleted file mode 100644
index d5672bdfbe..0000000000
--- a/src/components/[guild]/JoinModal/components/ConnectPolygonIDJoinStep.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { useWeb3ConnectionManager } from "@/components/Web3ConnectionManager/hooks/useWeb3ConnectionManager"
-import { useDisclosure } from "@/hooks/useDisclosure"
-import useSWRWithOptionalAuth from "hooks/useSWRWithOptionalAuth"
-import { ConnectPolygonIDModal } from "requirements/PolygonID/components/ConnectPolygonID"
-import { JoinStep } from "./JoinStep"
-
-const ConnectPolygonIDJoinStep = (): JSX.Element => {
- const { isWeb3Connected } = useWeb3ConnectionManager()
-
- const { data: isDone, isLoading } = useSWRWithOptionalAuth(
- `/v2/util/gate-proof-existence/POLYGON_ID_BASIC_MAIN`
- )
-
- const { onOpen, onClose, isOpen } = useDisclosure()
-
- return (
- <>
-
- ),
- disabled: !isWeb3Connected,
- isLoading,
- // TODO: extract it to a constant, just like we did with PLATFORM_COLORS
- className:
- "bg-purple-500 hover:bg-purple-600 hover:dark:bg-purple-400 active:bg-purple-700 active:dark:bg-purple-300 text-white",
- onClick: onOpen,
- children: isDone ? "Connected" : "Connect",
- }}
- />
-
-
- >
- )
-}
-
-// biome-ignore lint/style/noDefaultExport: we only load this component dynamically, so it's much more convenient to use a default export here
-export default ConnectPolygonIDJoinStep
diff --git a/src/components/[guild]/Requirements/components/RequirementAccessIndicator.tsx b/src/components/[guild]/Requirements/components/RequirementAccessIndicator.tsx
index e0928d38d4..aadf77b5b9 100644
--- a/src/components/[guild]/Requirements/components/RequirementAccessIndicator.tsx
+++ b/src/components/[guild]/Requirements/components/RequirementAccessIndicator.tsx
@@ -16,9 +16,6 @@ import dynamic from "next/dynamic"
import RequirementAccessIndicatorUI from "./RequirementAccessIndicatorUI"
import { useRequirementContext } from "./RequirementContext"
-const DynamicConnectPolygonID = dynamic(
- () => import("requirements/PolygonID/components/ConnectPolygonID")
-)
const DynamicCompleteCaptcha = dynamic(
() => import("requirements/Captcha/components/CompleteCaptcha")
)
@@ -80,9 +77,7 @@ const RequirementAccessIndicator = () => {
: "Connect account to check access"}
- {type === "POLYGON_ID_QUERY" || type === "POLYGON_ID_BASIC" ? (
-
- ) : type === "CAPTCHA" ? (
+ {type === "CAPTCHA" ? (
) : type.startsWith("GITCOIN_") ? (
diff --git a/src/components/[guild]/RolePlatforms/components/AddRoleRewardModal/components/AddPolygonIDPanel.tsx b/src/components/[guild]/RolePlatforms/components/AddRoleRewardModal/components/AddPolygonIDPanel.tsx
deleted file mode 100644
index 69aba6f522..0000000000
--- a/src/components/[guild]/RolePlatforms/components/AddRoleRewardModal/components/AddPolygonIDPanel.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import useGuild from "components/[guild]/hooks/useGuild"
-import { useEffect } from "react"
-import { AddRewardPanelProps } from "rewards"
-import { PlatformType } from "types"
-
-const AddPolygonIDPanel = ({ onAdd }: AddRewardPanelProps) => {
- const { id: guildId } = useGuild()
-
- useEffect(
- () =>
- onAdd({
- guildPlatform: {
- platformName: "POLYGON_ID",
- platformId: PlatformType.POLYGON_ID,
- platformGuildId: `polygonid-${guildId}`,
- },
- isNew: true,
- }),
- // eslint-disable-next-line react-hooks/exhaustive-deps
- []
- )
-
- return null
-}
-
-export default AddPolygonIDPanel
diff --git a/src/components/create-guild/PlatformsGrid/PlatformsGrid.tsx b/src/components/create-guild/PlatformsGrid/PlatformsGrid.tsx
index 0aba17dfd6..944d149ce8 100644
--- a/src/components/create-guild/PlatformsGrid/PlatformsGrid.tsx
+++ b/src/components/create-guild/PlatformsGrid/PlatformsGrid.tsx
@@ -1,7 +1,7 @@
import { Box, Heading, SimpleGrid, Stack, StackProps } from "@chakra-ui/react"
import useGuild from "components/[guild]/hooks/useGuild"
import rewards from "rewards"
-import { PlatformName, PlatformType } from "types"
+import { PlatformName } from "types"
import PlatformSelectButton from "./components/PlatformSelectButton"
type Props = {
@@ -44,16 +44,6 @@ const PlatformsGrid = ({ onSelection, disabledRewards, ...rest }: Props) => {
platform: "GATHER_TOWN",
description: "Manage spaces",
},
- ...(!guildPlatforms.find(
- (platform) => platform.platformId === PlatformType.POLYGON_ID
- )
- ? [
- {
- platform: "POLYGON_ID",
- description: "Prove role membership",
- } as PlatformsGridData,
- ]
- : []),
{
platform: "TEXT",
description: "Gate special content, links, etc",
@@ -69,7 +59,7 @@ const PlatformsGrid = ({ onSelection, disabledRewards, ...rest }: Props) => {
description: "Gamification utility",
isGeneral: true,
},
- ...(featureFlags.includes("ERC20")
+ ...(featureFlags?.includes("ERC20")
? [
{
platform: "ERC20",
diff --git a/src/env.js b/src/env.js
index e52a2e0398..56695eea03 100644
--- a/src/env.js
+++ b/src/env.js
@@ -43,7 +43,6 @@ export const env = createEnv({
// Guild APIs
NEXT_PUBLIC_API: z.string(),
NEXT_PUBLIC_BALANCY_API: z.string(),
- NEXT_PUBLIC_POLYGONID_API: z.string(),
// Captcha
NEXT_PUBLIC_RECAPTCHA_SITE_KEY: z.string(),
@@ -70,7 +69,6 @@ export const env = createEnv({
runtimeEnv: {
NEXT_PUBLIC_API: process.env.NEXT_PUBLIC_API,
NEXT_PUBLIC_BALANCY_API: process.env.NEXT_PUBLIC_BALANCY_API,
- NEXT_PUBLIC_POLYGONID_API: process.env.NEXT_PUBLIC_POLYGONID_API,
NEXT_PUBLIC_RECAPTCHA_SITE_KEY: process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY,
diff --git a/src/pages/[guild]/[group].tsx b/src/pages/[guild]/[group].tsx
index 5082c67eef..3c6d3c8b55 100644
--- a/src/pages/[guild]/[group].tsx
+++ b/src/pages/[guild]/[group].tsx
@@ -25,7 +25,6 @@ import useMembership from "components/explorer/hooks/useMembership"
import { GetStaticPaths, GetStaticProps } from "next"
import dynamic from "next/dynamic"
import Head from "next/head"
-import { MintPolygonIDProofProvider } from "rewards/PolygonID/components/MintPolygonIDProofProvider"
import { SWRConfig } from "swr"
import { Guild } from "types"
import fetcher from "utils/fetcher"
@@ -150,11 +149,9 @@ const GroupPageWrapper = ({ fallback }: Props): JSX.Element => {
-
-
-
-
-
+
+
+
>
diff --git a/src/pages/[guild]/index.tsx b/src/pages/[guild]/index.tsx
index ddaabe2884..0439835769 100644
--- a/src/pages/[guild]/index.tsx
+++ b/src/pages/[guild]/index.tsx
@@ -32,7 +32,6 @@ import dynamic from "next/dynamic"
import Head from "next/head"
import ErrorPage from "pages/_error"
import { useEffect } from "react"
-import { MintPolygonIDProofProvider } from "rewards/PolygonID/components/MintPolygonIDProofProvider"
import { SWRConfig } from "swr"
import { Guild, SocialLinkKey } from "types"
import fetcher from "utils/fetcher"
@@ -231,11 +230,9 @@ const GuildPageWrapper = ({ fallback }: Props): JSX.Element => {
-
-
-
-
-
+
+
+
diff --git a/src/requirements/PolygonID/PolygonIDForm.tsx b/src/requirements/PolygonID/PolygonIDForm.tsx
deleted file mode 100644
index aa86a13c6b..0000000000
--- a/src/requirements/PolygonID/PolygonIDForm.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import { Divider, FormControl, FormLabel, Stack } from "@chakra-ui/react"
-import ControlledSelect from "components/common/ControlledSelect"
-import FormErrorMessage from "components/common/FormErrorMessage"
-import { useFormContext, useWatch } from "react-hook-form"
-import ChainPicker from "requirements/common/ChainPicker"
-import { RequirementFormProps } from "requirements/types"
-import parseFromObject from "utils/parseFromObject"
-import PolygonIDBasic from "./components/PolygonIDBasic"
-import PolygonIDQuery from "./components/PolygonIDQuery"
-
-const polygonIDRequirementTypes = [
- {
- label: "Authenticate with PolygonID",
- value: "POLYGON_ID_BASIC",
- PolygonIDRequirement: PolygonIDBasic,
- },
- {
- label: "Satisfy query",
- value: "POLYGON_ID_QUERY",
- PolygonIDRequirement: PolygonIDQuery,
- },
-]
-
-const PolygonIDForm = ({
- baseFieldPath,
- field,
-}: RequirementFormProps): JSX.Element => {
- const {
- setValue,
- formState: { errors },
- } = useFormContext()
-
- const type = useWatch({ name: `${baseFieldPath}.type` })
- const isEditMode = !!field?.id
-
- const selected = polygonIDRequirementTypes.find(
- (reqType) => reqType.value === type
- )
-
- const resetFields = () => {
- setValue(`${baseFieldPath}.data.maxAmount`, undefined, {
- shouldValidate: true,
- })
- setValue(`${baseFieldPath}.data.query`, "", {
- shouldValidate: true,
- })
- }
-
- return (
-
-
-
- Type
-
-
-
-
- {parseFromObject(errors, baseFieldPath)?.type?.message}
-
-
-
- {selected?.PolygonIDRequirement && (
- <>
-
-
- >
- )}
-
- )
-}
-
-export default PolygonIDForm
diff --git a/src/requirements/PolygonID/PolygonIDRequirement.tsx b/src/requirements/PolygonID/PolygonIDRequirement.tsx
deleted file mode 100644
index f1f9782a28..0000000000
--- a/src/requirements/PolygonID/PolygonIDRequirement.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-import {
- Box,
- Button,
- Icon,
- Popover,
- PopoverArrow,
- PopoverBody,
- PopoverContent,
- PopoverTrigger,
- Portal,
- Text,
- useColorModeValue,
-} from "@chakra-ui/react"
-import { CaretDown } from "@phosphor-icons/react"
-import Requirement, {
- RequirementProps,
-} from "components/[guild]/Requirements/components/Requirement"
-import { useRequirementContext } from "components/[guild]/Requirements/components/RequirementContext"
-import DataBlock from "components/common/DataBlock"
-import formatRelativeTimeFromNow from "utils/formatRelativeTimeFromNow"
-import ConnectPolygonID from "./components/ConnectPolygonID"
-
-const PolygonIDRequirement = (props: RequirementProps) => {
- const bg = useColorModeValue("blackAlpha.100", "blackAlpha.300")
- const requirement = useRequirementContext()
-
- const proofAge =
- requirement.data?.maxAmount > 0 &&
- formatRelativeTimeFromNow(requirement.data.maxAmount)
-
- if (requirement?.data?.query)
- return (
- }
- {...props}
- >
- {`Satisfy the `}
- {requirement.data.query[0]?.query?.type}
- {` PolygonID `}
-
-
- }
- iconSpacing={1}
- >
- query
-
-
-
-
-
-
-
- {JSON.stringify(requirement.data.query, null, 2)}
-
-
-
-
-
-
- )
-
- return (
- }
- {...props}
- >
- {`Authenticate with PolygonID`}
- {requirement.chain !== "POLYGON" && " (on Mumbai)"}
- {proofAge && (
- <>
- {` (valid until `}
- {proofAge}
- {`)`}
- >
- )}
-
- )
-}
-
-export default PolygonIDRequirement
diff --git a/src/requirements/PolygonID/components/ConnectPolygonID.tsx b/src/requirements/PolygonID/components/ConnectPolygonID.tsx
deleted file mode 100644
index 5975c832a0..0000000000
--- a/src/requirements/PolygonID/components/ConnectPolygonID.tsx
+++ /dev/null
@@ -1,196 +0,0 @@
-import {
- Box,
- ButtonProps,
- Center,
- Img,
- ModalBody,
- ModalCloseButton,
- ModalContent,
- ModalHeader,
- ModalOverlay,
- Spinner,
- Text,
- useBreakpointValue,
- useDisclosure,
-} from "@chakra-ui/react"
-import { ArrowsClockwise } from "@phosphor-icons/react"
-import { useMembershipUpdate } from "components/[guild]/JoinModal/hooks/useMembershipUpdate"
-import { useRequirementContext } from "components/[guild]/Requirements/components/RequirementContext"
-import useUser from "components/[guild]/hooks/useUser"
-import Button from "components/common/Button"
-import ErrorAlert from "components/common/ErrorAlert"
-import { Modal } from "components/common/Modal"
-import { useRoleMembership } from "components/explorer/hooks/useMembership"
-import { useFetcherWithSign } from "hooks/useFetcherWithSign"
-import useShowErrorToast from "hooks/useShowErrorToast"
-import { QRCodeSVG } from "qrcode.react"
-import { useEffect } from "react"
-import useSWRImmutable from "swr/immutable"
-
-const ConnectPolygonID = (props: ButtonProps) => {
- const { id: userId } = useUser()
- const { id, roleId, type, data, chain } = useRequirementContext()
- const { onOpen, onClose, isOpen } = useDisclosure()
-
- const { reqAccesses } = useRoleMembership(roleId)
-
- const reqAccess = reqAccesses?.find((err) => err.requirementId === id)
- const errorType = reqAccess?.errorType
-
- // close modal (and stop revalidating access) on successful connect
- useEffect(() => {
- if (!errorType) onClose()
- }, [errorType, onClose])
-
- if (!userId || (!!reqAccess?.access && !errorType)) return null
-
- return (
- <>
- }
- iconSpacing={1}
- {...props}
- >
- {`${
- errorType === "PLATFORM_CONNECT_INVALID" ? "Reconnect" : "Connect"
- } PolygonID`}
-
-
-
- >
- )
-}
-
-type ConnectPolygonIDModalProps = {
- isOpen: boolean
- onClose: () => void
- type:
- | "POLYGON_ID_QUERY"
- | "POLYGON_ID_BASIC"
- | "POLYGON_ID_QUERY_MAIN"
- | "POLYGON_ID_BASIC_MAIN"
- data: {
- maxAmount?: number
- query?: Record
- }
-}
-
-const ConnectPolygonIDModal = ({
- isOpen,
- onClose,
- type,
- data,
-}: ConnectPolygonIDModalProps) => {
- const fetcherWithSign = useFetcherWithSign()
- const {
- data: response,
- isValidating,
- error,
- mutate,
- } = useSWRImmutable(
- isOpen
- ? [
- `/v2/util/gate-callbacks/session?requirementType=${type}`,
- { body: { query: data?.query } },
- ]
- : null,
- fetcherWithSign
- )
-
- const qrSize = useBreakpointValue({ base: 300, md: 400 })
-
- return (
-
-
-
- Connect PolygonID
-
-
-
- {error ? (
-
- ) : !response && isValidating ? (
- <>
-
-
- Generating QR code
-
- >
- ) : (
- <>
-
-
-
- }
- isLoading={isValidating}
- loadingText={"Generating QR code"}
- color="gray"
- onClick={() => mutate()}
- >
- Generate new QR code
-
-
- Scan with your Polygon ID app, then re-check access below! The
- modal will automatically close on successful connect
-
-
- >
- )}
-
-
-
-
- )
-}
-
-const RecheckConnectionButton = (): JSX.Element => {
- const showErrorToast = useShowErrorToast()
-
- const { triggerMembershipUpdate, isLoading } = useMembershipUpdate({
- onError: (error) => {
- const errorMsg = "Couldn't check access"
- const correlationId = error.correlationId
- showErrorToast(
- correlationId
- ? {
- error: errorMsg,
- correlationId,
- }
- : errorMsg
- )
- },
- })
-
- return (
-
- )
-}
-
-export default ConnectPolygonID
-export { ConnectPolygonIDModal }
diff --git a/src/requirements/PolygonID/components/PolygonIDBasic.tsx b/src/requirements/PolygonID/components/PolygonIDBasic.tsx
deleted file mode 100644
index a55ea732f3..0000000000
--- a/src/requirements/PolygonID/components/PolygonIDBasic.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import { RequirementFormProps } from "requirements/types"
-import PolygonIDProofAge from "./PolygonIDProofAge"
-
-const PolygonIDBasic = ({ baseFieldPath }: RequirementFormProps) => (
-
-)
-
-export default PolygonIDBasic
diff --git a/src/requirements/PolygonID/components/PolygonIDProofAge.tsx b/src/requirements/PolygonID/components/PolygonIDProofAge.tsx
deleted file mode 100644
index df8e5d59cc..0000000000
--- a/src/requirements/PolygonID/components/PolygonIDProofAge.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { FormControl, FormLabel } from "@chakra-ui/react"
-import FormErrorMessage from "components/common/FormErrorMessage"
-import { ControlledRelativeTimeInput } from "components/common/RelativeTimeInput"
-import { useFormState } from "react-hook-form"
-import { RequirementFormProps } from "requirements/types"
-import parseFromObject from "utils/parseFromObject"
-
-const PolygonIDProofAge = ({ baseFieldPath }: RequirementFormProps) => {
- const { errors } = useFormState()
-
- return (
-
- Maximum proof age
-
-
-
-
- {parseFromObject(errors, baseFieldPath).data?.maxAmount?.message}
-
-
- )
-}
-
-export default PolygonIDProofAge
diff --git a/src/requirements/PolygonID/components/PolygonIDQuery.tsx b/src/requirements/PolygonID/components/PolygonIDQuery.tsx
deleted file mode 100644
index 068a95bf3a..0000000000
--- a/src/requirements/PolygonID/components/PolygonIDQuery.tsx
+++ /dev/null
@@ -1,111 +0,0 @@
-import {
- FormControl,
- FormHelperText,
- FormLabel,
- Icon,
- Link,
- Stack,
- Text,
- Textarea,
-} from "@chakra-ui/react"
-import { ArrowSquareOut } from "@phosphor-icons/react"
-import FormErrorMessage from "components/common/FormErrorMessage"
-import { Controller, useFormContext } from "react-hook-form"
-import { RequirementFormProps } from "requirements/types"
-import parseFromObject from "utils/parseFromObject"
-import PolygonIDProofAge from "./PolygonIDProofAge"
-
-const PolygonIDQuery = ({ baseFieldPath }: RequirementFormProps) => {
- const {
- control,
- formState: { errors },
- } = useFormContext()
-
- return (
-
-
- Query:
-
-
- typeof value === "object" ||
- "Invalid JSON. Please paste it to a validator to find out more!",
- isArray: (value) =>
- Array.isArray(value) ||
- "The value should be an array of request objects. You should probably just wrap it in a []",
- },
- }}
- render={({ field: { onChange, onBlur, value: textareaValue, ref } }) => (
-
-
-
- )
-}
-
-function tryParseJSON(jsonString) {
- try {
- const o = JSON.parse(jsonString)
-
- if (o && typeof o === "object") {
- return o
- }
- } catch (e) {}
-
- return false
-}
-
-function tryStringifyJSON(jsonObject) {
- try {
- if (!jsonObject) return ""
-
- if (typeof jsonObject !== "object") return jsonObject
-
- return JSON.stringify(jsonObject, null, 2)
- } catch (e) {}
-
- return ""
-}
-
-export default PolygonIDQuery
diff --git a/src/requirements/requirementDisplayComponents.ts b/src/requirements/requirementDisplayComponents.ts
index cced28d562..9709165d04 100644
--- a/src/requirements/requirementDisplayComponents.ts
+++ b/src/requirements/requirementDisplayComponents.ts
@@ -217,12 +217,6 @@ export const REQUIREMENT_DISPLAY_COMPONENTS = {
UNISWAP_V3_POSITIONS: dynamic(
() => import("requirements/Uniswap/UniswapRequirement")
),
- POLYGON_ID_BASIC: dynamic(
- () => import("requirements/PolygonID/PolygonIDRequirement")
- ),
- POLYGON_ID_QUERY: dynamic(
- () => import("requirements/PolygonID/PolygonIDRequirement")
- ),
GITCOIN_PASS: dynamic(
() => import("requirements/GitcoinPassport/GitcoinPassportRequirement")
),
diff --git a/src/requirements/requirementFormComponents.ts b/src/requirements/requirementFormComponents.ts
index da16f76f53..68ed0180d6 100644
--- a/src/requirements/requirementFormComponents.ts
+++ b/src/requirements/requirementFormComponents.ts
@@ -207,12 +207,6 @@ export const REQUIREMENT_FORM_COMPONENTS = {
UNISWAP_V3_POSITIONS: dynamic(
() => import("requirements/Uniswap/UniswapForm")
),
- POLYGON_ID_BASIC: dynamic(
- () => import("requirements/PolygonID/PolygonIDForm")
- ),
- POLYGON_ID_QUERY: dynamic(
- () => import("requirements/PolygonID/PolygonIDForm")
- ),
GITCOIN_PASS: dynamic(
() => import("requirements/GitcoinPassport/GitcoinPassportForm")
),
diff --git a/src/requirements/requirements.ts b/src/requirements/requirements.ts
index 33288ef7e9..4f73556ab9 100644
--- a/src/requirements/requirements.ts
+++ b/src/requirements/requirements.ts
@@ -183,12 +183,6 @@ export const REQUIREMENTS_DATA = [
types: ["UNISWAP_V3_POSITIONS"],
isNegatable: true,
},
- {
- icon: "/requirementLogos/polygonId.svg",
- name: "PolygonID",
- types: ["POLYGON_ID_QUERY", "POLYGON_ID_BASIC"],
- isNegatable: true,
- },
{
icon: "/requirementLogos/gitcoin-passport.svg",
name: "Gitcoin Passport",
diff --git a/src/rewards/PolygonID/PolygonIDCardButton.tsx b/src/rewards/PolygonID/PolygonIDCardButton.tsx
deleted file mode 100644
index 434f12c74d..0000000000
--- a/src/rewards/PolygonID/PolygonIDCardButton.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { RewardCardButton } from "rewards/components/RewardCardButton"
-import { useMintPolygonIDProofContext } from "./components/MintPolygonIDProofProvider"
-import useConnectedDID from "./hooks/useConnectedDID"
-
-const PolygonIDCardButton = () => {
- const { onConnectDIDModalOpen, onMintPolygonIDProofModalOpen } =
- useMintPolygonIDProofContext()
- const { isLoading, data } = useConnectedDID()
-
- return (
-
- {data ? "Mint PolygonID Proofs" : "Connect DID"}
-
- )
-}
-
-export default PolygonIDCardButton
diff --git a/src/rewards/PolygonID/PolygonIDCardMenu.tsx b/src/rewards/PolygonID/PolygonIDCardMenu.tsx
deleted file mode 100644
index e6258594bc..0000000000
--- a/src/rewards/PolygonID/PolygonIDCardMenu.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import RemovePlatformMenuItem from "components/[guild]/AccessHub/components/RemovePlatformMenuItem"
-import PlatformCardMenu from "../../components/[guild]/RolePlatforms/components/PlatformCard/components/PlatformCardMenu"
-
-type Props = {
- platformGuildId: string
-}
-
-const PolygonIDCardMenu = ({ platformGuildId }: Props): JSX.Element => (
-
-
-
-)
-
-export default PolygonIDCardMenu
diff --git a/src/rewards/PolygonID/components.ts b/src/rewards/PolygonID/components.ts
deleted file mode 100644
index e8bbe3a252..0000000000
--- a/src/rewards/PolygonID/components.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import dynamic from "next/dynamic"
-import { AddRewardPanelLoadingSpinner } from "rewards/components/AddRewardPanelLoadingSpinner"
-import { RewardComponentsData } from "rewards/types"
-import PolygonIDCardButton from "./PolygonIDCardButton"
-import PolygonIDCardMenu from "./PolygonIDCardMenu"
-
-export default {
- cardButton: PolygonIDCardButton,
- cardMenuComponent: PolygonIDCardMenu,
- AddRewardPanel: dynamic(
- () =>
- import(
- "components/[guild]/RolePlatforms/components/AddRoleRewardModal/components/AddPolygonIDPanel"
- ),
- {
- ssr: false,
- loading: AddRewardPanelLoadingSpinner,
- }
- ),
- SmallRewardPreview: dynamic(() => import("rewards/components/PolygonIDReward"), {
- ssr: false,
- }),
-} satisfies RewardComponentsData
diff --git a/src/rewards/PolygonID/components/ConnectDIDModal.tsx b/src/rewards/PolygonID/components/ConnectDIDModal.tsx
deleted file mode 100644
index 6ebf3ded69..0000000000
--- a/src/rewards/PolygonID/components/ConnectDIDModal.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-import {
- Box,
- Center,
- Modal,
- ModalBody,
- ModalCloseButton,
- ModalContent,
- ModalHeader,
- ModalOverlay,
- Spinner,
- Text,
- useBreakpointValue,
-} from "@chakra-ui/react"
-import { ArrowsClockwise } from "@phosphor-icons/react"
-import useUser from "components/[guild]/hooks/useUser"
-import Button from "components/common/Button"
-import ErrorAlert from "components/common/ErrorAlert"
-import { env } from "env"
-import { useFetcherWithSign } from "hooks/useFetcherWithSign"
-import { useGetKeyForSWRWithOptionalAuth } from "hooks/useGetKeyForSWRWithOptionalAuth"
-import useToast from "hooks/useToast"
-import { QRCodeSVG } from "qrcode.react"
-import { useEffect } from "react"
-import useSWR from "swr"
-import useSWRImmutable from "swr/immutable"
-import useConnectedDID from "../hooks/useConnectedDID"
-
-type Props = {
- isOpen: boolean
- onClose: () => void
- onMintPolygonIDProofModalOpen: () => void
-}
-
-const ConnectDIDModal = ({
- isOpen,
- onClose,
- onMintPolygonIDProofModalOpen,
-}: Props) => {
- const { id: userId } = useUser()
- const toast = useToast()
-
- const fetcherWithSign = useFetcherWithSign()
- const getKeyForSWRWithOptionalAuth = useGetKeyForSWRWithOptionalAuth()
-
- const {
- data: qrCode,
- isValidating,
- error,
- mutate,
- } = useSWRImmutable(
- isOpen
- ? getKeyForSWRWithOptionalAuth(
- `${env.NEXT_PUBLIC_POLYGONID_API}/v1/users/${userId}/polygon-id/auth`
- )
- : null,
- fetcherWithSign
- )
-
- const { mutate: mutateConnectedDID } = useConnectedDID()
- const { data: connectedDID } = useSWR(
- userId && isOpen && qrCode
- ? `${env.NEXT_PUBLIC_POLYGONID_API}/v1/users/${userId}/polygon-id?poll=true`
- : null,
- {
- onErrorRetry: (_error, _key, _config, revalidate, _revalidateOps) => {
- setTimeout(() => revalidate(), 3000)
- },
- }
- )
-
- useEffect(() => {
- if (!isOpen || !connectedDID) return
- toast({ status: "success", title: "Your identity has been authenticated" })
- mutateConnectedDID(connectedDID)
- onClose()
- onMintPolygonIDProofModalOpen()
- }, [
- isOpen,
- connectedDID,
- toast,
- mutateConnectedDID,
- onClose,
- onMintPolygonIDProofModalOpen,
- ])
-
- const qrSize = useBreakpointValue({ base: 300, md: 400 })
-
- return (
-
-
-
-
- Connect PolygonID
-
-
- {error ? (
-
- ) : !qrCode && isValidating ? (
- <>
-
-
- Generating QR code
-
- >
- ) : (
- <>
-
-
-
- }
- isLoading={isValidating}
- loadingText="Generating QR code"
- color="gray"
- onClick={() => mutate()}
- >
- Generate new QR code
-
-
- Scan with your Polygon ID app! The modal will automatically close
- on successful connect.
-
- >
- )}
-
-
-
-
- )
-}
-
-export default ConnectDIDModal
diff --git a/src/rewards/PolygonID/components/MintPolygonIDProofModal.tsx b/src/rewards/PolygonID/components/MintPolygonIDProofModal.tsx
deleted file mode 100644
index bb2a77d7b8..0000000000
--- a/src/rewards/PolygonID/components/MintPolygonIDProofModal.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import {
- Alert,
- AlertDescription,
- AlertIcon,
- Modal,
- ModalBody,
- ModalCloseButton,
- ModalContent,
- ModalHeader,
- ModalOverlay,
- Spacer,
-} from "@chakra-ui/react"
-import useGuild from "components/[guild]/hooks/useGuild"
-import { PlatformType, Role } from "types"
-import useClaimedRoles from "../hooks/useClaimedRoles"
-import MintableRole, { MintableRoleSkeleton } from "./MintableRole"
-
-type Props = {
- isOpen: boolean
- onClose: () => void
-}
-
-const MintPolygonIDProofModal = ({ isOpen, onClose }: Props) => {
- const { roles, guildPlatforms } = useGuild()
- const { isLoading, error } = useClaimedRoles()
-
- const guildPlatformId = guildPlatforms.find(
- (platform) => platform.platformId === PlatformType.POLYGON_ID
- )
-
- const onlyWithPolygonIDReward = (role: Role) =>
- !!role.rolePlatforms.find(
- (rolePlatform) => rolePlatform.guildPlatformId === guildPlatformId.id
- )
-
- return (
-
-
-
-
- Mint PolygonID proofs
-
- {isLoading ? (
- [...Array(3)].map((_, i) => )
- ) : error ? (
-
-
-
- PolygonID issuer error
-
-
-
- ) : (
- roles
- .filter(onlyWithPolygonIDReward)
- .map((role) => )
- )}
-
-
-
- )
-}
-
-export default MintPolygonIDProofModal
diff --git a/src/rewards/PolygonID/components/MintPolygonIDProofProvider.tsx b/src/rewards/PolygonID/components/MintPolygonIDProofProvider.tsx
deleted file mode 100644
index b664843a70..0000000000
--- a/src/rewards/PolygonID/components/MintPolygonIDProofProvider.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import { useDisclosure } from "@chakra-ui/react"
-import useGuild from "components/[guild]/hooks/useGuild"
-import dynamic from "next/dynamic"
-import { PropsWithChildren, createContext, useContext } from "react"
-import { PlatformType } from "types"
-
-const DynamicConnectDIDModal = dynamic(() => import("./ConnectDIDModal"))
-const DynamicMintPolygonIDProofModal = dynamic(
- () => import("./MintPolygonIDProofModal")
-)
-
-interface MintPolygonIDProofContextType {
- isConnectDIDModalOpen: boolean
- onConnectDIDModalOpen: () => void
- onConnectDIDModalClose: () => void
- isMintPolygonIDProofModalOpen: boolean
- onMintPolygonIDProofModalOpen: () => void
- onMintPolygonIDProofModalClose: () => void
-}
-
-const MintPolygonIDProofContext = createContext(
- {} as MintPolygonIDProofContextType
-)
-
-const MintPolygonIDProofProvider = ({ children }: PropsWithChildren) => {
- const { guildPlatforms } = useGuild()
- const {
- isOpen: isConnectDIDModalOpen,
- onOpen: onConnectDIDModalOpen,
- onClose: onConnectDIDModalClose,
- } = useDisclosure()
- const {
- isOpen: isMintPolygonIDProofModalOpen,
- onOpen: onMintPolygonIDProofModalOpen,
- onClose: onMintPolygonIDProofModalClose,
- } = useDisclosure()
-
- return (
-
- {children}
-
- {guildPlatforms?.find((gp) => gp.platformId === PlatformType.POLYGON_ID) && (
- <>
-
-
- >
- )}
-
- )
-}
-
-const useMintPolygonIDProofContext = () => useContext(MintPolygonIDProofContext)
-
-export { MintPolygonIDProofProvider, useMintPolygonIDProofContext }
diff --git a/src/rewards/PolygonID/components/MintableRole.tsx b/src/rewards/PolygonID/components/MintableRole.tsx
deleted file mode 100644
index 3320b70986..0000000000
--- a/src/rewards/PolygonID/components/MintableRole.tsx
+++ /dev/null
@@ -1,175 +0,0 @@
-import {
- Card,
- HStack,
- Heading,
- Skeleton,
- SkeletonCircle,
- Spacer,
- Tooltip,
- useDisclosure,
-} from "@chakra-ui/react"
-import { useMembershipUpdate } from "components/[guild]/JoinModal/hooks/useMembershipUpdate"
-import useGuild from "components/[guild]/hooks/useGuild"
-import useUser from "components/[guild]/hooks/useUser"
-import Button from "components/common/Button"
-import GuildLogo from "components/common/GuildLogo"
-import { useRoleMembership } from "components/explorer/hooks/useMembership"
-import { env } from "env"
-import useCustomPosthogEvents from "hooks/useCustomPosthogEvents"
-import useShowErrorToast from "hooks/useShowErrorToast"
-import { SignedValidation, useSubmitWithSign } from "hooks/useSubmit"
-import useToast from "hooks/useToast"
-import { PlatformType, Role } from "types"
-import fetcher from "utils/fetcher"
-import useClaimedRoles from "../hooks/useClaimedRoles"
-import PolygonIDQRCodeModal from "./PolygonIDQRCodeModal"
-
-type Props = {
- role: Role
-}
-
-const MintableRole = ({ role }: Props) => {
- const toast = useToast()
- const showErrorToast = useShowErrorToast()
- const { rewardClaimed } = useCustomPosthogEvents()
-
- const { isOpen, onOpen, onClose } = useDisclosure()
- const { id: userId } = useUser()
- const { hasRoleAccess } = useRoleMembership(role.id)
- const { id: guildId } = useGuild()
- const {
- data: claimedRoles,
- isValidating,
- mutate: mutateClaimedRoles,
- } = useClaimedRoles()
-
- const hasClaimed = claimedRoles
- ?.find((guild) => guild.guildId === guildId)
- ?.roleIds.find((roleId) => roleId === role.id)
-
- const claim = async (signedValidation: SignedValidation) =>
- fetcher(`${env.NEXT_PUBLIC_POLYGONID_API}/v1/polygon-id/claim`, {
- method: "POST",
- ...signedValidation,
- })
-
- const { isLoading: isClaimLoading, onSubmit: onClaimSubmit } = useSubmitWithSign(
- claim,
- {
- onSuccess: () => {
- rewardClaimed(PlatformType.POLYGON_ID)
- toast({
- status: "success",
- title: "Successfully minted proof",
- })
- onOpen()
- mutateClaimedRoles(
- (prevClaimedRoles) => {
- if (!prevClaimedRoles.find((crData) => crData.guildId === guildId)) {
- return [
- ...prevClaimedRoles,
- {
- guildId,
- roleIds: [role.id],
- },
- ]
- }
-
- return prevClaimedRoles.map((crData) => {
- if (crData.guildId !== guildId) return crData
- return {
- guildId,
- roleIds: [...crData.roleIds, role.id],
- }
- })
- },
- {
- revalidate: false,
- }
- )
- },
- onError: () => showErrorToast("Couldn't claim proof"),
- }
- )
-
- const {
- triggerMembershipUpdate,
- isLoading: isMembershipUpdateLoading,
- currentlyCheckedRoleIds,
- } = useMembershipUpdate({
- onSuccess: () =>
- onClaimSubmit({
- userId: userId,
- data: {
- guildId: guildId,
- roleId: role.id,
- },
- }),
- onError: (err) =>
- showErrorToast({
- error: "Couldn't check eligibility",
- correlationId: err.correlationId,
- }),
- })
-
- const isLoading =
- (isMembershipUpdateLoading && currentlyCheckedRoleIds?.includes(role.id)) ||
- isClaimLoading
-
- return (
-
-
-
-
- {role.name}
-
-
-
-
-
-
-
-
-
- )
-}
-
-const MintableRoleSkeleton = () => (
-
-
-
-
-
-
-
-
-)
-
-export default MintableRole
-export { MintableRoleSkeleton }
diff --git a/src/rewards/PolygonID/components/PolygonIDQRCodeModal.tsx b/src/rewards/PolygonID/components/PolygonIDQRCodeModal.tsx
deleted file mode 100644
index 82501c78ee..0000000000
--- a/src/rewards/PolygonID/components/PolygonIDQRCodeModal.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-import {
- Box,
- Center,
- Modal,
- ModalBody,
- ModalCloseButton,
- ModalContent,
- ModalHeader,
- ModalOverlay,
- Spinner,
- Text,
- useBreakpointValue,
-} from "@chakra-ui/react"
-import { ArrowsClockwise } from "@phosphor-icons/react"
-import useGuild from "components/[guild]/hooks/useGuild"
-import useUser from "components/[guild]/hooks/useUser"
-import Button from "components/common/Button"
-import ErrorAlert from "components/common/ErrorAlert"
-import { env } from "env"
-import { QRCodeSVG } from "qrcode.react"
-import useSWRImmutable from "swr/immutable"
-import { Role } from "types"
-import useClaimedRoles from "../hooks/useClaimedRoles"
-
-type Props = {
- role: Role
- isOpen: boolean
- onClose: () => void
-}
-
-const PolygonIDQRCodeModal = ({ role, isOpen, onClose }: Props) => {
- const { id: userId } = useUser()
- const { id: guildId } = useGuild()
-
- const { data: claimedRoles } = useClaimedRoles()
- const hasClaimed = claimedRoles
- ?.find((guild) => guild.guildId === guildId)
- ?.roleIds.find((roleId) => roleId === role.id)
-
- const { data, error, mutate } = useSWRImmutable(
- hasClaimed
- ? `${env.NEXT_PUBLIC_POLYGONID_API}/v1/users/${userId}/polygon-id/claim/${guildId}:${role.id}/qrcode`
- : null
- )
-
- const qrSize = useBreakpointValue({ base: 300, md: 400 })
-
- return (
-
-
-
-
-
- PolygonID proof: {role.name}
-
-
-
- {error ? (
-
- ) : !data ? (
- <>
-
-
- Generating QR code
-
- >
- ) : (
- <>
-
-
-
- }
- loadingText={"Generating QR code"}
- color="gray"
- onClick={() => mutate()}
- >
- Generate new QR code
-
-
- Scan with your Polygon ID app!
-
- >
- )}
-
-
-
-
- )
-}
-
-export default PolygonIDQRCodeModal
diff --git a/src/rewards/PolygonID/data.ts b/src/rewards/PolygonID/data.ts
deleted file mode 100644
index e3b6f8dd39..0000000000
--- a/src/rewards/PolygonID/data.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { Key } from "@phosphor-icons/react"
-import { PlatformAsRewardRestrictions, RewardData } from "rewards/types"
-
-export const polygonIdData = {
- icon: Key,
- imageUrl: "/requirementLogos/polygonId.svg",
- name: "PolygonID",
- colorScheme: "purple",
- gatedEntity: "",
- autoRewardSetup: true,
- isPlatform: false,
- asRewardRestriction: PlatformAsRewardRestrictions.MULTIPLE_ROLES,
-} as const satisfies RewardData
diff --git a/src/rewards/PolygonID/hooks/useClaimedRoles.ts b/src/rewards/PolygonID/hooks/useClaimedRoles.ts
deleted file mode 100644
index 4d88deb041..0000000000
--- a/src/rewards/PolygonID/hooks/useClaimedRoles.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import useGuild from "components/[guild]/hooks/useGuild"
-import useUser from "components/[guild]/hooks/useUser"
-import { env } from "env"
-import useSWRImmutable from "swr/immutable"
-
-const useClaimedRoles = () => {
- const { id: userId } = useUser()
- const { id: guildId } = useGuild()
-
- return useSWRImmutable<
- {
- guildId: number
- roleIds: number[]
- }[]
- >(
- !!userId && !!guildId
- ? `${env.NEXT_PUBLIC_POLYGONID_API}/v1/users/${userId}/polygon-id/claims?format=role&guildId=${guildId}`
- : null
- )
-}
-
-export default useClaimedRoles
diff --git a/src/rewards/PolygonID/hooks/useConnectedDID.ts b/src/rewards/PolygonID/hooks/useConnectedDID.ts
deleted file mode 100644
index 08e3a44a9e..0000000000
--- a/src/rewards/PolygonID/hooks/useConnectedDID.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import useUser from "components/[guild]/hooks/useUser"
-import { env } from "env"
-import useSWRImmutable from "swr/immutable"
-
-const useConnectedDID = () => {
- const { id: userId } = useUser()
-
- return useSWRImmutable(
- userId ? `${env.NEXT_PUBLIC_POLYGONID_API}/v1/users/${userId}/polygon-id` : null,
- {
- shouldRetryOnError: false,
- }
- )
-}
-
-export default useConnectedDID
diff --git a/src/rewards/PolygonID/usePolygonIDCardProps.tsx b/src/rewards/PolygonID/usePolygonIDCardProps.tsx
deleted file mode 100644
index 445ff689a8..0000000000
--- a/src/rewards/PolygonID/usePolygonIDCardProps.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Circle, Img, useColorModeValue } from "@chakra-ui/react"
-import { useRolePlatform } from "components/[guild]/RolePlatforms/components/RolePlatformProvider"
-import rewards, { CardPropsHook } from "rewards"
-
-const usePolygonIDCardProps: CardPropsHook = () => {
- const bgColor = useColorModeValue("gray.700", "gray.600")
- const rolePlatform = useRolePlatform()
-
- return {
- name: "PolygonID proofs",
- type: "POLYGON_ID",
- image: (
-
-
-
- ),
- info: !rolePlatform ? "Onchain & zero-knowledge" : undefined,
- }
-}
-
-export default usePolygonIDCardProps
diff --git a/src/rewards/RewardPreviews.ts b/src/rewards/RewardPreviews.ts
index 54dca7cec4..e6f0e31b7f 100644
--- a/src/rewards/RewardPreviews.ts
+++ b/src/rewards/RewardPreviews.ts
@@ -23,10 +23,6 @@ export const RewardPreviews = {
ssr: false,
loading: LoadingRewardPreview,
}),
- POLYGON_ID: dynamic(() => import("rewards/components/PolygonIDPreview"), {
- ssr: false,
- loading: LoadingRewardPreview,
- }),
CONTRACT_CALL: dynamic(() => import("rewards/components/ContractCallPreview"), {
ssr: false,
loading: LoadingRewardPreview,
diff --git a/src/rewards/cardPropsHooks.ts b/src/rewards/cardPropsHooks.ts
index 8b9ec873db..302dc9bc17 100644
--- a/src/rewards/cardPropsHooks.ts
+++ b/src/rewards/cardPropsHooks.ts
@@ -6,7 +6,6 @@ import useGithubCardProps from "./Github/useGithubCardProps"
import useGoogleCardProps from "./Google/useGoogleCardProps"
import usePoapCardProps from "./Poap/usePoapCardProps"
import usePointsCardProps from "./Points/usePointsCardProps"
-import usePolygonIDCardProps from "./PolygonID/usePolygonIDCardProps"
import useSecretTextCardProps from "./SecretText/useSecretTextCardProps"
import useTelegramCardProps from "./Telegram/useTelegramCardProps"
import useTokenCardProps from "./Token/hooks/useTokenCardProps"
@@ -15,7 +14,6 @@ import { CardPropsHook, RewardComponentMap } from "./types"
export const cardPropsHooks = {
GATHER_TOWN: useGatherCardProps,
- POLYGON_ID: usePolygonIDCardProps,
TELEGRAM: useTelegramCardProps,
POAP: usePoapCardProps,
POINTS: usePointsCardProps,
diff --git a/src/rewards/components.ts b/src/rewards/components.ts
index e69c8db7ae..0b1ad6ae78 100644
--- a/src/rewards/components.ts
+++ b/src/rewards/components.ts
@@ -6,7 +6,6 @@ import githubComponents from "rewards/Github/components"
import googleComponents from "rewards/Google/components"
import poapComponents from "rewards/Poap/components"
import pointsComponents from "rewards/Points/components"
-import polygonIdComponents from "rewards/PolygonID/components"
import textComponents from "rewards/SecretText/components"
import telegramComponents from "rewards/Telegram/components"
import tokenComponents from "rewards/Token/components"
@@ -19,7 +18,6 @@ export default {
GATHER_TOWN: gatherTownComponents,
FORM: formComponents,
POINTS: pointsComponents,
- POLYGON_ID: polygonIdComponents,
UNIQUE_TEXT: uniqueTextComponents,
TEXT: textComponents,
CONTRACT_CALL: contractCallComponents,
diff --git a/src/rewards/components/PolygonIDPreview.tsx b/src/rewards/components/PolygonIDPreview.tsx
deleted file mode 100644
index 66e8301a5b..0000000000
--- a/src/rewards/components/PolygonIDPreview.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import rewards from "rewards"
-import RewardPreview from "./RewardPreview"
-
-const PolygonIDPreview = (): JSX.Element => (
-
-)
-
-export default PolygonIDPreview
diff --git a/src/rewards/components/PolygonIDReward.tsx b/src/rewards/components/PolygonIDReward.tsx
deleted file mode 100644
index 55f2243e33..0000000000
--- a/src/rewards/components/PolygonIDReward.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { Icon, Spinner, Tooltip } from "@chakra-ui/react"
-import { ArrowSquareIn, LockSimple } from "@phosphor-icons/react"
-import { useOpenJoinModal } from "components/[guild]/JoinModal/JoinModalProvider"
-import { RewardIcon } from "components/[guild]/RoleCard/components/Reward"
-import { RewardDisplay } from "components/[guild]/RoleCard/components/RewardDisplay"
-import { RewardProps } from "components/[guild]/RoleCard/components/types"
-import useGuild from "components/[guild]/hooks/useGuild"
-import Button from "components/common/Button"
-import useMembership, {
- useRoleMembership,
-} from "components/explorer/hooks/useMembership"
-import { useMemo } from "react"
-import rewards from "rewards"
-import { useMintPolygonIDProofContext } from "rewards/PolygonID/components/MintPolygonIDProofProvider"
-import useConnectedDID from "rewards/PolygonID/hooks/useConnectedDID"
-import { PlatformType } from "types"
-
-const PolygonIDReward = ({ platform }: RewardProps) => {
- const { platformId } = platform.guildPlatform
-
- const { roles } = useGuild()
- const role = roles.find((r) =>
- r.rolePlatforms.some((rp) => rp.guildPlatformId === platform.guildPlatformId)
- )
-
- const { isMember } = useMembership()
- const { hasRoleAccess, isValidating } = useRoleMembership(role.id)
- const openJoinModal = useOpenJoinModal()
-
- const { onConnectDIDModalOpen, onMintPolygonIDProofModalOpen } =
- useMintPolygonIDProofContext()
- const { isLoading, data: connectedDID } = useConnectedDID()
-
- const state = useMemo(() => {
- if (hasRoleAccess && connectedDID) {
- return {
- tooltipLabel: "Mint proof",
- buttonProps: {
- isDisabled: isLoading || isValidating,
- onClick: onMintPolygonIDProofModalOpen,
- },
- }
- }
-
- if (!isMember)
- return {
- tooltipLabel: (
- <>
-
- Join guild to check access
- >
- ),
- buttonProps: { onClick: openJoinModal },
- }
-
- if (!connectedDID)
- return {
- tooltipLabel: "Connect DID",
- buttonProps: { onClick: onConnectDIDModalOpen },
- }
-
- return {
- tooltipLabel: "You don't satisfy the requirements to this role",
- buttonProps: { isDisabled: true },
- }
- }, [
- hasRoleAccess,
- connectedDID,
- isLoading,
- isValidating,
- onMintPolygonIDProofModalOpen,
- isMember,
- openJoinModal,
- onConnectDIDModalOpen,
- ])
-
- return (
-
- }
- label={
-
- {`Mint: `}
-
- ) : (
-
- )
- }
- iconSpacing="1"
- maxW="full"
- {...state.buttonProps}
- >
- {rewards[PlatformType[platformId]].name} proofs
-
-
- }
- />
- )
-}
-export default PolygonIDReward
diff --git a/src/rewards/index.ts b/src/rewards/index.ts
index 54b7f77eb5..7ccdb5f38d 100644
--- a/src/rewards/index.ts
+++ b/src/rewards/index.ts
@@ -8,7 +8,6 @@ import { githubData } from "rewards/Github/data"
import { googleData } from "rewards/Google/data"
import { poapData } from "rewards/Poap/data"
import { pointsData } from "rewards/Points/data"
-import { polygonIdData } from "rewards/PolygonID/data"
import { secretTextData } from "rewards/SecretText/data"
import { telegramData } from "rewards/Telegram/data"
import { tokenData } from "rewards/Token/data"
@@ -25,7 +24,6 @@ const rewards: Rewards = {
GATHER_TOWN: gatherData,
FORM: formData,
POINTS: pointsData,
- POLYGON_ID: polygonIdData,
UNIQUE_TEXT: uniqueTextData,
TEXT: secretTextData,
CONTRACT_CALL: contractCallData,
diff --git a/src/solutions/components/SolutionsPanel.tsx b/src/solutions/components/SolutionsPanel.tsx
index a485d51ec3..6aa9634b8a 100644
--- a/src/solutions/components/SolutionsPanel.tsx
+++ b/src/solutions/components/SolutionsPanel.tsx
@@ -11,7 +11,6 @@ import {
useColorMode,
} from "@chakra-ui/react"
import { useAddRewardContext } from "components/[guild]/AddRewardContext"
-import useGuild from "components/[guild]/hooks/useGuild"
import SegmentedControl from "components/common/SegmentedControl"
import SearchBar from "components/explorer/SearchBar"
import { AnimatePresence } from "framer-motion"
@@ -25,10 +24,9 @@ import {
engagement,
memberships,
nft,
- sybil,
tokens,
} from "solutions"
-import { PlatformName, PlatformType } from "types"
+import { PlatformName } from "types"
import Category from "./Category"
const categoryOptions = [{ label: "All", value: "all" }, ...categories]
@@ -39,7 +37,6 @@ const SolutionsPanel = ({
setSolution: (name: SolutionName) => void
}) => {
const { setStep, setSelection } = useAddRewardContext()
- const { guildPlatforms } = useGuild()
const [search, setSearch] = useState("")
@@ -65,16 +62,9 @@ const SolutionsPanel = ({
setStep("SOLUTION_SETUP")
}
- const showPolygonId = !guildPlatforms?.some(
- (gp) => gp.platformId === PlatformType.POLYGON_ID
- )
-
const categoryItems: Record = {
engagement,
memberships,
- sybil: sybil.filter(
- (solution) => showPolygonId || solution.handlerParam !== "POLYGON_ID"
- ),
nft,
tokens,
}
diff --git a/src/solutions/constants.ts b/src/solutions/constants.ts
index 3522670729..df366f11ef 100644
--- a/src/solutions/constants.ts
+++ b/src/solutions/constants.ts
@@ -29,10 +29,6 @@ export const categories = [
label: "Engagement",
value: "engagement",
},
- {
- label: "Sybil Protection",
- value: "sybil",
- },
] as const
export const memberships: SolutionCardData[] = [
@@ -138,14 +134,3 @@ export const engagement: SolutionCardData[] = [
handlerParam: "TEXT",
},
]
-
-export const sybil: SolutionCardData[] = [
- {
- title: "PolygonID credentials",
- description: "Self-Sovereign Identity Solution with Zero-Knowledge Proofs",
- imageUrl: "/requirementLogos/polygonId.svg",
- bgImageUrl: "/solutions/polygon-bg.jpg",
- handlerType: "reward",
- handlerParam: "POLYGON_ID",
- },
-]
diff --git a/src/types.ts b/src/types.ts
index dab8b6a7bc..a1ac66e1b9 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -74,7 +74,6 @@ type PlatformName =
| "EMAIL"
| "UNIQUE_TEXT"
| "TEXT"
- | "POLYGON_ID"
| "POINTS"
| "FORM"
| "GATHER_TOWN"
@@ -634,7 +633,6 @@ export enum PlatformType {
UNIQUE_TEXT = 9,
TEXT = 10,
GUILD_PIN = 11,
- POLYGON_ID = 12,
POINTS = 13,
POAP = 14,
FORM = 15,
diff --git a/src/v2/components/Account/components/AccountModal/components/SocialAccount.tsx b/src/v2/components/Account/components/AccountModal/components/SocialAccount.tsx
index ed9fa36939..a2e0c9b9f8 100644
--- a/src/v2/components/Account/components/AccountModal/components/SocialAccount.tsx
+++ b/src/v2/components/Account/components/AccountModal/components/SocialAccount.tsx
@@ -116,8 +116,6 @@ const PLATFORM_COLORS = {
"bg-twitter hover:bg-twitter-hover active:bg-twitter-active text-white",
TWITTER: "bg-twitter hover:bg-twitter-hover active:bg-twitter-active text-white",
GITHUB: "bg-github hover:bg-github-hover active:bg-github-active text-white",
- POLYGON_ID:
- "bg-polygonid hover:bg-polygonid-hover active:bg-polygonid-active text-white",
FARCASTER:
"bg-farcaster hover:bg-farcaster-hover active:bg-farcaster-active text-white",
} satisfies Partial>
diff --git a/tailwind.config.ts b/tailwind.config.ts
index 96522da25b..ce08161132 100644
--- a/tailwind.config.ts
+++ b/tailwind.config.ts
@@ -157,11 +157,6 @@ const config = {
hover: "hsl(var(--github-hover))",
active: "hsl(var(--github-active))",
},
- polygonid: {
- DEFAULT: "hsl(var(--polygonid))",
- hover: "hsl(var(--polygonid-hover))",
- active: "hsl(var(--polygonid-active))",
- },
farcaster: {
DEFAULT: "hsl(var(--farcaster))",
hover: "hsl(var(--farcaster-hover))",