Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
FBalint committed Jul 4, 2024
2 parents 4a86508 + 98078b5 commit 2632bec
Show file tree
Hide file tree
Showing 504 changed files with 1,203 additions and 1,490 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ yarn-error.log*
cypress/screenshots
cypress/videos

.idea
.idea

*.tsbuildinfo
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const nextConfig = {
},
experimental: {
scrollRestoration: true,
optimizePackageImports: ["@phosphor-icons/react"],
},
async rewrites() {
return {
Expand Down
25 changes: 13 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@lexical/selection": "^0.12.0",
"@lexical/utils": "^0.12.0",
"@nouns/assets": "^0.4.2",
"@phosphor-icons/react": "^2.1.7",
"@snyk/protect": "latest",
"@t3-oss/env-nextjs": "^0.10.1",
"@tanstack/react-query": "^5.26.3",
Expand All @@ -67,7 +68,6 @@
"mini-svg-data-uri": "^1.4.4",
"next": "14.0.1",
"papaparse": "^5.4.1",
"phosphor-react": "^1.4.1",
"posthog-js": "^1.139.3",
"qrcode.react": "^3.1.0",
"randombytes": "^2.1.0",
Expand Down
6 changes: 3 additions & 3 deletions src/components/[guild]/AccessHub/AccessHub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
SimpleGrid,
Stack,
} from "@chakra-ui/react"
import { StarHalf } from "@phosphor-icons/react"
import Card from "components/common/Card"
import ClientOnly from "components/common/ClientOnly"
import useMembership from "components/explorer/hooks/useMembership"
import dynamic from "next/dynamic"
import { StarHalf } from "phosphor-react"
import PointsRewardCard from "platforms/Points/PointsRewardCard"
import { TokenRewardCard } from "platforms/Token/TokenRewardCard"
import PointsRewardCard from "rewards/Points/PointsRewardCard"
import { TokenRewardCard } from "rewards/Token/TokenRewardCard"
import { PlatformType } from "types"
import useGuild from "../hooks/useGuild"
import useGuildPermission from "../hooks/useGuildPermission"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PlatformCard from "components/[guild]/RolePlatforms/components/PlatformCard"
import useGuild from "components/[guild]/hooks/useGuild"
import useGuildPermission from "components/[guild]/hooks/useGuildPermission"
import rewards from "platforms/rewards"
import rewards from "rewards"
import { GuildPlatform, PlatformName, PlatformType } from "types"
import PlatformAccessButton from "./PlatformAccessButton"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Text,
useColorModeValue,
} from "@chakra-ui/react"
import { ArrowRight, Plus } from "@phosphor-icons/react"
import useGuild from "components/[guild]/hooks/useGuild"
import useGuildPermission from "components/[guild]/hooks/useGuildPermission"
import Button from "components/common/Button"
Expand All @@ -15,7 +16,6 @@ import dynamic from "next/dynamic"
import Image from "next/image"
import Link from "next/link"
import { useRouter } from "next/router"
import { ArrowRight, Plus } from "phosphor-react"

const DynamicCampaignCardMenu = dynamic(
() => import("./components/CampaignCardMenu")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
useColorModeValue,
useDisclosure,
} from "@chakra-ui/react"
import { PencilSimple, TrashSimple } from "@phosphor-icons/react"
import PlatformCardMenu from "components/[guild]/RolePlatforms/components/PlatformCard/components/PlatformCardMenu"
import Button from "components/common/Button"
import { Alert } from "components/common/Modal"
import { PencilSimple, TrashSimple } from "phosphor-react"
import { useRef } from "react"
import useDeleteRoleGroup from "../hooks/useDeleteRoleGroup"
import EditCampaignModal from "./EditCampaignModal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MenuItem, useDisclosure } from "@chakra-ui/react"
import { Clock } from "@phosphor-icons/react"
import EditRewardAvailabilityModal from "components/[guild]/RolePlatforms/components/EditRewardAvailabilityModal"
import useGuild from "components/[guild]/hooks/useGuild"
import useToast from "hooks/useToast"
import { Clock } from "phosphor-react"
import { PlatformName, PlatformType } from "types"
import useEditRolePlatform from "../hooks/useEditRolePlatform"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Icon, Tooltip, useColorModeValue } from "@chakra-ui/react"
import { CircleWavyCheck, Question } from "@phosphor-icons/react"
import { useMintGuildPinContext } from "components/[guild]/Requirements/components/GuildCheckout/MintGuildPinContext"
import useGuild from "components/[guild]/hooks/useGuild"
import useGuildPermission from "components/[guild]/hooks/useGuildPermission"
import RewardCard from "components/common/RewardCard"
import dynamic from "next/dynamic"
import { CircleWavyCheck, Question } from "phosphor-react"

