Skip to content

refactor: omit unsued props in Rating component#768

Merged
dej611 merged 2 commits intoitalia:masterfrom
mendaomn:763-improve-rating-props
Oct 27, 2021
Merged

refactor: omit unsued props in Rating component#768
dej611 merged 2 commits intoitalia:masterfrom
mendaomn:763-improve-rating-props

Conversation

@mendaomn
Copy link
Copy Markdown

Fixes #763

PR Checklist

  • My branch is up-to-date with the Upstream master branch.
  • The unit tests pass locally with my changes (if applicable).
  • I have added tests that prove my fix is effective or that my feature works (if applicable).
  • I have added necessary documentation (if appropriate).

Short description of what this resolves:

Remove ineffective props from Rating component that were wrongly inherited from the InputProps

Changes proposed in this Pull Request:

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 23, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/dip-trasformazione-digitale/design-react-kit/32oBw1P7hysuUg2jDFtgWw1cWuog
✅ Preview: https://design-react-kit-git-fork-me-267b9f-dip-trasformazione-digitale.vercel.app

Copy link
Copy Markdown
Member

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

🎉 Thanks for the contribution!

The idea is good, just some comment on some readability aspect.
The failing check is just a linting issue, so just execute yarn lint --fix once updated to fix it.

Comment on lines +10 to +23
interface FilteredInputProps extends Omit<InputProps,
'bsSize' |
'size' |
'static' |
'plaintext' |
'normalized' |
'addon' |
'placeholder' |
'label' |
'value' |
'type'
> {}

export interface RatingProps extends FilteredInputProps {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps I'd collect all the props union to filter under a type, say UnusedProps and then use the Omit<InputProps, UnusedProps> in the interface here.
It makes it a bit easier to read, in my opinion

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I like it, let's do it

Copy link
Copy Markdown
Member

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

👌 Perfect thanks!

@dej611 dej611 merged commit 414382c into italia:master Oct 27, 2021
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.

[BUG][Typings] Rating component should filter Input props

2 participants