Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6514 | Rev 6516 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6514 Rev 6515
Línea 1... Línea 1...
1
import React, { useEffect, lazy } from 'react'
1
import React, { useEffect, lazy, Suspense } from 'react'
2
import { BrowserRouter as Router, Switch } from 'react-router-dom'
2
import { BrowserRouter as Router, Switch } from 'react-router-dom'
3
import { useDispatch, useSelector } from 'react-redux'
3
import { useDispatch, useSelector } from 'react-redux'
4
import { getLanguage } from '../../redux/intl/intl.action'
4
import { getLanguage } from '../../redux/intl/intl.action'
Línea 5... Línea 5...
5
 
5
 
6
import Auth from '../pages/auth/Auth'
6
import Auth from '../pages/auth/Auth'
7
import PrivateRoute from './PrivateRoute'
7
import PrivateRoute from './PrivateRoute'
8
import NotificationAlert from '../components/UI/notification/NotificationAlert'
8
import NotificationAlert from '../components/UI/notification/NotificationAlert'
Línea 9... Línea -...
9
import PublicRoute from './PublicRoute'
-
 
10
 
9
import PublicRoute from './PublicRoute'
11
const HomeSection = lazy(() =>
-
 
Línea 12... Línea 10...
12
  import('../../dashboard/components/home-section/HomeSection')
10
 
13
)
11
const DashboardPage = lazy(() => import('../pages/dashboard/DashboardPage'))
14
 
12
 
Línea 21... Línea 19...
21
  }, [])
19
  }, [])
Línea 22... Línea 20...
22
 
20
 
23
  return (
21
  return (
24
    <Router>
22
    <Router>
-
 
23
      <Switch>
25
      <Switch>
24
        <Suspense fallback={null}>
26
        <PublicRoute path="/" isAuthenticated={isAuth}>
25
          <PublicRoute path="/" isAuthenticated={isAuth}>
27
          <Auth />
26
            <Auth />
28
        </PublicRoute>
27
          </PublicRoute>
29
 
28
 
30
        <PrivateRoute exact path="/dashboard" isAuthenticated={isAuth}>
29
          <PrivateRoute exact path="/dashboard" isAuthenticated={isAuth}>
31
          <HomeSection />
30
            <DashboardPage />
-
 
31
          </PrivateRoute>
32
        </PrivateRoute>
32
        </Suspense>
Línea 33... Línea 33...
33
      </Switch>
33
      </Switch>
34
 
34
 
35
      <NotificationAlert />
35
      <NotificationAlert />