Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 5 Rev 703
Línea 4... Línea 4...
4
import IconButton from '@mui/material/IconButton'
4
import IconButton from '@mui/material/IconButton'
5
import EditIcon from '@mui/icons-material/Edit'
5
import EditIcon from '@mui/icons-material/Edit'
Línea 6... Línea 6...
6
 
6
 
7
import OverviewModal from './OverviewModal'
7
import OverviewModal from './OverviewModal'
-
 
8
import EmptySection from '../UI/EmptySection'
Línea 8... Línea 9...
8
import EmptySection from '../UI/EmptySection'
9
import Paraphrase from '../UI/Paraphrase'
9
 
10
 
10
const Overview = ({ overview: defaultValue, id, isEdit }) => {
11
const Overview = ({ overview: defaultValue, id, isEdit }) => {
11
  const [overview, setOverview] = useState('')
12
  const [overview, setOverview] = useState(defaultValue)
Línea 12... Línea 13...
12
  const [isModalOpen, setIsModalOpen] = useState(false)
13
  const [isModalOpen, setIsModalOpen] = useState(false)
13
  const labels = useSelector(({ intl }) => intl.labels)
14
  const labels = useSelector(({ intl }) => intl.labels)
14
 
15
 
Línea 15... Línea -...
15
  const toggleModal = () => {
-
 
16
    setIsModalOpen(!isModalOpen)
-
 
17
  }
-
 
18
 
-
 
19
  useEffect(() => {
16
  const toggleModal = () => {
20
    setOverview(defaultValue)
17
    setIsModalOpen(!isModalOpen)
21
  }, [defaultValue])
18
  }
22
 
19
 
23
  return (
20
  return (
24
    <>
21
    <>
25
      <div className="profile-attr">
22
      <div className='profile-attr'>
26
        <div className="profile-attr-header">
23
        <div className='profile-attr-header'>
27
          <h2>Visión general</h2>
24
          <h2>Visión general</h2>
28
          {isEdit && (
25
          {isEdit && (
29
            <IconButton onClick={toggleModal}>
26
            <IconButton onClick={toggleModal}>
30
              <EditIcon />
27
              <EditIcon />
31
            </IconButton>
28
            </IconButton>
32
          )}
29
          )}
33
        </div>
30
        </div>
34
        {overview ? (
31
        {overview ? (
35
          parse(overview)
32
          <Paraphrase>{overview}</Paraphrase>
36
        ) : (
33
        ) : (
37
          <EmptySection align="left" message={labels.empty} />
34
          <EmptySection align='left' message={labels.empty} />
38
        )}
35
        )}