From e458838cf7c66d148f657ce72bdb2de448d759bf Mon Sep 17 00:00:00 2001 From: atanasster Date: Wed, 15 Jul 2020 05:00:05 -0400 Subject: [PATCH] fix: remove unneeded useStoryContext --- ui/app/src/Sidebar/Sidebar.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ui/app/src/Sidebar/Sidebar.tsx b/ui/app/src/Sidebar/Sidebar.tsx index c9df4463f..ab8b716c5 100644 --- a/ui/app/src/Sidebar/Sidebar.tsx +++ b/ui/app/src/Sidebar/Sidebar.tsx @@ -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, @@ -108,9 +108,8 @@ export const Sidebar: FC = ({ 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] || {}; @@ -156,11 +155,7 @@ export const Sidebar: FC = ({ onClick={e => e.stopPropagation()} /> - + );