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

Some components' theme={} don't allow partials #646

Closed
Ncookiez opened this issue Mar 3, 2023 · 2 comments · Fixed by #649
Closed

Some components' theme={} don't allow partials #646

Ncookiez opened this issue Mar 3, 2023 · 2 comments · Fixed by #649
Labels
🐛 bug Something isn't working confirmed This bug was confirmed good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@Ncookiez
Copy link
Contributor

Ncookiez commented Mar 3, 2023

Describe the bug
With the latest update (0.4.0) the theme prop was added to a ton of components (thank you by the way, was waiting for this for a bit :3).

The Button component has it as the following:

theme?: FlowbiteButtonTheme;

This means the entirety of the FlowbiteButtonTheme interface needs to be included when passing it a custom theme.

For reference, this is how other components are setup (Card example):

theme?: DeepPartial<FlowbiteCardTheme>;

To Reproduce
Steps to reproduce the behavior:

  1. Import the Button component and use it.
  2. Pass it any custom theme through the theme prop.
  3. See error:

image

Expected behavior
The component should take in a partial interface and merge it with the default theme (the latter is already setup).

Project information:

  • Tailwind: 3.2.7
  • Flowbite: 1.6.3
  • Flowbite React: 0.4.1
  • Type: Next App
@Ncookiez
Copy link
Contributor Author

Ncookiez commented Mar 3, 2023

I've gone ahead and also checked all the other components, and this seems to be the case for the Carousel and Floating components as well.

@tulup-conner
Copy link
Collaborator

Thanks for catching that, if you have the ability to submit a PR fixing these it would be wonderful, let me know

@tulup-conner tulup-conner added 🐛 bug Something isn't working confirmed This bug was confirmed labels Mar 3, 2023
@tulup-conner tulup-conner added this to the 1.0.0 milestone Mar 3, 2023
@tulup-conner tulup-conner added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 3, 2023
@tulup-conner tulup-conner changed the title [BUG] Button Partial Theme Some components' theme={} doesn't allow partials Mar 4, 2023
@tulup-conner tulup-conner changed the title Some components' theme={} doesn't allow partials Some components' theme={} don't allow partials Mar 4, 2023
tulup-conner pushed a commit that referenced this issue Mar 4, 2023
Thanks @Ncookiez -- All components that can have a `theme={}` should let you pass a partial theme rather than the entire object. See #646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working confirmed This bug was confirmed good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants