Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6490 | Rev 6513 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6490 stevensc 1
import React, { useEffect, lazy } from 'react'
2
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
3
import { useDispatch } from 'react-redux'
4
import { getLanguage } from '../../redux/intl/intl.action'
5
 
6512 stevensc 6
import Auth from '../pages/auth/Auth'
6490 stevensc 7
import PrivateRoute from './PrivateRoute'
6512 stevensc 8
import NotificationAlert from '../components/UI/notification/NotificationAlert'
6490 stevensc 9
 
10
const HomeSection = lazy(() =>
11
  import('../../dashboard/components/home-section/HomeSection')
12
)
13
 
14
const AppRouter = () => {
15
  const dispatch = useDispatch()
16
 
17
  useEffect(() => {
18
    dispatch(getLanguage())
19
  }, [])
20
 
21
  return (
22
    <Router>
23
      <Switch>
24
        <Route path="/">
25
          <Auth />
26
        </Route>
27
        <PrivateRoute exact path="/dashboard">
28
          <HomeSection />
29
        </PrivateRoute>
30
      </Switch>
6512 stevensc 31
 
32
      <NotificationAlert />
6490 stevensc 33
    </Router>
34
  )
35
}
36
 
37
export default AppRouter