const DynamicMintGuildPin = dynamic(
() =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Icon } from "@chakra-ui/react"
import { ArrowSquareOut } from "@phosphor-icons/react"
import Button from "components/common/Button"
import { ArrowSquareOut } from "phosphor-react"
import rewards from "platforms/rewards"
import rewards from "rewards"
import { GuildPlatform, PlatformType } from "types"
import usePlatformAccessButton from "./usePlatformAccessButton"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { MenuItem, useColorModeValue, useDisclosure } from "@chakra-ui/react"
import { TrashSimple } from "@phosphor-icons/react"
import useRemoveGuildPlatform from "components/[guild]/AccessHub/hooks/useRemoveGuildPlatform"
import { AlreadyGrantedAccessesWillRemainInfo } from "components/[guild]/RolePlatforms/components/RemovePlatformButton/RemovePlatformButton"
import useGuild from "components/[guild]/hooks/useGuild"
import ConfirmationAlert from "components/create-guild/Requirements/components/ConfirmationAlert"
import { TrashSimple } from "phosphor-react"
import rewards from "platforms/rewards"
import rewards from "rewards"
import { PlatformType } from "types"

type Props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ButtonProps, LinkProps } from "@chakra-ui/react"
import useUser from "components/[guild]/hooks/useUser"
import useConnectPlatform from "components/[guild]/JoinModal/hooks/useConnectPlatform"
import useToast from "hooks/useToast"
import rewards from "platforms/rewards"
import rewards from "rewards"
import { GuildPlatform, PlatformName, PlatformType } from "types"

function sanitizeInviteLink(inviteLink: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useGuildPlatform from "components/[guild]/hooks/useGuildPlatform"
import { useFetcherWithSign } from "hooks/useFetcherWithSign"
import useShowErrorToast from "hooks/useShowErrorToast"
import useSubmit from "hooks/useSubmit"
import { CAPACITY_TIME_PLATFORMS } from "platforms/rewards"
import { CAPACITY_TIME_PLATFORMS } from "rewards"
import { GuildPlatform, PlatformName, PlatformType } from "types"

type PartialGuildPlatform = Partial<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
MenuList,
useDisclosure,
} from "@chakra-ui/react"
import { CaretDown, ListNumbers, Plus } from "@phosphor-icons/react"
import Button from "components/common/Button"
import useIsStuck from "hooks/useIsStuck"
import { CaretDown, ListNumbers, Plus } from "phosphor-react"
import { useEffect, useRef } from "react"
import RecheckAccessesButton from "../RecheckAccessesButton"
import AddRoleDrawer from "./components/AddRoleDrawer"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Heading, HStack, Icon, Spacer } from "@chakra-ui/react"
import { DotsSixVertical } from "@phosphor-icons/react"
import MemberCount from "components/[guild]/RoleCard/components/MemberCount"
import Visibility from "components/[guild]/Visibility"
import Card from "components/common/Card"
import GuildLogo from "components/common/GuildLogo"
import { DotsSixVertical } from "phosphor-react"
import { Role } from "types"

