fix: removed logo from survey loading if branding is disabled (#4542)

This commit is contained in:
Dhruwang Jariwala
2024-12-30 11:38:28 +05:30
committed by GitHub
parent 838fe16845
commit 1c1ef56e00
3 changed files with 15 additions and 4 deletions

View File

@@ -226,7 +226,8 @@ export const LinkSurvey = ({
webAppUrl={webAppUrl}
IS_FORMBRICKS_CLOUD={IS_FORMBRICKS_CLOUD}
IMPRINT_URL={IMPRINT_URL}
PRIVACY_URL={PRIVACY_URL}>
PRIVACY_URL={PRIVACY_URL}
isBrandingEnabled={project.linkSurveyBranding}>
<SurveyInline
survey={survey}
styling={determineStyling()}

View File

@@ -20,6 +20,7 @@ interface LinkSurveyWrapperProps {
PRIVACY_URL?: string;
IS_FORMBRICKS_CLOUD: boolean;
webAppUrl: string;
isBrandingEnabled: boolean;
}
export const LinkSurveyWrapper = ({
@@ -34,6 +35,7 @@ export const LinkSurveyWrapper = ({
PRIVACY_URL,
IS_FORMBRICKS_CLOUD,
webAppUrl,
isBrandingEnabled,
}: LinkSurveyWrapperProps) => {
//for embedded survey strip away all surrounding css
const [isBackgroundLoaded, setIsBackgroundLoaded] = useState(false);
@@ -52,14 +54,18 @@ export const LinkSurveyWrapper = ({
styling.cardArrangement?.linkSurveys === "straight" && "pt-6",
styling.cardArrangement?.linkSurveys === "casual" && "px-6 py-10"
)}>
<SurveyLoadingAnimation survey={survey} />
<SurveyLoadingAnimation survey={survey} isBrandingEnabled={isBrandingEnabled} />
{children}
</div>
);
else
return (
<div>
<SurveyLoadingAnimation survey={survey} isBackgroundLoaded={isBackgroundLoaded} />
<SurveyLoadingAnimation
survey={survey}
isBackgroundLoaded={isBackgroundLoaded}
isBrandingEnabled={isBrandingEnabled}
/>
<MediaBackground survey={survey} project={project} onBackgroundLoaded={handleBackgroundLoaded}>
<div className="flex max-h-dvh min-h-dvh items-end justify-center overflow-clip sm:items-center">
{!styling.isLogoHidden && project.logo?.url && <ClientLogo project={project} />}

View File

@@ -8,11 +8,13 @@ import { TSurvey } from "@formbricks/types/surveys/types";
interface SurveyLoadingAnimationProps {
survey: TSurvey;
isBackgroundLoaded?: boolean;
isBrandingEnabled: boolean;
}
export const SurveyLoadingAnimation = ({
survey,
isBackgroundLoaded = true,
isBrandingEnabled,
}: SurveyLoadingAnimationProps) => {
const [isHidden, setIsHidden] = useState(false);
const [minTimePassed, setMinTimePassed] = useState(false);
@@ -118,7 +120,9 @@ export const SurveyLoadingAnimation = ({
"flex flex-col items-center space-y-4",
isReadyToTransition ? "animate-surveyExit" : "animate-surveyLoading"
)}>
<Image src={Logo} alt="Logo" className={cn("w-32 transition-all duration-1000 md:w-40")} />
{isBrandingEnabled && (
<Image src={Logo} alt="Logo" className={cn("w-32 transition-all duration-1000 md:w-40")} />
)}
<LoadingSpinner />
</div>
</div>