useOnboardingSidebar.tsx 495 B

123456789101112131415
  1. import {useCallback} from 'react';
  2. import {SidebarPanelKey} from 'sentry/components/sidebar/types';
  3. import SidebarPanelStore from 'sentry/stores/sidebarPanelStore';
  4. export function useOnboardingSidebar() {
  5. const activateSidebar = useCallback(() => {
  6. // Delay activating the onboarding panel until after the sidebar closes on route change
  7. setTimeout(() => {
  8. SidebarPanelStore.activatePanel(SidebarPanelKey.ONBOARDING_WIZARD);
  9. }, 0);
  10. }, []);
  11. return {activateSidebar};
  12. }