Skip to content

Commit

Permalink
fix: remove unneeded useStoryContext
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jul 15, 2020
1 parent bfe83cd commit e458838
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions ui/app/src/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FC, useState, useMemo, useContext } from 'react';
import { jsx, Input, Box, Heading } from 'theme-ui';
import { NoteIcon, BookIcon, FileIcon } from '@primer/octicons-react';

import { BlockContext, useStoryContext } from '@component-controls/blocks';
import { BlockContext } from '@component-controls/blocks';
import {
Sidebar as AppSidebar,
ColorMode,
Expand Down Expand Up @@ -108,9 +108,8 @@ export const Sidebar: FC<SidebarProps> = ({
type = defDocType,
activeTab,
}) => {
const { doc } = useStoryContext({ id: '.' });
const { SidebarClose, responsive } = useContext(SidebarContext);
const { storeProvider } = useContext(BlockContext);
const { storeProvider, docId } = useContext(BlockContext);
const config = storeProvider.config;
const { pages } = config || {};
const { label = '', storyPaths = false } = pages?.[type] || {};
Expand Down Expand Up @@ -156,11 +155,7 @@ export const Sidebar: FC<SidebarProps> = ({
onClick={e => e.stopPropagation()}
/>
</Box>
<Navmenu
activeItem={{ id: doc?.title }}
search={search}
items={menuItems}
/>
<Navmenu activeItem={{ id: docId }} search={search} items={menuItems} />
</Box>
</AppSidebar>
);
Expand Down

0 comments on commit e458838

Please sign in to comment.