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

UI: Add LocalTextColor and LocalTextStyle to CollapsibleAlert #597

Merged

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Feb 10, 2025

TL;DR

Improved text styling and color management in the CollapsibleAlert component by utilizing CompositionLocalProvider.

What changed?

  • Added LocalTextColor and LocalTextStyle providers to manage text appearance consistently
  • Wrapped content in CompositionLocalProvider to handle text color inheritance
  • Simplified text styling by removing redundant color parameters
  • Consolidated typography settings for better maintainability
  • Restructured the component's composition hierarchy

How to test?

  1. Navigate to a screen containing CollapsibleAlert components
  2. Verify text colors are consistent with the theme
  3. Check that text styling remains correct in both collapsed and expanded states
  4. Confirm the "Read More" button maintains proper contrast
  5. Test that alert messages (both HTML and plain text) display correctly

Why make this change?

This change improves the component's consistency with the design system by leveraging Compose's CompositionLocalProvider. It reduces code duplication and makes the component more maintainable by centralizing text styling and color management.

@ksharma-xyz ksharma-xyz changed the title Fix colors and typography of CollapsibleAlert UI: Add LocalTextColor provider to CollapsibleAlert Feb 10, 2025
@ksharma-xyz ksharma-xyz changed the title UI: Add LocalTextColor provider to CollapsibleAlert UI: Add LocalTextColor and to CollapsibleAlert Feb 10, 2025
@ksharma-xyz ksharma-xyz changed the title UI: Add LocalTextColor and to CollapsibleAlert UI: Add LocalTextColor and LocalTextStyle to CollapsibleAlert Feb 10, 2025
@ksharma-xyz ksharma-xyz marked this pull request as ready for review February 10, 2025 14:27
@ksharma-xyz ksharma-xyz force-pushed the 02-11-fix_colors_and_typography_of_collapsiblealert branch from b3012bf to 7543cbd Compare February 11, 2025 11:06
@ksharma-xyz ksharma-xyz force-pushed the 02-11-update_impl_of_transportmodeicon branch from 810ba3a to e0096a5 Compare February 11, 2025 11:06
@ksharma-xyz ksharma-xyz changed the base branch from 02-11-update_impl_of_transportmodeicon to graphite-base/597 February 11, 2025 11:19
@ksharma-xyz ksharma-xyz force-pushed the 02-11-fix_colors_and_typography_of_collapsiblealert branch from 7543cbd to d7ddac2 Compare February 11, 2025 11:19
@ksharma-xyz ksharma-xyz changed the base branch from graphite-base/597 to main February 11, 2025 11:19
@ksharma-xyz ksharma-xyz force-pushed the 02-11-fix_colors_and_typography_of_collapsiblealert branch from d7ddac2 to 8e57e47 Compare February 11, 2025 11:19
@ksharma-xyz ksharma-xyz merged commit ceff150 into main Feb 11, 2025
2 checks passed
Copy link
Owner Author

Merge activity

  • Feb 11, 6:31 AM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz deleted the 02-11-fix_colors_and_typography_of_collapsiblealert branch February 11, 2025 11:31
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.

1 participant