Skip to content

Commit

Permalink
fix: tab url when storyPaths = true
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jul 10, 2020
1 parent ccf976c commit 32735d2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ui/app/src/SidebarsPage/SidebarsStoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const SidebarsStoryPage: FC<DocPageProps> = ({
activeTab,
doc,
}) => {
const { storeProvider, docId } = useContext(BlockContext);
const { storeProvider, docId, storyId } = useContext(BlockContext);
const pageConfig = storeProvider?.config?.pages?.[type] || {};
const { tabs = [] } = pageConfig;
const { tabs = [], storyPaths } = pageConfig;
const selectedTab = activeTab
? activeTab
: tabs.length > 0
Expand Down Expand Up @@ -76,7 +76,12 @@ export const SidebarsStoryPage: FC<DocPageProps> = ({
<Tab key={`tab_${tab.route}`}>
<Link
href={
docId
storyPaths && storyId
? storeProvider.getStoryPath(
storyId,
tabIndex > 0 ? tab.route : undefined,
)
: docId
? storeProvider.getPagePath(
type,
docId,
Expand Down

0 comments on commit 32735d2

Please sign in to comment.