Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4816 Rev 4817
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React, { useState } from 'react'
2
import React, { useState } from 'react'
3
import { axios } from '../../utils';
3
import { axios } from '../../utils'
4
import { addNotification } from '../../redux/notification/notification.actions';
4
import { addNotification } from '../../redux/notification/notification.actions'
5
import parse from 'html-react-parser'
5
import parse from 'html-react-parser'
Línea 6... Línea 6...
6
 
6
 
7
// Components
7
// Components
8
import HomeNews from '../components/home-section/HomeNews';
8
import HomeNews from '../components/home-section/HomeNews'
9
import InputOption from '../templates/linkedin/Feed/InputOption';
9
import InputOption from '../templates/linkedin/Feed/InputOption'
Línea 10... Línea 10...
10
import withExternalShare from '../templates/linkedin/Feed/withExternalShare';
10
import withExternalShare from '../templates/linkedin/Feed/withExternalShare'
11
 
11
 
12
// Icons
12
// Icons
13
import ThumbUpAltOutlinedIcon from '@mui/icons-material/ThumbUpAltOutlined'
13
import ThumbUpAltOutlinedIcon from '@mui/icons-material/ThumbUpAltOutlined'
14
import ThumbUpAltIcon from '@mui/icons-material/ThumbUpAlt'
14
import ThumbUpAltIcon from '@mui/icons-material/ThumbUpAlt'
15
import ChatOutlinedIcon from '@mui/icons-material/ChatOutlined'
15
import ChatOutlinedIcon from '@mui/icons-material/ChatOutlined'
-
 
16
import SendOutlinedIcon from '@mui/icons-material/SendOutlined'
-
 
17
import AccessTimeIcon from '@mui/icons-material/AccessTime'
-
 
18
 
Línea 16... Línea 19...
16
import SendOutlinedIcon from '@mui/icons-material/SendOutlined'
19
// Styles
17
import AccessTimeIcon from '@mui/icons-material/AccessTime';
20
import '../templates/linkedin/Feed/Feed.scss'
18
 
21
 
19
export default function PostView({ post = {
22
export default function PostView({ post = {
Línea 50... Línea 53...
50
            .then(({ data: response }) => {
53
            .then(({ data: response }) => {
51
                if (!response.success) {
54
                if (!response.success) {
52
                    addNotification({ style: "danger", msg: response.data })
55
                    addNotification({ style: "danger", msg: response.data })
53
                    return
56
                    return
54
                }
57
                }
55
                setIsLiked(!isLiked);
58
                setIsLiked(!isLiked)
56
            });
59
            })
57
    }
60
    }
Línea 58... Línea 61...
58
 
61
 
59
    const htmlParsedText = (fullStringText) => {
62
    const htmlParsedText = (fullStringText) => {
60
        const fullText = parse(fullStringText)
63
        const fullText = parse(fullStringText)
61
        if (fullStringText.length > 500) {
64
        if (fullStringText.length > 500) {
62
            const shortenedString = fullStringText.substr(0, 500);
65
            const shortenedString = fullStringText.substr(0, 500)
63
            const shortenedText = parse(`${shortenedString}... `);
66
            const shortenedText = parse(`${shortenedString}... `)
64
            return (
67
            return (
65
                <>
68
                <>
66
                    {isReadMoreActive ? fullText : shortenedText}
69
                    {isReadMoreActive ? fullText : shortenedText}
67
                    <span className='cursor-pointer' onClick={readMoreHandler}>
70
                    <span className='cursor-pointer' onClick={readMoreHandler}>
68
                        {isReadMoreActive ? " Leer menos" : " Leer más"}
71
                        {isReadMoreActive ? " Leer menos" : " Leer más"}
69
                    </span>
72
                    </span>
70
                </>
73
                </>
71
            );
74
            )
72
        }
75
        }
73
        return <p>{fullText}</p>
76
        return <p>{fullText}</p>
Línea 74... Línea 77...
74
    }
77
    }