Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hide logo in branded link surveys #2412

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

ShubhamPalriwala
Copy link
Contributor

What does this PR do?

Hide Logo Toggle Fix + Introduce prop in component for the hideLogo

Fixes # (issue)

How should this be tested?

  • Test A
  • Test B

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link
Contributor

github-actions bot commented Apr 8, 2024

Thank you for following the naming conventions for pull request titles! 🙏

Copy link

vercel bot commented Apr 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
formbricks-cloud ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 11:14am
formbricks-com ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 11:14am

@jobenjada jobenjada self-requested a review April 9, 2024 07:25
@@ -181,7 +181,9 @@ export default function LinkSurvey({

return (
<div className="flex h-screen items-center justify-center">
{!determineStyling().isLogoHidden && product.logo?.url && <ClientLogo product={product} />}
{product.logo?.url && (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have one check here anyways so let's keep all the "can and should we show the logo" here on this layer instead of passing it down.

@@ -181,7 +181,9 @@ export default function LinkSurvey({

return (
<div className="flex h-screen items-center justify-center">
{!determineStyling().isLogoHidden && product.logo?.url && <ClientLogo product={product} />}
{product.logo?.url && (
<ClientLogo product={product} isLogoHidden={determineStyling().isLogoHidden ?? true} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this logic doesn't play out right. It should only be hidden if it is clearly set to hidden and not vice versa. If anything, it should be "?? false" so that it only gets hidden, when its definitely set to hidden?

Not entirely sure, havent worked with "??" yet but have a look at this video:

bug-logo.mp4

environmentId={environment.id}
product={product}
previewSurvey
isLogoHidden={styling.isLogoHidden ?? false}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see, here you work with ?? false, which makes more sense to me

environmentId={environment.id}
product={product}
previewSurvey
isLogoHidden={styling.isLogoHidden ?? true}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true vs false???

@jobenjada jobenjada added this pull request to the merge queue Apr 9, 2024
Merged via the queue into main with commit 95fe94f Apr 9, 2024
12 checks passed
@jobenjada jobenjada deleted the shubham/fix-hide-logo-toggle-in-link-surveys branch April 9, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants