Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3483 Rev 3490
Línea 3... Línea 3...
3
import { useMicroLearning, useFetch } from '@hooks';
3
import { useMicroLearning, useFetch } from '@hooks';
Línea 4... Línea 4...
4
 
4
 
5
import { List, SearchBar } from '@shared/components';
5
import { List, SearchBar } from '@shared/components';
6
import { CapsuleItem } from '@microlearning/components';
6
import { CapsuleItem } from '@microlearning/components';
-
 
7
import CapsuleCard from '@microlearning/components/CapsuleCard';
Línea 7... Línea 8...
7
import CapsuleCard from '@microlearning/components/CapsuleCard';
8
import Tabs from '@components/UI/Tabs';
8
 
9
 
-
 
10
export default function CapsulesPage() {
-
 
11
  const {
9
export default function CapsulesPage() {
12
    link_capsules_completed: linkCapsulesCompleted,
10
  const {
13
    link_capsules_in_progress: linkCapsulesInProgress,
11
    link_capsules_pending: linkCapsulesPending,
14
    link_capsules_pending: linkCapsulesPending,
Línea 12... Línea 15...
12
    link_last_capsule_in_progress: linkLastCapsuleInProgress
15
    link_last_capsule_in_progress: linkLastCapsuleInProgress
Línea 13... Línea 16...
13
  } = useMicroLearning();
16
  } = useMicroLearning();
14
 
17
 
Línea -... Línea 18...
-
 
18
  const [activeLink, setActiveLink] = useState('');
-
 
19
 
15
  const [activeLink, setActiveLink] = useState('');
20
  const { data: capsuleInProgess } = useFetch(linkLastCapsuleInProgress, null);
16
 
21
  const { data: capsules } = useFetch(activeLink, []);
Línea 17... Línea 22...
17
  const { data: capsuleInProgess } = useFetch(linkLastCapsuleInProgress, null);
22
 
18
  const { data: capsules } = useFetch(activeLink, []);
23
  const handleChange = (e, url) => setActiveLink(url);
Línea 19... Línea 24...
19
 
24
 
20
  useEffect(() => {
25
  useEffect(() => {
21
    if (!linkCapsulesPending) return;
26
    if (!linkCapsulesPending) return;
Línea 22... Línea 27...
22
 
27
 
23
    setActiveLink(linkCapsulesPending + '?order_field=added_on&order_direction=desc');
28
    setActiveLink(linkCapsulesPending + '?order_field=added_on&order_direction=desc');
24
  }, [linkCapsulesPending]);
29
  }, [linkCapsulesPending]);
25
 
30
 
26
  return (
31
  return (
27
    <>
32
    <>
Línea 41... Línea 46...
41
          value={
46
          value={
42
            linkCapsulesCompleted &&
47
            linkCapsulesCompleted &&
43
            linkCapsulesCompleted + '?order_field=last_access_on&order_direction=desc'
48
            linkCapsulesCompleted + '?order_field=last_access_on&order_direction=desc'
44
          }
49
          }
45
        />
50
        />
46
      </Tabs> */}
51
      </Tabs>
Línea 47... Línea 52...
47
 
52
 
Línea 48... Línea 53...
48
      <SearchBar />
53
      <SearchBar />
49
 
54