mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-29 18:00:26 -06:00
fix: respondent should not see redirect card text (#5239)
Co-authored-by: pandeymangg <anshuman.pandey9999@gmail.com>
This commit is contained in:
committed by
GitHub
parent
49ecbcb0c9
commit
fd9585a66e
@@ -22,6 +22,7 @@ interface EndingCardProps {
|
||||
responseData: TResponseData;
|
||||
variablesData: TResponseVariables;
|
||||
onOpenExternalURL?: (url: string) => void | Promise<void>;
|
||||
isPreviewMode: boolean;
|
||||
}
|
||||
|
||||
export function EndingCard({
|
||||
@@ -35,6 +36,7 @@ export function EndingCard({
|
||||
responseData,
|
||||
variablesData,
|
||||
onOpenExternalURL,
|
||||
isPreviewMode,
|
||||
}: EndingCardProps) {
|
||||
const media =
|
||||
endingCard.type === "endScreen" && (endingCard.imageUrl ?? endingCard.videoUrl) ? (
|
||||
@@ -112,48 +114,62 @@ export function EndingCard({
|
||||
<div className="fb-text-center">
|
||||
{isResponseSendingFinished ? (
|
||||
<>
|
||||
{endingCard.type === "endScreen" && (media ?? checkmark)}
|
||||
<div>
|
||||
<Headline
|
||||
alignTextCenter
|
||||
headline={
|
||||
endingCard.type === "endScreen"
|
||||
? replaceRecallInfo(
|
||||
getLocalizedValue(endingCard.headline, languageCode),
|
||||
responseData,
|
||||
variablesData
|
||||
)
|
||||
: "Respondents will not see this card"
|
||||
}
|
||||
questionId="EndingCard"
|
||||
/>
|
||||
<Subheader
|
||||
subheader={
|
||||
endingCard.type === "endScreen"
|
||||
? replaceRecallInfo(
|
||||
getLocalizedValue(endingCard.subheader, languageCode),
|
||||
responseData,
|
||||
variablesData
|
||||
)
|
||||
: "They will be forwarded immediately"
|
||||
}
|
||||
questionId="EndingCard"
|
||||
/>
|
||||
{endingCard.type === "endScreen" && endingCard.buttonLabel ? (
|
||||
<div className="fb-mt-6 fb-flex fb-w-full fb-flex-col fb-items-center fb-justify-center fb-space-y-4">
|
||||
<SubmitButton
|
||||
buttonLabel={replaceRecallInfo(
|
||||
getLocalizedValue(endingCard.buttonLabel, languageCode),
|
||||
{endingCard.type === "endScreen" && (
|
||||
<div>
|
||||
{media ?? checkmark}
|
||||
<div>
|
||||
<Headline
|
||||
alignTextCenter
|
||||
headline={replaceRecallInfo(
|
||||
getLocalizedValue(endingCard.headline, languageCode),
|
||||
responseData,
|
||||
variablesData
|
||||
)}
|
||||
isLastQuestion={false}
|
||||
focus={isCurrent ? autoFocusEnabled : false}
|
||||
onClick={handleSubmit}
|
||||
questionId="EndingCard"
|
||||
/>
|
||||
<Subheader
|
||||
subheader={replaceRecallInfo(
|
||||
getLocalizedValue(endingCard.subheader, languageCode),
|
||||
responseData,
|
||||
variablesData
|
||||
)}
|
||||
questionId="EndingCard"
|
||||
/>
|
||||
{endingCard.buttonLabel ? (
|
||||
<div className="fb-mt-6 fb-flex fb-w-full fb-flex-col fb-items-center fb-justify-center fb-space-y-4">
|
||||
<SubmitButton
|
||||
buttonLabel={replaceRecallInfo(
|
||||
getLocalizedValue(endingCard.buttonLabel, languageCode),
|
||||
responseData,
|
||||
variablesData
|
||||
)}
|
||||
isLastQuestion={false}
|
||||
focus={isCurrent ? autoFocusEnabled : false}
|
||||
onClick={handleSubmit}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{endingCard.type === "redirectToUrl" && (
|
||||
<>
|
||||
{isPreviewMode ? (
|
||||
<div>
|
||||
<Headline
|
||||
alignTextCenter
|
||||
headline={"Respondants will not see this card"}
|
||||
questionId="EndingCard"
|
||||
/>
|
||||
<Subheader subheader={"They will be redirected immediately"} questionId="EndingCard" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="fb-my-3">
|
||||
<LoadingSpinner />
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
|
||||
@@ -612,6 +612,7 @@ export function Survey({
|
||||
responseData={responseData}
|
||||
variablesData={currentVariables}
|
||||
onOpenExternalURL={onOpenExternalURL}
|
||||
isPreviewMode={isPreviewMode}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user