From a643d90a2bee35f7dd1a752fd88cba85ceeb00e5 Mon Sep 17 00:00:00 2001 From: Johannes <72809645+jobenjada@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:06:19 +0100 Subject: [PATCH] chore: Add StackedCardsContainer component (#2064) --- .../s/[surveyId]/components/VerifyEmail.tsx | 119 +++++++++--------- packages/ui/StackedCardsContainer/index.tsx | 17 +++ 2 files changed, 73 insertions(+), 63 deletions(-) create mode 100644 packages/ui/StackedCardsContainer/index.tsx diff --git a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx index 217891fef9..848824eb24 100644 --- a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx +++ b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx @@ -8,16 +8,7 @@ import { Toaster, toast } from "react-hot-toast"; import { TSurvey } from "@formbricks/types/surveys"; import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; - -const StackedCardsContainer = ({ children }) => ( -
-
-
-
- {children} -
-
-); +import { StackedCardsContainer } from "@formbricks/ui/StackedCardsContainer"; export default function VerifyEmail({ survey, @@ -87,61 +78,63 @@ export default function VerifyEmail({ return (
- {!emailSent && !showPreviewQuestions && ( - - -

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. +

+
+ )} + {!emailSent && showPreviewQuestions && ( +
+ {" "} +

Question Preview

+
+ {survey.questions.map((question, index) => ( +

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

+ ))} +
+

+ Want to respond? Verify email. +

+
+ )} + {emailSent && ( +
+ {" "} +

Check your email.

+

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

+
-

- Just curious? Preview survey questions. -

- - )} - {!emailSent && showPreviewQuestions && ( - - {" "} -

Question Preview

-
- {survey.questions.map((question, index) => ( -

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

- ))} -
-

- Want to respond? Verify email. -

-
- )} - {emailSent && ( - - {" "} -

Check your email.

-

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

- -
- )} + )} + ); } diff --git a/packages/ui/StackedCardsContainer/index.tsx b/packages/ui/StackedCardsContainer/index.tsx new file mode 100644 index 0000000000..0e6089da36 --- /dev/null +++ b/packages/ui/StackedCardsContainer/index.tsx @@ -0,0 +1,17 @@ +"use client"; + +interface StackedCardsContainerProps { + children: React.ReactNode; +} + +export const StackedCardsContainer: React.FC = ({ children }) => { + return ( +
+
+
+
+ {children} +
+
+ ); +};