Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4818 Rev 4819
Línea 34... Línea 34...
34
    const [showComments, setShowComments] = useState(false)
34
    const [showComments, setShowComments] = useState(false)
Línea 35... Línea 35...
35
 
35
 
Línea 36... Línea 36...
36
    const readMoreHandler = () => setIsReadMoreActive(!isReadMoreActive)
36
    const readMoreHandler = () => setIsReadMoreActive(!isReadMoreActive)
-
 
37
 
37
 
38
    const displayCommentSection = () => {
38
    const displayCommentSection = () => {
39
        setShowComments(!showComments)
39
        axios.get(post.comments_url)
40
        axios.get(post.comments_url)
40
            .then(({ data: response }) => {
41
            .then(({ data: response }) => {
41
                if (!response.success) {
42
                if (!response.success) {
Línea 48... Línea 49...
48
    }
49
    }
Línea 49... Línea 50...
49
 
50
 
50
    const ExternalShareButton = withExternalShare(InputOption, post.share_external_url, {
51
    const ExternalShareButton = withExternalShare(InputOption, post.share_external_url, {
51
        Icon: SendOutlinedIcon,
52
        Icon: SendOutlinedIcon,
52
        color: 'gray',
53
        color: 'gray',
53
        title: 'Send',
54
        title: 'Enviar',
54
        shareUrl: post.share_increment_external_counter_url,
55
        shareUrl: post.share_increment_external_counter_url,
55
        setValue: handleExternalShare
56
        setValue: handleExternalShare
Línea 56... Línea 57...
56
    })
57
    })
Línea 83... Línea 84...
83
            )
84
            )
84
        }
85
        }
85
        return <p>{fullText}</p>
86
        return <p>{fullText}</p>
86
    }
87
    }
Línea 87... Línea -...
87
 
-
 
88
    useEffect(() => {
-
 
89
        if (comments.length > 0) setShowComments(!showComments)
-
 
90
    }, [comments])
-
 
91
 
-
 
92
 
88
 
93
    return (
89
    return (
94
        <div className="container">
90
        <div className="container">
95
            <div className="d-flex flex-column flex-md-row" style={{ gap: '1rem' }}>
91
            <div className="d-flex flex-column flex-md-row" style={{ gap: '1rem' }}>
96
                <div className="col-12 col-md-8 p-0">
92
                <div className="col-12 col-md-8 p-0">
Línea 108... Línea 104...
108
                                    </div>
104
                                    </div>
109
                                </div>
105
                                </div>
110
                            </div>
106
                            </div>
111
                            {post.description && htmlParsedText(post.description)}
107
                            {post.description && htmlParsedText(post.description)}
112
                        </div>
108
                        </div>
113
                        <div className="px-3 d-flex align-items-center justify-content-between" style={{ gap: '5px' }}>
109
                        <div className="px-3 d-flex align-items-center justify-content-end" style={{ gap: '5px' }}>
114
                            {!!externalShare && <span>{`${externalShare} enviados`}</span>}
110
                            {!!externalShare && <span>{`${externalShare} enviados`}</span>}
115
                        </div>
111
                        </div>
116
                        <div className='feed__buttons'>
112
                        <div className='feed__buttons'>
117
                            <InputOption
113
                            <InputOption
118
                                Icon={isLiked ? ThumbUpAltIcon : ThumbUpAltOutlinedIcon}
114
                                Icon={isLiked ? ThumbUpAltIcon : ThumbUpAltOutlinedIcon}
119
                                title='Like'
115
                                title={isLiked ? 'Ya no me gusta' : 'Me gusta'}
120
                                color={isLiked ? '#7405f9' : 'gray'}
116
                                color={isLiked ? '#7405f9' : 'gray'}
121
                                onClick={() => handleLike(isLiked ? post.unlike_url : post.like_url)}
117
                                onClick={() => handleLike(isLiked ? post.unlike_url : post.like_url)}
122
                            />
118
                            />
123
                            <InputOption
119
                            <InputOption
124
                                Icon={ChatOutlinedIcon}
120
                                Icon={ChatOutlinedIcon}
125
                                title='Comment'
121
                                title='Comentarios'
126
                                color='gray'
122
                                color='gray'
127
                                onClick={displayCommentSection}
123
                                onClick={displayCommentSection}
128
                            />
124
                            />
129
                            <ExternalShareButton />
125
                            <ExternalShareButton />
130
                        </div>
126
                        </div>