Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3262 Rev 3588
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState } from 'react';
2
import { useNavigate } from 'react-router-dom'
2
import { useNavigate } from 'react-router-dom';
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux';
4
import { Box, Button } from '@mui/material'
4
import { Box, Button } from '@mui/material';
Línea 5... Línea 5...
5
 
5
 
6
import { getOnRoom } from '@services/onRoom'
6
import { getOnRoom } from '@services/onRoom';
7
import { addNotification } from '@store/notification/notification.actions'
7
import { addNotification } from '@store/notification/notification.actions';
Línea 8... Línea 8...
8
import colors from '@styles/colors'
8
import colors from '@styles/colors';
Línea 9... Línea 9...
9
 
9
 
10
import Spinner from '@components/UI/Spinner'
10
import Spinner from '@components/UI/Spinner';
11
 
11
 
12
export default function AppsNavigation() {
12
export default function AppsNavigation() {
Línea 13... Línea 13...
13
  const [loading, setLoading] = useState(false)
13
  const [loading, setLoading] = useState(false);
14
  const dispatch = useDispatch()
14
  const dispatch = useDispatch();
15
  const navigate = useNavigate()
15
  const navigate = useNavigate();
16
 
16
 
17
  const handleOnRoom = async () => {
17
  const handleOnRoom = async () => {
18
    try {
18
    try {
19
      setLoading(true)
19
      setLoading(true);
20
      const onRoomUrl = await getOnRoom()
20
      const onRoomUrl = await getOnRoom();
21
      window.open(onRoomUrl, '_blank')
21
      window.open(onRoomUrl, '_blank');
22
    } catch (error) {
22
    } catch (error) {
23
      dispatch(addNotification({ style: 'danger', msg: error.message }))
23
      dispatch(addNotification({ style: 'danger', msg: error.message }));
Línea 24... Línea 24...
24
    } finally {
24
    } finally {
25
      setLoading(false)
25
      setLoading(false);
26
    }
26
    }
27
  }
27
  };
28
 
28
 
29
  return (
29
  return (
30
    <Box
30
    <Box
31
      sx={{
31
      sx={{
32
        position: 'fixed',
32
        position: 'fixed',
33
        top: 0,
33
        top: 0,
34
        left: 0,
34
        left: 0,
35
        height: '100vh',
35
        height: '100vh',
36
        width: '100%',
36
        width: '100%',
37
        backgroundColor: colors.main,
37
        backgroundColor: colors.background.primary,
Línea 55... Línea 55...
55
      </Button>
55
      </Button>
56
      <Button color='primary' onClick={() => navigate('/dashboard')}>
56
      <Button color='primary' onClick={() => navigate('/dashboard')}>
57
        Ir al inicio
57
        Ir al inicio
58
      </Button>
58
      </Button>
59
    </Box>
59
    </Box>
60
  )
60
  );
61
}
61
}