From 501ce56de66afb7b1ee1969cdf87461ba19eba04 Mon Sep 17 00:00:00 2001 From: Matthias Nannt Date: Thu, 20 Apr 2023 15:43:52 +0200 Subject: [PATCH] show different placeholder in link summary empty page filler --- .../[surveyId]/summary/SummaryList.tsx | 6 ++- .../components/shared/EmptySpaceFiller.tsx | 41 ++++++++++++++++--- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/apps/web/app/environments/[environmentId]/surveys/[surveyId]/summary/SummaryList.tsx b/apps/web/app/environments/[environmentId]/surveys/[surveyId]/summary/SummaryList.tsx index d184e492fc..52c7b6bf66 100644 --- a/apps/web/app/environments/[environmentId]/surveys/[surveyId]/summary/SummaryList.tsx +++ b/apps/web/app/environments/[environmentId]/surveys/[surveyId]/summary/SummaryList.tsx @@ -49,7 +49,11 @@ export default function SummaryList({ environmentId, surveyId }) { <>
{responses.length === 0 ? ( - + ) : ( <> {summaryData.map((questionSummary) => { diff --git a/apps/web/components/shared/EmptySpaceFiller.tsx b/apps/web/components/shared/EmptySpaceFiller.tsx index eac88a2839..3eb96cd779 100644 --- a/apps/web/components/shared/EmptySpaceFiller.tsx +++ b/apps/web/components/shared/EmptySpaceFiller.tsx @@ -6,11 +6,12 @@ import { useEnvironment } from "@/lib/environments/environments"; import LoadingSpinner from "./LoadingSpinner"; type EmptySpaceFillerProps = { - type: "table" | "response" | "event"; + type: "table" | "response" | "event" | "linkResponse"; environmentId: string; + noWidgetRequired?: boolean; }; -const EmptySpaceFiller: React.FC = ({ type, environmentId }) => { +const EmptySpaceFiller: React.FC = ({ type, environmentId, noWidgetRequired }) => { const { environment, isErrorEnvironment, isLoadingEnvironment } = useEnvironment(environmentId); if (isLoadingEnvironment) return ; @@ -24,7 +25,7 @@ const EmptySpaceFiller: React.FC = ({ type, environmentId
- {!environment.widgetSetupCompleted && ( + {!environment.widgetSetupCompleted && !noWidgetRequired && ( @@ -33,7 +34,7 @@ const EmptySpaceFiller: React.FC = ({ type, environmentId )} - {environment.widgetSetupCompleted && + {(environment.widgetSetupCompleted || noWidgetRequired) && "Your data will appear here as soon as you receive your first response ⏲️"}
@@ -52,7 +53,7 @@ const EmptySpaceFiller: React.FC = ({ type, environmentId
- {!environment.widgetSetupCompleted && ( + {!environment.widgetSetupCompleted && !noWidgetRequired && ( @@ -61,7 +62,7 @@ const EmptySpaceFiller: React.FC = ({ type, environmentId )} - {environment.widgetSetupCompleted && ( + {(environment.widgetSetupCompleted || noWidgetRequired) && ( Your data will appear here as soon as you receive your first response ⏲️ @@ -72,6 +73,34 @@ const EmptySpaceFiller: React.FC = ({ type, environmentId
); } + return ( +
+
+
+
+
+
+
+
+ {!environment.widgetSetupCompleted && !noWidgetRequired && ( + + + Setup Formbricks Widget to start collecting insights 🚀 + + + )} + {(environment.widgetSetupCompleted || noWidgetRequired) && ( + + Your data will appear here as soon as you receive your first response ⏲️ + + )} +
+
+
+
+ ); return null; };