Skip to content

Commit

Permalink
chore: change the final item to a text input
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwisecodes committed Aug 28, 2024
1 parent 4e023d5 commit 895f656
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions apps/nextjs/src/components/Feedback/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ const FeedBack = ({
onClick={() => {
setUsersResponse((prevState) => ({
...prevState,
[`$survey_response_${i}`]:
[`$survey_response_${i + 1}`]:
feedback.number.toString(),
}));
}}
>
<span
className={`text-lg ${
usersResponse[`$survey_response_${i}`] ===
usersResponse[`$survey_response_${i + 1}`] ===
feedback.number.toString()
? `text-[#287C34]`
: `text-black`
Expand All @@ -85,7 +85,7 @@ const FeedBack = ({
</span>
<span
className={
usersResponse[`$survey_response_${i}`] ===
usersResponse[`$survey_response_${i + 1}`] ===
feedback.number.toString()
? "opacity-100"
: "opacity-0"
Expand All @@ -100,6 +100,31 @@ const FeedBack = ({
</div>
);
}
if (question.type === "open") {
return (
<div
key={question.question}
className="flex flex-col items-start justify-start"
>
<label
htmlFor={question.question}
className="mb-16 text-center text-xl "
>
{question.question}
</label>
<textarea
className="h-32 w-full min-w-[300px] rounded border-2 border-black p-10"
onChange={(e) => {
setUsersResponse({
...usersResponse,
$survey_response_3: e.target.value,
});
}}
id={question.question}
/>
</div>
);
}
})}
<div className="flex justify-between">
<ChatButton
Expand Down

0 comments on commit 895f656

Please sign in to comment.