Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3452 Rev 3510
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useSelector } from 'react-redux';
2
import { useSelector } from 'react-redux';
3
import { useParams } from 'react-router-dom';
3
import { useParams } from 'react-router-dom';
4
import { Grid, Typography } from '@mui/material';
4
import { Button, Typography } from '@mui/material';
5
import { FileDownload } from '@mui/icons-material';
5
import { FileDownload } from '@mui/icons-material';
Línea 6... Línea -...
6
 
-
 
7
import { useKnowledge } from '../hooks';
-
 
8
import { parse } from '@utils';
6
 
-
 
7
import { withReactions } from '@hocs';
-
 
8
import { useKnowledge } from '@knowledges/hooks';
Línea -... Línea 9...
-
 
9
import { parse } from '@shared/utils';
-
 
10
 
9
import { withReactions } from '@hocs';
11
import {
10
 
12
  Card,
-
 
13
  CardActions,
11
import WidgetWrapper from 'components/widgets/WidgetLayout';
14
  CardContent,
12
import CommentForm from '@app/components/dashboard/linkedin/comments/comment-form';
15
  CardMedia,
-
 
16
  CommentForm,
13
import CommentsList from '@app/components/dashboard/linkedin/comments/comment-list';
17
  CommentsList,
Línea 14... Línea 18...
14
import Button from '@app/components/UI/buttons/Buttons';
18
  PageHeader
15
import { PageHeader } from '@app/modules/shared/components';
-
 
16
 
19
} from '@shared/components';
-
 
20
 
Línea 17... Línea 21...
17
export default function KnowledgePage() {
21
export default function KnowledgePage() {
Línea 18... Línea 22...
18
  const { uuid } = useParams();
22
  const labels = useSelector(({ intl }) => intl.labels);
Línea 19... Línea 23...
19
  const labels = useSelector(({ intl }) => intl.labels);
23
  const { uuid } = useParams();
20
 
24
 
21
  const { knowledge, comments, addComment, deleteComment } = useKnowledge(uuid);
25
  const { knowledge, comments, addComment, deleteComment } = useKnowledge(uuid);
Línea 22... Línea -...
22
 
-
 
23
  const ReactionsButton = withReactions(Button);
-
 
24
 
26
 
25
  return (
27
  const ReactionsButton = withReactions(Button);
26
    <>
28
 
27
      <PageHeader title={labels.knowledge_area_title} />
29
  return (
28
 
30
    <>
29
      <Grid container mt={1}>
31
      <PageHeader title={labels.knowledge_area_title} goBack />
30
        <Grid xs={12} md={8} mx='auto'>
-
 
31
          <WidgetWrapper>
32
 
32
            <img
33
      <Card>
33
              src={knowledge.image}
34
        <CardMedia
34
              alt={`${knowledge.title} image`}
35
          src={knowledge.image}
35
              style={{ width: '100%', maxHeight: '400px' }}
36
          alt={`${knowledge.title} image`}
36
            />
37
          styles={{ width: '100%', maxHeight: '400px' }}
37
 
38
        />
38
            <WidgetWrapper.Body>
39
        <CardContent>
39
              <h2>{knowledge.title}</h2>
40
          <Typography variant='h2'>{knowledge.title}</Typography>
40
              <span>{knowledge.category}</span>
41
          <Typography variant='caption'>{knowledge.category}</Typography>
41
              <Typography>{parse(knowledge.description)}</Typography>
42
          <Typography>{parse(knowledge.description)}</Typography>
42
            </WidgetWrapper.Body>
43
        </CardContent>
43
 
44
 
44
            <WidgetWrapper.Actions>
45
        <CardActions>
45
              <ReactionsButton
46
          <ReactionsButton
46
                currentReactionType={knowledge.reaction}
47
            currentReactionType={knowledge.reaction}
47
                deleteUrl={knowledge.routeDeleteReaction}
48
            deleteUrl={knowledge.routeDeleteReaction}
48
                saveUrl={knowledge.routeSaveReaction}
49
            saveUrl={knowledge.routeSaveReaction}
49
                onReaction={() => {}}
50
            onReaction={() => {}}
50
              />
51
          />
51
 
52
 
52
              {knowledge.attachment && (
53
          {knowledge.attachment && (
53
                <a href={knowledge.attachment} download>
54
            <a href={knowledge.attachment} download>
54
                  <FileDownload />
55
              <FileDownload />
55
                  {labels.knowledge_area_download_attachment}
56
              {labels.knowledge_area_download_attachment}
56
                </a>
57
            </a>
57
              )}
58
          )}
58
              {knowledge.link && (
59
          {knowledge.link && (
59
                <a href={knowledge.link} target='_blank' rel='noreferrer'>
60
            <a href={knowledge.link} target='_blank' rel='noreferrer'>
60
                  {labels.knowledge_area_go_to_link}
61
              {labels.knowledge_area_go_to_link}
61
                </a>
-
 
62
              )}
-
 
63
            </WidgetWrapper.Actions>
62
            </a>
64
 
63
          )}
65
            <div className='px-3 pb-2'>
64
        </CardActions>
66
              <CommentForm onSubmit={addComment} />
65
 
67
              <CommentsList comments={comments} onDelete={deleteComment} />
66
        <CardContent>