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

Rethink content with tabs #1475

Open
ricardovdheijden opened this issue Oct 4, 2024 · 0 comments
Open

Rethink content with tabs #1475

ricardovdheijden opened this issue Oct 4, 2024 · 0 comments

Comments

@ricardovdheijden
Copy link
Collaborator

ricardovdheijden commented Oct 4, 2024

Currently the handling of the tabs and its content are 2 separate things in the code. For better readability and improved developer experience it would be nice to have these 2 parts combined in 1 component that handles the rendering the tabs and its content together

As an example: https://github.com/workfloworchestrator/orchestrator-ui-library/blob/main/packages/orchestrator-ui-components/src/components/WfoSubscription/WfoSubscription.tsx#L91

Every page that contains tabs has logic to store the selected tab and in a different part a bunch of conditional render sections in the render part of a component to toggle the content.

   return <>
            ....
                        {selectedTab ===
                            SubscriptionDetailTab.SERVICE_CONFIGURATION_TAB && (
                            <WfoSubscriptionDetailTree
                                productBlockInstances={
                                    subscriptionDetail.productBlockInstances
                                }
                                subscriptionId={subscriptionId}
                            />
                        )}
                        {selectedTab === SubscriptionDetailTab.GENERAL_TAB && (
                            <WfoSubscriptionGeneral
                                subscriptionDetail={subscriptionDetail}
                                isFetching={isFetching}
                            />
                        )}
             .....
  </>
@ricardovdheijden ricardovdheijden added the _to discuss to discuss label Oct 4, 2024
@wouter1975 wouter1975 added technical debt and removed _to discuss to discuss labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants