Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2896 Rev 2897
Línea 1... Línea 1...
1
import React, { useState, useCallback } from 'react'
1
import React, { useState } from 'react'
2
import { Typography } from '@mui/material'
2
import { Typography } from '@mui/material'
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
import { parse } from '@utils'
4
import { parse } from '@utils'
5
 
5
 
Línea 6... Línea 6...
6
export default function FeedDescription({ description = '' }) {
6
export default function FeedDescription({ description = '' }) {
7
  const [showMore, setShowMore] = useState(false)
7
  const [showMore, setShowMore] = useState(false)
8
 
8
 
9
  const stripText = description.replace(/<p>|<\/p>/g, '')
9
  const stripText = description.replace(/<p>|<\/p>/g, '')
Línea 10... Línea -...
10
  const maxLength = 300
-
 
11
  const truncatedText = stripText.slice(0, maxLength)
10
  const maxLength = 140
12
  const isTruncated = stripText.length > maxLength
-
 
13
 
-
 
Línea 14... Línea 11...
14
  const toggleShowMore = useCallback(
11
  const truncatedText = stripText.slice(0, maxLength)
15
    () => setShowMore((prevState) => !prevState),
12
  const isTruncated = stripText.length > maxLength
16
    []
13