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

feat: making banner more composable #6540

Merged
merged 6 commits into from
Mar 13, 2024
Merged

Conversation

kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Mar 13, 2024

About the changes

Allowing ReactNode children in banner dialog so that we can style not just from the UI markdown but also from the application code. My current use case is listing all outdated sdks with applications using those SDKs. So I will be building double nested list with links to applications. I want to use regular styled React nodes for those.

Important files

Discussion points

Copy link

vercel bot commented Mar 13, 2024

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

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 3:24pm
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Mar 13, 2024 3:24pm

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 0 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 0 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

Pretty cool 🙌

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

🚩 Declining Code Health (highest to lowest):

@@ -61,7 +61,7 @@ export const BannerModal = ({ banner, open, setOpen }: IBannerModalProps) => {
setLink(banner?.link || '');
setLinkText(banner?.linkText || '');
setDialogTitle(banner?.dialogTitle || '');
setDialog(banner?.dialog || '');
setDialog(typeof banner?.dialog === 'string' ? banner?.dialog : '');

Choose a reason for hiding this comment

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

❌ Getting worse: Complex Method
BannerModal increases in cyclomatic complexity from 19 to 20, threshold = 10

Why does this problem occur?

This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring. Read more.

To ignore this warning click here.

@kwasniew kwasniew merged commit f7062e2 into main Mar 13, 2024
5 of 7 checks passed
@kwasniew kwasniew deleted the make-banner-more-composable branch March 13, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants