Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2776 Rev 2803
Línea 1... Línea 1...
1
import React, { useEffect, useState } from 'react'
1
import React, { useEffect, useState } from 'react'
2
import { useDispatch, useSelector } from 'react-redux'
2
import { useDispatch, useSelector } from 'react-redux'
3
import { Box } from '@mui/material'
-
 
Línea 4... Línea 3...
4
 
3
 
5
import { axios } from './utils'
4
import { axios } from './utils'
6
import { useFetch } from '@hooks'
5
import { useFetch } from '@hooks'
7
import { labelsAdapter } from './utils/labels'
6
import { labelsAdapter } from './utils/labels'
8
import { setIntlLabels } from './redux/intl/intl.action'
7
import { setIntlLabels } from './redux/intl/intl.action'
Línea 9... Línea -...
9
import { logout, setPermissions } from './redux/auth/auth.actions'
-
 
10
 
-
 
11
import { Chat } from './components/chat'
-
 
12
import Header from './components/UI/navbar/Header'
-
 
13
import NotificationAlert from './components/UI/notification/NotificationAlert'
8
import { logout, setPermissions } from './redux/auth/auth.actions'
14
import Footer from './components/footer/Footer'
-
 
15
import AppRoutes from './routes/routes'
9
 
16
import GlobalStyle from './styles/GlobalStyles'
10
import AppRoutes from './routes/routes'
Línea 17... Línea 11...
17
import Spinner from './components/UI/Spinner'
11
import Spinner from './components/UI/Spinner'
Línea 18... Línea 12...
18
import ErrorPage from './pages/error/error-page'
12
import ErrorPage from './pages/error/error-page'
19
 
13
 
20
import './styles/globals.scss'
14
import './styles/globals.scss'
21
 
15
 
22
export default function App() {
16
export default function App() {
23
  const [loading, setLoading] = useState(true)
17
  const [loading, setLoading] = useState(true)
Línea 24... Línea 18...
24
  const [credentialsError, setCredentialsError] = useState(false)
18
  const [credentialsError, setCredentialsError] = useState(false)
25
  const { data: labels } = useFetch('/language')
19
  const { data: labels } = useFetch('/language')
26
  const { theme_id, isAuth } = useSelector(({ auth }) => auth)
20
  const { isAuth } = useSelector(({ auth }) => auth)
Línea 83... Línea 77...
83
 
77
 
84
  if (credentialsError) {
78
  if (credentialsError) {
85
    return <ErrorPage />
79
    return <ErrorPage />
Línea 86... Línea -...
86
  }
-
 
87
 
-
 
88
  return (
-
 
89
    <>
-
 
90
      <GlobalStyle isAuth={isAuth} />
-
 
91
 
-
 
92
      {isAuth ? <Header theme={theme_id} /> : null}
-
 
93
 
80
  }
94
      <Box minHeight='65vh'>
-
 
95
        <AppRoutes />
-
 
96
      </Box>
-
 
97
 
-
 
98
      {isAuth ? <Chat /> : null}
-
 
99
      <NotificationAlert />
-
 
100
      <Footer />
-
 
101
    </>
81