Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2835 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2835 Rev 3719
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react';
2
import { styled } from '@mui/material'
2
import { styled } from '@mui/material';
3
 
3
 
4
import Modal from '../UI/modal/Modal'
4
import Modal from '../UI/modal/Modal';
5
import Feed, { renderContent } from '../dashboard/linkedin/feed-template/Feed'
5
import Feed, { renderContent } from '../dashboard/linkedin/feed-template/Feed';
6
import WidgetWrapper from '../widgets/WidgetLayout'
6
import WidgetWrapper from '../widgets/WidgetLayout';
7
import { useSelector } from 'react-redux'
7
import { useSelector } from 'react-redux';
8
 
8
 
9
const StyledBody = styled(WidgetWrapper.Body)`
9
const StyledBody = styled(WidgetWrapper.Body)`
10
  & > p,
10
  & > p,
11
  & > a {
11
  & > a {
12
    padding: 0 1rem;
12
    padding: 0 1rem;
13
  }
13
  }
14
  & > img {
14
  & > img {
15
    width: 100%;
15
    width: 100%;
16
    max-height: 60vh;
16
    max-height: 60vh;
17
    object-fit: contain;
17
    object-fit: contain;
18
  }
18
  }
19
  & > video {
19
  & > video {
20
    width: 100%;
20
    width: 100%;
21
    overflow: hidden;
21
    overflow: hidden;
22
    object-fit: scale-down;
22
    object-fit: scale-down;
23
    background-color: black;
23
    background-color: black;
24
    display: block;
24
    display: block;
25
    max-height: 80vh;
25
    max-height: 80vh;
26
  }
26
  }
27
`
27
`;
28
 
28
 
29
const FeedModal = ({ show = false, onClose = () => {}, id }) => {
29
const FeedModal = ({ show = false, onClose = () => {}, id }) => {
30
  const feed = useSelector(({ feed }) => feed.feeds.byId[id])
30
  const feed = useSelector(({ feed }) => feed.feeds.byId[id]);
31
  const {
31
  const {
32
    owner_file_image,
32
    owner_file_image,
33
    owner_file_video,
33
    owner_file_video,
34
    owner_file_image_preview,
34
    owner_file_image_preview,
35
    owner_file_document,
35
    owner_file_document,
36
    shared_content_type,
36
    shared_content_type,
37
    owner_description,
37
    owner_description,
38
    shared_name,
38
    shared_name,
39
    shared_image,
39
    shared_image,
40
    shared_time_elapse,
40
    shared_time_elapse,
41
    shared_description,
41
    shared_description,
42
    shared_file_video,
42
    shared_file_video,
43
    shared_file_image_preview,
43
    shared_file_image_preview,
44
    shared_file_image,
44
    shared_file_image,
45
    shared_file_document,
45
    shared_file_document,
46
    owner_name,
46
    owner_name,
47
    owner_image,
47
    owner_image,
48
    owner_time_elapse,
48
    owner_time_elapse,
49
    owner_url,
49
    owner_url,
50
    feed_unique,
50
    feed_unique,
51
    feed_content_type,
51
    feed_content_type,
52
    feed_vote_url,
52
    feed_vote_url,
53
    shared_url
53
    shared_url
54
  } = feed
54
  } = feed;
55
 
55
 
56
  return (
56
  return (
57
    <Modal show={show} onClose={onClose} showFooter={false}>
57
    <Modal show={show} onClose={onClose} showFooter={false}>
58
      <Feed.Header
58
      <Feed.Header
59
        image={owner_image}
59
        image={owner_image}
60
        name={owner_name}
60
        name={owner_name}
61
        timeElapsed={owner_time_elapse}
61
        timeElapsed={owner_time_elapse}
62
        viewUrl={owner_url}
62
        viewUrl={owner_url}
63
        feedUnique={feed_unique}
63
        feedUnique={feed_unique}
64
      />
64
      />
65
      <StyledBody>
65
      <StyledBody>
66
        {renderContent({
66
        {renderContent({
67
          description: owner_description,
67
          description: owner_description,
68
          image: owner_file_image,
68
          image: owner_file_image,
69
          document: owner_file_document,
69
          document: owner_file_document,
70
          video: owner_file_video,
70
          video: owner_file_video,
71
          imagePreview: owner_file_image_preview,
71
          imagePreview: owner_file_image_preview,
72
          type: shared_name ? 'shared' : feed_content_type,
72
          type: shared_name ? 'shared' : feed_content_type,
73
          voteUrl: feed_vote_url,
73
          voteUrl: feed_vote_url,
74
          sharedName: shared_name,
74
          sharedName: shared_name,
75
          sharedImage: shared_image,
75
          sharedImage: shared_image,
76
          sharedTimeElapse: shared_time_elapse,
76
          sharedTimeElapse: shared_time_elapse,
77
          sharedDescription: shared_description,
77
          sharedDescription: shared_description,
78
          sharedFileVideo: shared_file_video,
78
          sharedFileVideo: shared_file_video,
79
          sharedFileImagePreview: shared_file_image_preview,
79
          sharedFileImagePreview: shared_file_image_preview,
80
          sharedFileImage: shared_file_image,
80
          sharedFileImage: shared_file_image,
81
          sharedFileDocument: shared_file_document,
81
          sharedFileDocument: shared_file_document,
82
          sharedContentType: shared_content_type,
82
          sharedContentType: shared_content_type,
83
          sharedUrl: shared_url
83
          sharedUrl: shared_url
84
        })}
84
        })}
85
      </StyledBody>
85
      </StyledBody>
86
    </Modal>
86
    </Modal>
87
  )
87
  );
88
}
88
};
89
 
89
 
90
export default FeedModal
90
export default FeedModal;