Skip to content

Commit

Permalink
fix #25404
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jan 3, 2024
1 parent bf06e6e commit 5bd0359
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions code/ui/manager/src/container/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useMemo } from 'react';

import type { Combo, StoriesHash } from '@storybook/manager-api';
import { types, Consumer } from '@storybook/manager-api';
import { Consumer } from '@storybook/manager-api';
import { Addon_TypesEnum } from '@storybook/types';

import type { SidebarProps as SidebarComponentProps } from '../components/sidebar/Sidebar';
import { Sidebar as SidebarComponent } from '../components/sidebar/Sidebar';
Expand Down Expand Up @@ -41,9 +42,12 @@ const Sidebar = React.memo(function Sideber({ onMenuClick }: SidebarProps) {
const whatsNewNotificationsEnabled =
state.whatsNewData?.status === 'SUCCESS' && !state.disableWhatsNewNotifications;

const items = api.getElements(types.experimental_SIDEBAR_BOTTOM);
const bottom = useMemo(() => Object.values(items), [items]);
const top = useMemo(() => Object.values(api.getElements(types.experimental_SIDEBAR_TOP)), []);
const bottomItems = api.getElements(Addon_TypesEnum.experimental_SIDEBAR_BOTTOM);
const topItems = api.getElements(Addon_TypesEnum.experimental_SIDEBAR_TOP);
// eslint-disable-next-line react-hooks/exhaustive-deps
const bottom = useMemo(() => Object.values(bottomItems), [...Object.values(bottomItems)]);
// eslint-disable-next-line react-hooks/exhaustive-deps
const top = useMemo(() => Object.values(topItems), [...Object.values(topItems)]);

return {
title: name,
Expand Down

0 comments on commit 5bd0359

Please sign in to comment.