Skip to content

Commit

Permalink
add switch
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMarcMilletScality committed Jun 25, 2024
1 parent a84e293 commit aa1eb0f
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions src/lib/components/tabsv2/Tabsv2.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
useRouteMatch,
matchPath,
Route,
Switch,
} from 'react-router-dom';
import { SecondaryText, BasicText, EmphaseText } from '../text/Text.component';
import { ScrollButton } from './ScrollButton';
Expand Down Expand Up @@ -218,32 +219,34 @@ function Tabs({
/>
)}
</ScrollableContainer>
{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}
>
<TabContent
className="sc-tabs-item-content"
tabContentColor={tabContentColor}
withoutPadding={tab.props.withoutPadding}
<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}
>
{!tab.props.query ||
(tab.props.query && matchQuery(tab.props.query)) ? (
tab.props.children
) : (
<></>
)}
</TabContent>
</Route>
))}
<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
) : (
<></>
)}
</TabContent>
</Route>
))}
</Switch>
</TabsContainer>
</TabsContext.Provider>
);
Expand Down

0 comments on commit aa1eb0f

Please sign in to comment.