fix: hide logo in branded link surveys (#2412)

Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
This commit is contained in:
Shubham Palriwala
2024-04-09 17:44:15 +05:30
committed by GitHub
parent 74829183ea
commit 95fe94fb7f
2 changed files with 11 additions and 7 deletions
@@ -40,7 +40,7 @@ const CardStylingSettings = ({
const isLogoHidden = styling?.isLogoHidden ?? false;
const isLogoVisible = !isLogoHidden && !!localProduct.logo?.url;
const isLogoVisible = !!localProduct.logo?.url;
const setCardBgColor = (color: string) => {
setStyling((prev) => ({
@@ -120,10 +120,10 @@ const CardStylingSettings = ({
};
const toggleLogoVisibility = () => {
setStyling({
...styling,
isLogoHidden: !isLogoHidden,
});
setStyling((prev) => ({
...prev,
isLogoHidden: !prev.isLogoHidden,
}));
};
const hideProgressBar = useMemo(() => {
@@ -242,7 +242,9 @@ export default function PreviewSurvey({
) : (
<div className="w-full px-3">
<div className="absolute left-5 top-5">
<ClientLogo environmentId={environment.id} product={product} previewSurvey />
{!styling.isLogoHidden && product.logo?.url && (
<ClientLogo environmentId={environment.id} product={product} previewSurvey />
)}
</div>
<div className="no-scrollbar z-10 w-full max-w-md overflow-y-auto rounded-lg border border-transparent">
<SurveyInline
@@ -321,7 +323,9 @@ export default function PreviewSurvey({
) : (
<MediaBackground survey={survey} product={product} ContentRef={ContentRef} isEditorView>
<div className="absolute left-5 top-5">
<ClientLogo environmentId={environment.id} product={product} previewSurvey />
{!styling.isLogoHidden && product.logo?.url && (
<ClientLogo environmentId={environment.id} product={product} previewSurvey />
)}
</div>
<div className="z-0 w-full max-w-md rounded-lg border-transparent">
<SurveyInline