Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4820 Rev 4821
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, { useEffect, 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
 
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 = () => {
-
 
39
        setShowComments(!showComments)
-
 
40
    }
38
    const displayCommentSection = () => {
41
 
39
        setShowComments(!showComments)
42
    const getComments = async () => {
40
        axios.get(post.comments_url)
43
        await axios.get(post.comments_url)
41
            .then(({ data: response }) => {
44
            .then(({ data: response }) => {
42
                if (!response.success) {
45
                if (!response.success) {
43
                    addNotification({ style: 'danger', msg: response.data })
46
                    addNotification({ style: 'danger', msg: response.data })
Línea 84... Línea 87...
84
            )
87
            )
85
        }
88
        }
86
        return <p>{fullText}</p>
89
        return <p>{fullText}</p>
87
    }
90
    }
Línea -... Línea 91...
-
 
91
 
-
 
92
    useEffect(() => {
-
 
93
        if (showComments && !comments.length) getComments()
-
 
94
    }, [showComments])
88
 
95
 
89
    return (
96
    return (
90
        <div className="container">
97
        <div className="container">
91
            <div className="d-flex flex-column flex-md-row" style={{ gap: '1rem' }}>
98
            <div className="d-flex flex-column flex-md-row" style={{ gap: '1rem' }}>
92
                <div className="col-12 col-md-8 p-0">
99
                <div className="col-12 col-md-8 p-0">