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

[BpkInfoBanner] Changed typing declarations to match common-types.ts file #3094

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

sambocharov
Copy link
Contributor

Changed typing declarations in common-types.d.ts to match common-types.ts

Remember to include the following changes:

  • README.md (If you have created a new component)
  • Component README.md
  • Tests
  • Storybook examples created/updated
  • For breaking changes or deprecating components/properties, migration guides added to the description of the PR. If the guide has large changes, consider creating a new Markdown page inside the component's docs folder and link it here

@sambocharov sambocharov added the patch Patch production bug label Nov 20, 2023
Copy link

github-actions bot commented Nov 20, 2023

Warnings
⚠️

Package source files (e.g. packages/package-name/src/Component.js) were updated, but snapshots weren't. Have you checked that the tests still pass?

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against 943baea

Copy link

Visit https://backpack.github.io/storybook-prs/3094 to see this build running in a browser.

export type CommonProps = {
type: AlertTypeValue;
type?: AlertTypeValue;
Copy link
Member

@olliecurtis olliecurtis Nov 20, 2023

Choose a reason for hiding this comment

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

This value would always have a value right as we set a default in the Inner Banner should would never need to be optional here and may also need to be updated in the common-types file too?

Copy link
Contributor Author

@sambocharov sambocharov Nov 20, 2023

Choose a reason for hiding this comment

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

I hope I get it right, but won't BpkInfoBanner complain about typing if we'll remove optional here? I mean, we may not pass to BpkInfoBanner a type prop and it should still work and pass typechecking. Since BpkInfoBanner has CommonProps as type for props, if we'll make type required it would fail. According to figma, if I get it right, it has a default value which we specify in BpkInfoBannerInner, as you mentioned, and type marked as not required.

Copy link
Member

Choose a reason for hiding this comment

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

Ah yeah you are right my mistake here, apologies!

Copy link

Visit https://backpack.github.io/storybook-prs/3094 to see this build running in a browser.

@olliecurtis olliecurtis changed the title changed typing declarations to match common-types.ts file [BpkInfoBanner] Changed typing declarations to match common-types.ts file Nov 21, 2023
@olliecurtis olliecurtis merged commit b7b9f27 into main Nov 21, 2023
9 checks passed
@olliecurtis olliecurtis deleted the change-warn-to-warning-type branch November 21, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Patch production bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants