always show tab tools. only use isToolshown option to hide and show tab tools

This commit is contained in:
Tomas Nygren 2021-05-04 18:09:29 +10:00
parent 6daa34deee
commit c735c908dc
2 changed files with 2 additions and 4 deletions

View File

@ -146,8 +146,7 @@ const Preview = React.memo<PreviewProps>((props) => {
const tabs = useTabs(previewId, baseUrl, withLoader, getElements, story); const tabs = useTabs(previewId, baseUrl, withLoader, getElements, story);
const shouldScale = viewMode === 'story'; const shouldScale = viewMode === 'story';
const isToolshown = const { isToolshown } = options;
!(viewMode === 'docs' && tabs.filter((t) => !t.hidden).length < 2) && options.isToolshown;
const initialRender = useRef(true); const initialRender = useRef(true);
useEffect(() => { useEffect(() => {

View File

@ -181,8 +181,7 @@ export function filterTools(
path: State['path']; path: State['path'];
} }
) { ) {
const tabsTool = createTabsTool(tabs); const toolsLeft = [tabs.filter((p) => !p.hidden).length >= 1 && createTabsTool(tabs), ...tools];
const toolsLeft = [tabs.filter((p) => !p.hidden).length > 1 ? tabsTool : null, ...tools];
const toolsRight = [...toolsExtra]; const toolsRight = [...toolsExtra];
const filter = (item: Partial<Addon>) => const filter = (item: Partial<Addon>) =>