fix response card not visible

This commit is contained in:
Johannes
2023-06-30 17:12:59 +02:00
parent 888d10434a
commit b86f837e78
3 changed files with 30 additions and 29 deletions

View File

@@ -1,5 +1,6 @@
"use client";
import SurveyEditor from "@/app/environments/[environmentId]/surveys/[surveyId]/edit/SurveyEditor";
import type { Survey } from "@formbricks/types/surveys";
import { Input, Label, Switch } from "@formbricks/ui";
import { CheckCircleIcon } from "@heroicons/react/24/solid";
@@ -112,29 +113,31 @@ export default function ResponseOptionsCard({ localSurvey, setLocalSurvey }: Res
</label>
</div>
)}
<div className="p-3 ">
<div className="ml-2 flex items-center space-x-1">
<Switch id="redirectUrl" checked={redirectToggle} onCheckedChange={handleRedirectCheckMark} />
<Label htmlFor="redirectUrl" className="cursor-pointer">
<div className="ml-2">
<h3 className="text-sm font-semibold text-slate-700">Redirect on completion</h3>
<p className="text-xs font-normal text-slate-500">
Redirect user to specified link on survey completion
</p>
</div>
</Label>
{localSurvey.type === "link" && (
<div className="p-3 ">
<div className="ml-2 flex items-center space-x-1">
<Switch id="redirectUrl" checked={redirectToggle} onCheckedChange={handleRedirectCheckMark} />
<Label htmlFor="redirectUrl" className="cursor-pointer">
<div className="ml-2">
<h3 className="text-sm font-semibold text-slate-700">Redirect on completion</h3>
<p className="text-xs font-normal text-slate-500">
Redirect user to specified link on survey completion
</p>
</div>
</Label>
</div>
<div className="mt-4">
{redirectToggle && (
<Input
type="url"
placeholder="https://www.example.com"
value={redirectUrl ? redirectUrl : ""}
onChange={(e) => handleRedirectUrlChange(e.target.value)}
/>
)}
</div>
</div>
<div className="mt-4">
{redirectToggle && (
<Input
type="url"
placeholder="https://www.example.com"
value={redirectUrl ? redirectUrl : ""}
onChange={(e) => handleRedirectUrlChange(e.target.value)}
/>
)}
</div>
</div>
)}
</div>
</Collapsible.CollapsibleContent>
</Collapsible.Root>

View File

@@ -5,13 +5,13 @@ import ResponseOptionsCard from "./ResponseOptionsCard";
import WhenToSendCard from "./WhenToSendCard";
import WhoToSendCard from "./WhoToSendCard";
interface AudienceViewProps {
interface SettingsViewProps {
environmentId: string;
localSurvey: Survey;
setLocalSurvey: (survey: Survey) => void;
}
export default function AudienceView({ environmentId, localSurvey, setLocalSurvey }: AudienceViewProps) {
export default function SettingsView({ environmentId, localSurvey, setLocalSurvey }: SettingsViewProps) {
return (
<div className="mt-12 space-y-3 p-5">
<HowToSendCard
@@ -32,9 +32,7 @@ export default function AudienceView({ environmentId, localSurvey, setLocalSurve
environmentId={environmentId}
/>
{localSurvey.type === "link" && (
<ResponseOptionsCard localSurvey={localSurvey} setLocalSurvey={setLocalSurvey} />
)}
<ResponseOptionsCard localSurvey={localSurvey} setLocalSurvey={setLocalSurvey} />
<RecontactOptionsCard
localSurvey={localSurvey}

View File

@@ -7,7 +7,7 @@ import type { Survey } from "@formbricks/types/surveys";
import { ErrorComponent } from "@formbricks/ui";
import { useEffect, useState } from "react";
import PreviewSurvey from "../../PreviewSurvey";
import AudienceView from "./AudienceView";
import SettingsView from "./SettingsView";
import QuestionsAudienceTabs from "./QuestionsAudienceTabs";
import QuestionsView from "./QuestionsView";
import SurveyMenuBar from "./SurveyMenuBar";
@@ -67,7 +67,7 @@ export default function SurveyEditor({ environmentId, surveyId }: SurveyEditorPr
environmentId={environmentId}
/>
) : (
<AudienceView
<SettingsView
environmentId={environmentId}
localSurvey={localSurvey}
setLocalSurvey={setLocalSurvey}