-
Notifications
You must be signed in to change notification settings - Fork 11
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(Inline-banner): refactored yield #151
Conversation
Deploy preview for freshworks-nucleus processing. Building with commit 658edf0 https://app.netlify.com/sites/freshworks-nucleus/deploys/5e730284e87c3c0008648471 |
Killed the previous build test because backstop is failing. Please create new reference images for the changed component so that it passes visual regression. |
{{nucleus-icon name=_icon size="medium" variant=type}} | ||
</div> | ||
<div class="nucleus-inline-banner__content"> | ||
{{yield | ||
(hash | ||
close=(action "onCloseTip") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need not yield the close action anymore, since it's already going to be there. Just yield
should suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, i will do it.
size="mini" | ||
icon="nucleus-cross" | ||
onClick=(action "onCloseTip")}} | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you notice, you're repeating the code inside if/else of hasBlock. Can you refactor it so that the same code is not repeated?
Principle: D.R.Y Don't Repeat Yourself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I"ll refactor this code
{{#if hasBlock}} | ||
{{yield}} | ||
{{/if}} | ||
<div data-test-id="nucleus-inline-banner-title"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be else
part? Otherwise, it'd get rendered for hasBlock scenario too, which is not what we want right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do this change..
Description
Add
Resolves #<github-issue-id>
if you wish to automatically close the Issue when this PR is merged.Related Bug