From 308206235e00c01950806af5dc82ce31af535776 Mon Sep 17 00:00:00 2001 From: atanasster Date: Thu, 27 Aug 2020 18:42:08 +0300 Subject: [PATCH] fix: tabs story link --- ui/app/src/SidebarsPage/SidebarsStoryPage.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/app/src/SidebarsPage/SidebarsStoryPage.tsx b/ui/app/src/SidebarsPage/SidebarsStoryPage.tsx index b34e08e45..1ef98390f 100644 --- a/ui/app/src/SidebarsPage/SidebarsStoryPage.tsx +++ b/ui/app/src/SidebarsPage/SidebarsStoryPage.tsx @@ -6,6 +6,8 @@ import { useActiveTab, useGetDocumentPath, useConfig, + useCurrentStory, + useGetStoryPath, } from '@component-controls/store'; import * as pages from '@component-controls/pages'; import { @@ -36,8 +38,10 @@ export interface DocPageProps { */ export const SidebarsStoryPage: FC = ({ type, doc }) => { const docId = doc.title; + const story = useCurrentStory(); const config = useConfig(); const getDocumentPath = useGetDocumentPath(); + const getStoryPath = useGetStoryPath(); const activeTab = useActiveTab(); const pageConfig = config.pages?.[type] || {}; const { tabs = [] } = pageConfig; @@ -81,7 +85,12 @@ export const SidebarsStoryPage: FC = ({ type, doc }) => { 0 ? route : undefined, + ) + : docId ? getDocumentPath( type, docId,