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

tab.Container: getLayoutConfig() => replaced the switch block with an object (map) #5978

Closed
wants to merge 1 commit into from

Conversation

TheCoderAdi
Copy link
Contributor

@TheCoderAdi TheCoderAdi commented Sep 29, 2024

Tab Container

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

The PR fulfills these requirements:

Other information:
This PR refactors the getLayoutConfig method to replace the switch statement with an object map. The new approach simplifies the logic and improves code readability by using an object to map tabBarPosition values directly to their respective layout configurations.

Changes:

  • Replaced the switch block with an object layoutMap to store layout configurations for bottom, left, right, and top.
  • Simplified the layout selection logic to access the corresponding configuration from the map based on this.tabBarPosition.
  • Fallback behavior remains the same — if no matching layout configuration is found, the function will return null.

This change doesn't introduce any breaking changes but enhances maintainability and readability.

@TheCoderAdi TheCoderAdi changed the title tab.Container: getLayoutConfig() => replaced the switch block with an object (map) #5429 tab.Container: getLayoutConfig() => replaced the switch block with an object (map) Sep 29, 2024
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