Skip to content

Commit

Permalink
feat: support for isVisible page prop
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jan 6, 2021
1 parent 3151653 commit f5f6c27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/app/src/SidebarsPage/SidebarsStoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export const SidebarsStoryPage: FC<DocPageProps> = ({ type, doc }) => {
const activeTab = useActiveTab();
const pageRef = useRef<HTMLDivElement>(null);
const pageConfig = config.pages?.[type] || {};
const tabs = Object.keys(pageConfig.tabs || {});
const tabKeys = pageConfig.tabs || {};
const tabs = Object.keys(tabKeys).filter(key => {
const tab = tabKeys[key];
return story && (!tab.isVisible || tab.isVisible({ doc, story }));
});

const { tabIndex, tabConfig } = useMemo(() => {
const selectedTab = activeTab
Expand Down

0 comments on commit f5f6c27

Please sign in to comment.