main.tsx 925 B

12345678910111213141516171819202122232425262728293031
  1. import {browserHistory, Router, RouterContext} from 'react-router';
  2. import DemoHeader from 'sentry/components/demo/demoHeader';
  3. import ThemeAndStyleProvider from 'sentry/components/themeAndStyleProvider';
  4. import {routes} from 'sentry/routes';
  5. import ConfigStore from 'sentry/stores/configStore';
  6. import {RouteContext} from 'sentry/views/routeContext';
  7. import {PersistedStoreProvider} from './stores/persistedStore';
  8. function Main() {
  9. return (
  10. <ThemeAndStyleProvider>
  11. <PersistedStoreProvider>
  12. {ConfigStore.get('demoMode') && <DemoHeader />}
  13. <Router
  14. history={browserHistory}
  15. render={props => (
  16. <RouteContext.Provider value={props}>
  17. <RouterContext {...props} />
  18. </RouteContext.Provider>
  19. )}
  20. >
  21. {routes()}
  22. </Router>
  23. </PersistedStoreProvider>
  24. </ThemeAndStyleProvider>
  25. );
  26. }
  27. export default Main;