From 960fb06dedc359f3abb21da4e2605b77efcbfa90 Mon Sep 17 00:00:00 2001 From: Dominik Stumpf Date: Fri, 26 Jul 2024 21:24:06 +0200 Subject: [PATCH] fix(dcd): remove SelectRolePanel --- .../Form/components/AddFormButton.tsx | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/requirements/Form/components/AddFormButton.tsx b/src/requirements/Form/components/AddFormButton.tsx index f253c40394..ff62745be4 100644 --- a/src/requirements/Form/components/AddFormButton.tsx +++ b/src/requirements/Form/components/AddFormButton.tsx @@ -1,15 +1,14 @@ -import { Button, Modal, ModalOverlay } from "@chakra-ui/react" -import SelectRolePanel from "components/[guild]/AddRewardButton/SelectRolePanel" +import { Button } from "@chakra-ui/react" import { ADD_REWARD_FORM_DEFAULT_VALUES } from "components/[guild]/AddRewardButton/constants" import { AddRewardForm } from "components/[guild]/AddRewardButton/types" import { AddRewardProvider, useAddRewardContext, } from "components/[guild]/AddRewardContext" -import { FormProvider, useForm, useFormContext, useWatch } from "react-hook-form" +import { FormProvider, useForm, useWatch } from "react-hook-form" import CreateFormModal from "./CreateFormModal" -const AddFormButton = ({ baseFieldPath, isDisabled }) => { +const AddFormButton = ({ isDisabled }) => { const { setSelection, step, setStep, isOpen, onOpen, onClose } = useAddRewardContext() @@ -29,17 +28,6 @@ const AddFormButton = ({ baseFieldPath, isDisabled }) => { setSelection("FORM") } - const { setValue } = useFormContext() - - const handleSuccess = (res: any) => { - const formId = - res?.platformGuildData?.formId ?? - res?.createdGuildPlatforms?.[0]?.platformGuildData?.formId - setValue(`${baseFieldPath}.data.id`, formId, { - shouldDirty: true, - }) - } - return (