import '../../node_modules/gatsby-core-theme/gatsby-browser';
import React from 'react';

global.___loader = {
  enqueue: () => {},
  hovering: () => {},
};

global.__PATH_PREFIX__ = '';
global.__BASE_PATH__ = '';

window.___navigate = (pathname) => {
  action('NavigateTo:')(pathname);
};

export const parameters = {
  controls: { expanded: true },
  actions: { argTypesRegex: '^on[A-Z].*' },
  options: {
    storySort: {
      method: 'alphabetical',
      order: ['sports-theme', ['Atoms', 'Molecules', 'Organisms', 'Pages', 'Hooks']],
    },
  },
};

// Global decorators for stories
export const decorators = [
  (Story) => (
    <div style={{ margin: '1.5rem auto 0', maxWidth: '96rem' }}>
      <Story />
    </div>
  ),
];
