Skip to content

Commit 5b06ef1

Browse files
committed
refactor: conditionally render branding container only when needed
1 parent 67a9ed0 commit 5b06ef1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/surveys/src/components/general/survey.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -809,14 +809,18 @@ export function Survey({
809809
{content()}
810810
</div>
811811

812-
<div
813-
className={cn(
814-
"fb-flex fb-flex-col fb-justify-center fb-gap-2",
815-
isCloseButtonVisible || isLanguageSwitchVisible ? "fb-p-2" : "fb-p-3"
816-
)}>
817-
{isBrandingEnabled ? <FormbricksBranding /> : null}
818-
{isSpamProtectionEnabled ? <RecaptchaBranding /> : null}
819-
</div>
812+
{isBrandingEnabled || isSpamProtectionEnabled ? (
813+
<div
814+
className={cn(
815+
"fb-flex fb-flex-col fb-justify-center fb-gap-2",
816+
isCloseButtonVisible || isLanguageSwitchVisible ? "fb-p-2" : "fb-p-3"
817+
)}>
818+
{isBrandingEnabled ? <FormbricksBranding /> : null}
819+
{isSpamProtectionEnabled ? <RecaptchaBranding /> : null}
820+
</div>
821+
) : (
822+
<div className={"fb-flex fb-flex-col fb-justify-center fb-gap-2 fb-p-1"}></div>
823+
)}
820824
</div>
821825
</div>
822826
</AutoCloseWrapper>

0 commit comments

Comments
 (0)