How to use the @storybook/components.Router.parseQuery function in @storybook/components

To help you get started, we’ve selected a few @storybook/components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / storybook / lib / ui / src / core / legacy-url-support.js View on Github external
export default function legacyUrlSupport(state, navigate) {
  const { location } = state;
  const query = Router.parseQuery(location);

  if (query.full === '1') {
    state.ui.isFullscreen = true;
  }
  if (query.panel) {
    if (['right', 'bottom'].includes(query.panel)) {
      state.ui.panelPosition = query.panel;
    } else if (query.panel === '0') {
      state.ui.showPanel = false;
    }
  }
  if (query.nav === '0') {
    state.ui.showNav = false;
  }

  if (!query.path || query.path === '/') {