Skip to content

Commit

Permalink
put TabContent inside route
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMarcMilletScality committed Jun 25, 2024
1 parent aa1eb0f commit efc88a7
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions src/lib/components/tabsv2/Tabsv2.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,34 +219,33 @@ function Tabs({
/>
)}
</ScrollableContainer>
<Switch>
{filteredTabsChildren.map((tab, index) => (
<Route
exact={tab.props.exact}
sensitive={tab.props.sensitive}
strict={tab.props.strict}
path={
tab.props.path.startsWith('/')
? tab.props.path
: url + '/' + tab.props.path
}
key={index}
>

{filteredTabsChildren.map((tab, index) => (
<Route
exact={tab.props.exact}
sensitive={tab.props.sensitive}
strict={tab.props.strict}
path={
tab.props.path.startsWith('/')
? tab.props.path
: url + '/' + tab.props.path
}
key={index}
>
{!tab.props.query ||
(tab.props.query && matchQuery(tab.props.query)) ? (
<TabContent
className="sc-tabs-item-content"
tabContentColor={tabContentColor}
withoutPadding={tab.props.withoutPadding}
>
{!tab.props.query ||
(tab.props.query && matchQuery(tab.props.query)) ? (
tab.props.children
) : (
<></>
)}
{tab.props.children}
</TabContent>
</Route>
))}
</Switch>
) : (
<></>
)}
</Route>
))}
</TabsContainer>
</TabsContext.Provider>
);
Expand Down

0 comments on commit efc88a7

Please sign in to comment.