Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

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