Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 735 Rev 740
Línea 1... Línea 1...
1
import React, { useEffect, useState } from 'react'
1
import React, { useEffect, useState } from 'react'
2
import { axios } from '../../utils'
2
import { axios } from '../../utils'
3
import { useLocation } from 'react-router-dom'
3
import { useLocation } from 'react-router-dom'
4
import { getBackendVars } from '../../services/backendVars'
4
import { getBackendVars } from '../../services/backendVars'
5
import { addNotification } from '../../redux/notification/notification.actions'
5
import { addNotification } from '../../redux/notification/notification.actions'
6
import { Col, Container, Row } from 'react-bootstrap'
-
 
7
import { useDispatch, useSelector } from 'react-redux'
6
import { useDispatch, useSelector } from 'react-redux'
-
 
7
import { CommentForm, CommentsList } from '../../components/feed/CommentSection'
-
 
8
import { Container, Grid } from '@mui/material'
8
import parse from 'html-react-parser'
9
import parse from 'html-react-parser'
Línea 9... Línea 10...
9
 
10
 
10
import TungstenIcon from '@mui/icons-material/Tungsten'
11
import TungstenIcon from '@mui/icons-material/Tungsten'
11
import RecommendIcon from '@mui/icons-material/Recommend'
12
import RecommendIcon from '@mui/icons-material/Recommend'
12
import FavoriteIcon from '@mui/icons-material/FavoriteTwoTone'
13
import FavoriteIcon from '@mui/icons-material/FavoriteTwoTone'
13
import SendOutlinedIcon from '@mui/icons-material/SendOutlined'
14
import SendOutlinedIcon from '@mui/icons-material/SendOutlined'
14
import ChatOutlinedIcon from '@mui/icons-material/ChatOutlined'
15
import ChatOutlinedIcon from '@mui/icons-material/ChatOutlined'
15
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions'
16
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions'
Línea 16... Línea -...
16
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism'
-
 
17
 
17
import VolunteerActivismIcon from '@mui/icons-material/VolunteerActivism'
18
import { CommentForm, CommentsList } from '../../components/feed/CommentSection'
18
 
19
import HomeNews from '../../components/widgets/default/HomeNews'
19
import HomeNews from '../../components/widgets/default/HomeNews'
20
import InputOption from '../../components/dashboard/linkedin/action-button/InputOption'
20
import InputOption from '../../components/dashboard/linkedin/action-button/InputOption'
21
import withExternalShare from '../../components/dashboard/linkedin/withExternalShare'
21
import withExternalShare from '../../components/dashboard/linkedin/withExternalShare'
Línea 31... Línea 31...
31
  const [myReaction, setMyReaction] = useState('')
31
  const [myReaction, setMyReaction] = useState('')
32
  const [totalReactions, setTotalReactions] = useState(0)
32
  const [totalReactions, setTotalReactions] = useState(0)
33
  const [isMobile, setIsMobile] = useState(false)
33
  const [isMobile, setIsMobile] = useState(false)
34
  const [comments, setComments] = useState([])
34
  const [comments, setComments] = useState([])
35
  const [showComments, setShowComments] = useState(false)
35
  const [showComments, setShowComments] = useState(false)
-
 
36
  const { pathname } = useLocation()
36
  const labels = useSelector(({ intl }) => intl.labels)
37
  const labels = useSelector(({ intl }) => intl.labels)
37
  const dispatch = useDispatch()
38
  const dispatch = useDispatch()
38
  const { pathname } = useLocation()
-
 
Línea 39... Línea 39...
39
 
39
 
40
  const reactionsOptions = [
40
  const reactionsOptions = [
41
    {
41
    {
42
      type: 'r',
42
      type: 'r',
Línea 186... Línea 186...
186
      setIsMobile(true)
186
      setIsMobile(true)
187
    }
187
    }
188
  }, [])
188
  }, [])
