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

Customize platform text based on transport mode #235

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Oct 21, 2024

TL;DR

Improved platform display logic in JourneyDetailCard component

What changed?

  • Added a new buildPlatformText function to generate appropriate platform text based on the transport mode
  • Updated the JourneyDetailCard to use the new function for displaying platform information
  • Implemented remember for better performance when filtering transport legs and calculating border colors
  • Simplified border color logic by extracting it into a separate variable

Why make this change?

This change improves the user experience by providing more accurate and mode-specific platform information. It enhances code maintainability by centralizing the platform text logic in a separate function. The use of remember for filtering transport legs and calculating border colors optimizes component recomposition, potentially improving performance. Additionally, the simplified border color logic makes the code more readable and easier to maintain.

Copy link
Owner Author

ksharma-xyz commented Oct 21, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ksharma-xyz and the rest of your teammates on Graphite Graphite

@ksharma-xyz ksharma-xyz changed the title Add logic to build platofrm text Customize platform text based on transport mode Oct 21, 2024
@ksharma-xyz ksharma-xyz marked this pull request as ready for review October 21, 2024 12:11
@ksharma-xyz ksharma-xyz force-pushed the 10-21-add_logic_to_build_platofrm_text branch from e832ea8 to 82b675c Compare October 21, 2024 12:14
@ksharma-xyz ksharma-xyz mentioned this pull request Oct 22, 2024
@ksharma-xyz ksharma-xyz force-pushed the 10-21-add_support_for_walkingleg_when_leg.transportation.product.class_is_100_or_99 branch from ea999aa to 5fdd19c Compare October 22, 2024 00:09
Base automatically changed from 10-21-add_support_for_walkingleg_when_leg.transportation.product.class_is_100_or_99 to main October 22, 2024 00:14
@ksharma-xyz ksharma-xyz force-pushed the 10-21-add_logic_to_build_platofrm_text branch from 82b675c to 58f785a Compare October 22, 2024 00:25
@ksharma-xyz ksharma-xyz enabled auto-merge (squash) October 22, 2024 00:25
@ksharma-xyz ksharma-xyz merged commit d6fec7f into main Oct 22, 2024
1 check passed
@ksharma-xyz ksharma-xyz deleted the 10-21-add_logic_to_build_platofrm_text branch October 22, 2024 00:30
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