diff --git a/frontend-v2/src/components/signup/CodeInputStep.tsx b/frontend-v2/src/components/auth/CodeInputStep.tsx similarity index 100% rename from frontend-v2/src/components/signup/CodeInputStep.tsx rename to frontend-v2/src/components/auth/CodeInputStep.tsx diff --git a/frontend-v2/src/components/signup/DonwloadBackupPDFStep.tsx b/frontend-v2/src/components/auth/DonwloadBackupPDFStep.tsx similarity index 100% rename from frontend-v2/src/components/signup/DonwloadBackupPDFStep.tsx rename to frontend-v2/src/components/auth/DonwloadBackupPDFStep.tsx diff --git a/frontend-v2/src/components/signup/EnterEmailStep.tsx b/frontend-v2/src/components/auth/EnterEmailStep.tsx similarity index 100% rename from frontend-v2/src/components/signup/EnterEmailStep.tsx rename to frontend-v2/src/components/auth/EnterEmailStep.tsx diff --git a/frontend-v2/src/components/signup/InitialSignupStep.tsx b/frontend-v2/src/components/auth/InitialSignupStep.tsx similarity index 100% rename from frontend-v2/src/components/signup/InitialSignupStep.tsx rename to frontend-v2/src/components/auth/InitialSignupStep.tsx index c4b6ce95e..d5bc8081c 100644 --- a/frontend-v2/src/components/signup/InitialSignupStep.tsx +++ b/frontend-v2/src/components/auth/InitialSignupStep.tsx @@ -1,8 +1,8 @@ import { useTranslation } from "react-i18next"; -import { Link } from "@tanstack/react-router"; import { faGithub, faGitlab, faGoogle } from "@fortawesome/free-brands-svg-icons"; import { faEnvelope } from "@fortawesome/free-regular-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { Link } from "@tanstack/react-router"; import { RegionSelect } from "@app/components/navigation/RegionSelect"; import { useServerConfig } from "@app/context"; diff --git a/frontend-v2/src/routes/login/-components/Mfa.tsx b/frontend-v2/src/components/auth/Mfa.tsx similarity index 100% rename from frontend-v2/src/routes/login/-components/Mfa.tsx rename to frontend-v2/src/components/auth/Mfa.tsx diff --git a/frontend-v2/src/components/signup/TeamInviteStep.tsx b/frontend-v2/src/components/auth/TeamInviteStep.tsx similarity index 100% rename from frontend-v2/src/components/signup/TeamInviteStep.tsx rename to frontend-v2/src/components/auth/TeamInviteStep.tsx diff --git a/frontend-v2/src/components/signup/UserInfoStep.tsx b/frontend-v2/src/components/auth/UserInfoStep.tsx similarity index 100% rename from frontend-v2/src/components/signup/UserInfoStep.tsx rename to frontend-v2/src/components/auth/UserInfoStep.tsx diff --git a/frontend-v2/src/components/features/WishForm.tsx b/frontend-v2/src/components/features/WishForm.tsx new file mode 100644 index 000000000..fc38d0731 --- /dev/null +++ b/frontend-v2/src/components/features/WishForm.tsx @@ -0,0 +1,109 @@ +import { useForm } from "react-hook-form"; +import { faRocketchat } from "@fortawesome/free-brands-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { z } from "zod"; + +import { createNotification } from "@app/components/notifications"; +import { + Button, + FormControl, + Popover, + PopoverContent, + PopoverTrigger, + TextArea +} from "@app/components/v2"; +import { useToggle } from "@app/hooks"; +import { useCreateUserWish } from "@app/hooks/api/userEngagement"; + +const formSchema = z.object({ + text: z.string().trim().min(1) +}); + +type TFormData = z.infer; + +export const WishForm = () => { + const { + handleSubmit, + register, + reset, + formState: { isSubmitting, errors } + } = useForm({ + resolver: zodResolver(formSchema) + }); + const { mutateAsync } = useCreateUserWish(); + const [isOpen, setIsOpen] = useToggle(false); + + const createWish = async (data: TFormData) => { + try { + await mutateAsync({ + text: data.text + }); + + createNotification({ + text: "Your wish has been sent to the Infisical team!", + type: "success" + }); + + setIsOpen.off(); + } catch { + createNotification({ + text: "An error occured while sending your wish to the Infisical team.", + type: "error" + }); + } + }; + + return ( + { + setIsOpen.toggle(); + reset(); + }} + open={isOpen} + > + +
+ + Request a feature +
+
+ +
+ +