mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
always show tab tools. only use isToolshown option to hide and show tab tools
This commit is contained in:
parent
6daa34deee
commit
c735c908dc
@ -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(() => {
|
||||||
|
@ -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>) =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user