App.js 793 B

1234567891011121314151617181920212223242526272829
  1. import './App.scss'
  2. import { Provider } from 'react-redux'
  3. import { Router} from 'react-router-dom'
  4. import React from 'react'
  5. import { store } from './redux/store'
  6. import 'antd/dist/antd.css'
  7. import { actionFullProfilePageTypeSaga } from './actions/typeSaga/myDataTypesSaga'
  8. import { CShowHeader } from './pages/header'
  9. import { CRouting } from './components/Routing'
  10. import history from './helpers/history'
  11. store.subscribe(() => console.log(store.getState()))
  12. function App() {
  13. if (store.getState().auth?.token)
  14. store.dispatch(actionFullProfilePageTypeSaga())
  15. return (
  16. <Router history={history}>
  17. <Provider store={store}>
  18. <div className="App">
  19. <CRouting />
  20. <CShowHeader />
  21. </div>
  22. </Provider>
  23. </Router>
  24. )
  25. }
  26. export default App