Línea 189... Línea 189...
189
 
189
 
190
  return (
190
  return (
191
    <Container>
191
    <Container as='main' className='px-0'>
192
      <Row>
192
      <Grid container spacing={2}>
193
        <Col md='8'>
193
        <Grid item xs={12} md={8}>
194
          <StyledContainer>
194
          <StyledContainer>
195
            <img src={post.image} />
195
            <img src={post.image} />
-
 
196
            <StyledContainer.Header title={post.title} />
196
            <StyledContainer.Header title={post.title} />
197
 
197
            <StyledContainer.Body>
198
            <StyledContainer.Body>
198
              <Paraphrase>{post.description}</Paraphrase>
199
              <Paraphrase>{post.description}</Paraphrase>
199
              {post.file && (
200
              {post.file && (
200
                <a href={post.file} download>
201
                <a href={post.file} download>
201
                  <img src='/images/extension/pdf.png' alt='pdf' />
202
                  <img src='/images/extension/pdf.png' alt='pdf' />
202
                </a>
203
                </a>
203
              )}
204
              )}
-
 
205
            </StyledContainer.Body>
204
            </StyledContainer.Body>
206
 
205
            <div className='d-flex justify-content-between align-items-center px-3'>
207
            <div className='d-flex justify-content-between align-items-center px-3'>
206
              <div className='reactions-counter'>
208
              <div className='reactions-counter'>
207
                {reactionsOptions
209
                {reactionsOptions
208
                  .filter((option) =>
210
                  .filter((option) =>
Línea 213... Línea 215...
213
              </div>
215
              </div>
214
              {!!totalSends && (
216
              {!!totalSends && (
215
                <span>{`${totalSends} ${labels.sends?.toLowerCase()}`}</span>
217
                <span>{`${totalSends} ${labels.sends?.toLowerCase()}`}</span>
216
              )}
218
              )}
217
            </div>
219
            </div>
-
 
220
 
218
            <StyledContainer.Actions>
221
            <StyledContainer.Actions>
219
              <ReactionButton />
222
              <ReactionButton />
220
              <InputOption
223
              <InputOption
221
                icon={ChatOutlinedIcon}
224
                icon={ChatOutlinedIcon}
222
                iconColor='gray'
225
                icGridor='gray'
223
                label={labels.comment}
226
                label={labels.comment}
224
                onClick={displayCommentSection}
227
                onClick={displayCommentSection}
225
              />
228
              />
226
              {!isMobile ? (
229
              {!isMobile ? (
227
                <ExternalShareButton
230
                <ExternalShareButton
Línea 242... Línea 245...
242
                  <SendOutlinedIcon />
245
                  <SendOutlinedIcon />
243
                  {labels.send}
246
                  {labels.send}
244
                </MobileShare>
247
                </MobileShare>
245
              )}
248
              )}
246
            </StyledContainer.Actions>
249
            </StyledContainer.Actions>
-
 
250
 
247
            {showComments && (
251
            {showComments && (
248
              <div className='px-3 pb-2'>
252
              <div className='px-3 pb-2'>
249
                <CommentForm onSubmit={addComment} />
253
                <CommentForm onSubmit={addComment} />
250
                <CommentsList comments={comments} onDelete={deleteComment} />
254
                <CommentsList comments={comments} onDelete={deleteComment} />
251
              </div>
255
              </div>
252
            )}
256
            )}
253
          </StyledContainer>
257
          </StyledContainer>
254
        </Col>
258
        </Grid>
-
 
259
 
255
        <Col md='4'>
260
        <Grid item xs={12} md={4}>
256
          <HomeNews currentPost={post.uuid} />
261
          <HomeNews currentPost={post.uuid} />
257
        </Col>
262
        </Grid>
258
      </Row>
263
      </Grid>
259
    </Container>
264
    </Container>
260
  )
265
  )
261
}
266
}
Línea 262... Línea 267...
262
 
267