diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/StylingCard.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/StylingCard.tsx index f76b41846f..1531560a5b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/StylingCard.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/StylingCard.tsx @@ -21,7 +21,7 @@ interface StylingCardProps { export default function StylingCard({ localSurvey, setLocalSurvey, colours }: StylingCardProps) { const [open, setOpen] = useState(false); - + const progressBarHidden = localSurvey.styling?.hideProgressBar ?? false; const { type, productOverwrites, styling } = localSurvey; const { brandColor, clickOutsideClose, darkOverlay, placement, highlightBorderColor } = productOverwrites ?? {}; @@ -175,6 +175,16 @@ export default function StylingCard({ localSurvey, setLocalSurvey, colours }: St }); }; + const toggleProgressBarVisibility = () => { + setLocalSurvey({ + ...localSurvey, + styling: { + ...localSurvey.styling, + hideProgressBar: !progressBarHidden, + }, + }); + }; + return ( )} +
+
+ + +
+
diff --git a/packages/surveys/src/components/general/Survey.tsx b/packages/surveys/src/components/general/Survey.tsx index ba11ec52f7..430db68ae1 100644 --- a/packages/surveys/src/components/general/Survey.tsx +++ b/packages/surveys/src/components/general/Survey.tsx @@ -35,6 +35,7 @@ export function Survey({ const currentQuestionIndex = survey.questions.findIndex((q) => q.id === questionId); const currentQuestion = survey.questions[currentQuestionIndex]; const contentRef = useRef(null); + const showProgressBar = !survey.styling?.hideProgressBar; const [ttc, setTtc] = useState({}); useEffect(() => { if (activeQuestionId === "hidden") return; @@ -187,7 +188,7 @@ export function Survey({
{isBrandingEnabled && } - + {showProgressBar && }
diff --git a/packages/types/surveys.ts b/packages/types/surveys.ts index 3b812386ee..08aa06310e 100644 --- a/packages/types/surveys.ts +++ b/packages/types/surveys.ts @@ -62,6 +62,7 @@ export type TSurveyStylingBackground = z.infer; export const ZSurveyStyling = z.object({ background: ZSurveyStylingBackground.nullish(), + hideProgressBar: z.boolean().nullish(), }); export type TSurveyStyling = z.infer;