Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3510 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 { Button, styled, Typography } from '@mui/material';
3
import { Typography } from '@mui/material';
Línea 4... Línea 4...
4
 
4
 
5
import { useCapsule } from '@microlearning/hooks';
5
import { useCapsule } from '@microlearning/hooks';
Línea 6... Línea -...
6
import { parse } from '@shared/utils';
-
 
7
 
6
import { parse } from '@shared/utils';
8
import { Card, CardContent, CommentForm, CommentsList, Spinner } from '@shared/components';
7
 
9
 
8
import {
10
const Picture = styled('img')`
9
  Card,
11
  width: 100%;
10
  CardContent,
12
  height: 250px;
11
  CardMedia,
13
  border-radius: 10px;
12
  CommentForm,
14
  background-color: #0009;
13
  CommentsList,
15
  object-fit: contain;
-
 
Línea 16... Línea 14...
16
  margin-bottom: 1rem;
14
  Spinner
17
`;
15
} from '@shared/components';
Línea 18... Línea 16...
18
 
16
 
Línea 19... Línea -...
19
export function CapsulePage() {
-
 
20
  const { uuid } = useParams();
-
 
21
 
-
 
22
  const { capsule, loading } = useCapsule(uuid);
-
 
23
 
-
 
24
  /* const getSlides = async () => {
-
 
25
    try {
-
 
26
      const slides = await getSlide(capsule.link_first_slide);
-
 
27
    } catch (error) {
-
 
28
      addNotification({ style: 'danger', msg: error.message });
-
 
29
    }
-
 
30
  };
-
 
31
 
-
 
32
  const handleStart = async () => {
-
 
33
    capsule?.total_slides === 1 && capsule?.type_first_slide === 'video'
17
export function CapsulePage() {
Línea 34... Línea 18...
34
      ? getSlides()
18
  const { uuid } = useParams();
35
      : navigate('slides');
19
 
36
  }; */
20
  const { capsule, loading } = useCapsule(uuid);
37
 
-
 
38
  if (loading || !capsule) return <Spinner />;
-
 
39
 
21
 
40
  return (
22
  if (loading || !capsule) return <Spinner />;
41
    <>
23
 
-
 
24
  return (
42
      <Picture src={capsule.image} alt={`${capsule.name} capsule`} />
25
    <Card>
43
 
26
      <CardMedia src={capsule.image} alt={`${capsule.name} capsule`} />
44
      <Card>
27
      <CardContent>
45
        <CardContent>
28
        <Typography variant='h1'>{capsule.name}</Typography>
46
          <Typography variant='h1'>{capsule.name}</Typography>
-
 
47
          <Typography>{parse(capsule.description)}</Typography>
-
 
48
          <CommentForm />
-
 
49
          <CommentsList />
29
        <Typography>{parse(capsule.description)}</Typography>
50
        </CardContent>
30