diff --git a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx index 70acb2bd2d..ff40c6f21c 100644 --- a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx +++ b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx @@ -1,12 +1,12 @@ "use client"; -import React, { useState } from "react"; -import { EnvelopeIcon } from "@heroicons/react/24/solid"; -import { Button } from "@formbricks/ui/Button"; -import { Input } from "@formbricks/ui/Input"; -import { Toaster, toast } from "react-hot-toast"; import { sendLinkSurveyEmailAction } from "@/app/s/[surveyId]/actions"; import { TSurvey } from "@formbricks/types/surveys"; +import { Button } from "@formbricks/ui/Button"; +import { Input } from "@formbricks/ui/Input"; +import { EnvelopeIcon } from "@heroicons/react/24/solid"; +import { useState } from "react"; +import { Toaster, toast } from "react-hot-toast"; export default function VerifyEmail({ survey, @@ -52,6 +52,12 @@ export default function VerifyEmail({ setEmailSent(false); }; + const handleKeyPress = (e) => { + if (e.key === "Enter") { + submitEmail(email); + } + }; + if (isErrorComponent) { return (
@@ -65,13 +71,15 @@ export default function VerifyEmail({ } return ( -
+
{!emailSent && !showPreviewQuestions && ( -
+
-

Verify your email to respond.

-

To respond to this survey please verify your email.

+

Verify your email to respond.

+

+ To respond to this survey please verify your email. +

setEmail(e.target.value)} + onKeyPress={handleKeyPress} />
-

- Just curious? Preview survey questions. +

+ Just curious? Preview survey questions.

)} @@ -97,15 +106,15 @@ export default function VerifyEmail({

{`${index + 1}. ${question.headline}`}

))}
-

- Want to respond? Verify email. +

+ Want to respond? Verify email.

)} {emailSent && ( -
-

Survey sent successfully

-

+

+

Check your email.

+

We sent an email to {email}. Please click the link in the email to take your survey.