Skip to content

Commit

Permalink
Fix tabs with relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
JBWatenbergScality authored and hervedombya committed Jan 17, 2025
1 parent c74ad36 commit d697788
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/tabsv2/Tabsv2.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function Tabs({
return `${replaceUrl}${serialize(query)}`;
}

return `${replaceUrl}/${path}${serialize(query)}`;
return `${path}${serialize(query)}`;
};

useEffect(() => {
Expand Down Expand Up @@ -153,7 +153,7 @@ function Tabs({
...childRest
}: TabProps = child.props;
const isSelected = selectedTabIndex === index;
const realPath = `/${path.split('/').pop()}`;
const realPath = path.startsWith('/') ? `/${path.split('/').pop()}` : path;
return (
<TabItem
className={`sc-tabs-item ${isSelected ? 'selected' : ''}`}
Expand Down Expand Up @@ -235,7 +235,7 @@ function Tabs({
<Route
key={index}
path={
tab.props.path.startsWith('/') ? '/' + path : url + '/' + path
tab.props.path.startsWith('/') ? '/' + path : path
}
element={
<>
Expand Down

0 comments on commit d697788

Please sign in to comment.