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(Inline-banner): refactored yield #151

Merged
merged 11 commits into from
Mar 19, 2020
Merged

Conversation

Shalini-Sivakumar
Copy link
Collaborator

Description

Add Resolves #<github-issue-id> if you wish to automatically close the Issue when this PR is merged.

Related Bug

@netlify
Copy link

netlify bot commented Mar 12, 2020

Deploy preview for freshworks-nucleus processing.

Building with commit 658edf0

https://app.netlify.com/sites/freshworks-nucleus/deploys/5e730284e87c3c0008648471

@Shalini-Sivakumar Shalini-Sivakumar changed the title Inline banner content fix(Inline-banner) : inline-banner-content Mar 12, 2020
@sharath-sriram
Copy link
Contributor

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")
Copy link
Contributor

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.

Copy link
Collaborator Author

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>
Copy link
Contributor

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

Copy link
Collaborator Author

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">
Copy link
Contributor

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?

Copy link
Collaborator Author

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..

@shibulijack-fd shibulijack-fd changed the title fix(Inline-banner) : inline-banner-content fix(Inline-banner): refactored yield Mar 19, 2020
@shibulijack-fd shibulijack-fd merged commit 0ce4615 into master Mar 19, 2020
@shibulijack-fd shibulijack-fd deleted the inline-banner-content branch March 19, 2020 07:06
shibulijack-fd added a commit that referenced this pull request Mar 20, 2020
* master:
  fix(modal): fixes positioning of elements (#154)
  fix(toast-message): Design review updates  (#155)
  feat(tabs): Implementation (#138)
  chore(nucleus): Nucleus now lives in the Dark! (#152)
  fix(Inline-banner): refactored yield (#151)

# Conflicts:
#	packages/@nucleus/package.json
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.

3 participants