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: custom theme property for RadioButtonItem component #4036

Merged
merged 2 commits into from
Aug 21, 2023
Merged

fix: custom theme property for RadioButtonItem component #4036

merged 2 commits into from
Aug 21, 2023

Conversation

alexzel
Copy link
Contributor

@alexzel alexzel commented Aug 18, 2023

This PR contains two fixes for RadioButtonItem when passing custom colors through theme property:

theme={{
  colors: {
     onSurface: ....,
     onSurfaceDisabled: ...,
  },
}}
  1. Fix for type error:
error TS2740: Type '{ onSurface: string; onSurfaceDisabled: string; }' is missing the following properties from type 'MD3Colors': primary, primaryContainer, secondary, secondaryContainer, and 27 more.

Solution: Change theme type to ThemeProp.

  1. Radio button icon does not apply disabled color from custom onSurfaceDisabled theme color.

Solution: pass theme down to the components handling icon colors.

@callstack-bot
Copy link

callstack-bot commented Aug 18, 2023

Hey @alexzel, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@alexzel alexzel changed the title fix: fix theme property type in RadioButtonItem Fix custom theme property for RadioButtonItem component Aug 18, 2023
@lukewalczak lukewalczak changed the title Fix custom theme property for RadioButtonItem component fix: custom theme property for RadioButtonItem component Aug 21, 2023
@lukewalczak lukewalczak merged commit 124f38c into callstack:main Aug 21, 2023
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