type Props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import SetVisibility from "components/[guild]/SetVisibility"
import useVisibilityModalProps from "components/[guild]/SetVisibility/hooks/useVisibilityModalProps"
import useGuild from "components/[guild]/hooks/useGuild"
import Button from "components/common/Button"
import NftAvailabilityTags from "platforms/ContractCall/components/NftAvailabilityTags"
import rewards, { CAPACITY_TIME_PLATFORMS } from "platforms/rewards"
import NftAvailabilityTags from "rewards/ContractCall/components/NftAvailabilityTags"
import rewards, { CAPACITY_TIME_PLATFORMS } from "rewards"
import { useFormContext, useWatch } from "react-hook-form"
import {
GuildPlatformWithOptionalId,
Expand Down
2 changes: 1 addition & 1 deletion src/components/[guild]/AddRewardAndCampaign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
Text,
useDisclosure,
} from "@chakra-ui/react"
import { CaretDown, Plus } from "@phosphor-icons/react"
import CreateCampaignModal from "components/[guild]/CreateCampaignModal"
import { CaretDown, Plus } from "phosphor-react"
import AddRewardButton from "./AddRewardButton"
import { useIsTabsStuck } from "./Tabs"
import { useThemeContext } from "./ThemeContext"
Expand Down
6 changes: 3 additions & 3 deletions src/components/[guild]/AddRewardButton/AddRewardButton.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ModalOverlay, useDisclosure } from "@chakra-ui/react"
import { Schemas, Visibility } from "@guildxyz/types"
import { Plus } from "@phosphor-icons/react"
import Button from "components/common/Button"
import DiscardAlert from "components/common/DiscardAlert"
import { Modal } from "components/common/Modal"
import useShowErrorToast from "hooks/useShowErrorToast"
import { atom, useAtomValue } from "jotai"
import { Plus } from "phosphor-react"
import rewards, { modalSizeForPlatform } from "platforms/rewards"
import { RewardData } from "platforms/types"
import { FormProvider, useForm, useWatch } from "react-hook-form"
import rewards, { modalSizeForPlatform } from "rewards"
import { RewardData } from "rewards/types"
import { RoleFormType } from "types"
import { AddRewardProvider, useAddRewardContext } from "../AddRewardContext"
import { ClientStateRequirementHandlerProvider } from "../RequirementHandlerContext"
Expand Down
9 changes: 4 additions & 5 deletions src/components/[guild]/AddRewardButton/SelectRolePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,25 @@ import {
useColorModeValue,
} from "@chakra-ui/react"
import { Visibility } from "@guildxyz/types"
import { ArrowLeft, Info } from "@phosphor-icons/react"
import { usePostHogContext } from "components/_app/PostHogProvider"
import Button from "components/common/Button"
import useJsConfetti from "components/create-guild/hooks/useJsConfetti"
import useCreateRRR, { SubmitData } from "hooks/useCreateRRR"
import useToast from "hooks/useToast"
import { ArrowLeft, Info } from "phosphor-react"
import SelectRoleOrSetRequirements from "platforms/components/SelectRoleOrSetRequirements"
import rewards, { CAPACITY_TIME_PLATFORMS } from "platforms/rewards"
import { useState } from "react"
import { useFormContext, useWatch } from "react-hook-form"
import rewards, { CAPACITY_TIME_PLATFORMS } from "rewards"
import SelectRoleOrSetRequirements from "rewards/components/SelectRoleOrSetRequirements"
import { RoleTypeToAddTo, useAddRewardContext } from "../AddRewardContext"
import useGuild from "../hooks/useGuild"
import { defaultValues } from "./AddRewardButton"
import AvailabilitySetup from "./components/AvailabilitySetup"
import useSubmitAddReward from "./hooks/useSubmitAddReward"

const SelectRolePanel = ({
onSuccess,
}: {
onSuccess?: Parameters<typeof useSubmitAddReward>[0]["onSuccess"]
onSuccess?: Parameters<typeof useCreateRRR>[0]["onSuccess"]
}) => {
const { modalRef, selection, activeTab, setStep, isBackButtonDisabled } =
useAddRewardContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ const useCreateRequirements = () => {
roleIds: number[]
) => {
const requirementIdMap: RequirementIdMap = {}
const requirementsToCreate = requirements.filter((req) => req.type !== "FREE")

const promises = roleIds.flatMap((roleId) =>
requirements.map((req) =>
requirementsToCreate.map((req) =>
fetcherWithSign([
`/v2/guilds/${guildId}/roles/${roleId}/requirements`,
{
Expand Down
Loading

0 comments on commit 2632bec

Please sign in to comment.