Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3505 Rev 3527
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useParams } from 'react-router-dom';
2
import { useParams } from 'react-router-dom';
3
import { Doughnut } from 'react-chartjs-2';
3
import { Doughnut } from 'react-chartjs-2';
4
import { Box, Grid, Typography } from '@mui/material';
4
import { Box, Grid, styled, Typography } from '@mui/material';
5
import styled from 'styled-components';
-
 
Línea 6... Línea 5...
6
 
5
 
-
 
6
import { useFetch } from '@shared/hooks';
Línea 7... Línea -...
7
import { useFetch } from '@hooks';
-
 
8
 
-
 
9
import Spinner from 'components/UI/Spinner';
7
import { Spinner } from '@shared/components';
10
 
8
 
11
const Tag = styled.span`
9
const Tag = styled('span')`
12
  display: flex;
10
  display: flex;
13
  flex-direction: column;
11
  flex-direction: column;
14
  align-items: center;
12
  align-items: center;
15
  small {
13
  small {
16
    color: ${(props) => props.theme.font.color.primary};
14
    color: ${(props) => props.theme.font.color.primary};
Línea 17... Línea 15...
17
  }
15
  }
18
`;
16
`;
19
 
17
 
20
export function ProgressPage() {
-
 
21
  const { uuid } = useParams();
-
 
22
  const { data, isLoading } = useFetch(`/microlearning/progress/${uuid}`, {
-
 
23
    capsuleTotal: 0,
-
 
24
    capsuleCompleted: 0,
-
 
25
    capsuleStarted: 0,
-
 
26
    capsuleToStart: 0,
-
 
27
    percentCompleted: 0,
-
 
28
    percentIncompleted: 0,
-
 
Línea 29... Línea 18...
29
    capsuleWithReturning: 0,
18
export function ProgressPage() {
30
    capsuleWithoutReturning: 0
19
  const { uuid } = useParams();
31
  });
20
  const { data, loading } = useFetch(`/microlearning/progress/${uuid}`);
32
 
21
 
Línea 38... Línea 27...
38
        display: false
27
        display: false
39
      }
28
      }
40
    }
29
    }
41
  };
30
  };
Línea 42... Línea 31...
42
 
31
 
43
  if (isLoading) {
32
  if (loading || !data) {
44
    return <Spinner />;
33
    return <Spinner />;
Línea 45... Línea 34...
45
  }
34
  }
46
 
35