Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6800 Rev 6801
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState, useEffect } from 'react'
2
import parse from 'html-react-parser'
2
import parse from 'html-react-parser'
3
import { Modal } from 'react-bootstrap'
3
import { Modal } from 'react-bootstrap'
4
import { axios } from '../../../utils'
4
import { axios } from '../../../utils'
5
import { useDispatch, useSelector } from 'react-redux'
5
import { useDispatch, useSelector } from 'react-redux'
6
import { addNotification } from '../../../redux/notification/notification.actions'
6
import { addNotification } from '../../../redux/notification/notification.actions'
Línea 31... Línea 31...
31
  instagram,
31
  instagram,
32
  sizes,
32
  sizes,
33
  view_following,
33
  view_following,
34
  view_total_connections,
34
  view_total_connections,
35
}) => {
35
}) => {
36
  const [isAdded, setIsAdded] = useState(!RequestConnectionUrl)
36
  const [isAdded, setIsAdded] = useState(false)
37
  const [connectionUrl, setConnectionUrl] = useState(
37
  const [connectionUrl, setConnectionUrl] = useState('')
-
 
38
  const [modalToShow, setModalToShow] = useState(null)
-
 
39
  const [settedOverview, setSettedOverview] = useState('')
-
 
40
  const [profileImg, setProfileImg] = useState('')
38
    RequestConnectionUrl || CancelConnectionUrl
41
  const [coverImg, setCoverImg] = useState('')
39
  )
-
 
40
  const [isModalShow, setIsModalShow] = useState(false)
42
  const [isModalShow, setIsModalShow] = useState(false)
41
  const labels = useSelector(({ intl }) => intl.labels)
43
  const labels = useSelector(({ intl }) => intl.labels)
42
  const dispatch = useDispatch()
44
  const dispatch = useDispatch()
Línea 43... Línea 45...
43
 
45
 
Línea 44... Línea -...
44
  const PATH = window.location.pathname
-
 
45
 
-
 
46
  // modals state
-
 
47
  const [modalToShow, setModalToShow] = useState(null)
-
 
48
  const [settedOverview, setSettedOverview] = useState(overview)
-
 
49
  const [profileImg, setProfileImg] = useState(image)
-
 
50
  const [coverImg, setCoverImg] = useState(cover)
46
  const PATH = window.location.pathname
Línea 51... Línea 47...
51
 
47
 
52
  const displayModal = () => setIsModalShow(!isModalShow)
48
  const displayModal = () => setIsModalShow(!isModalShow)
53
 
49
 
Línea 90... Línea 86...
90
    }
86
    }
91
  }
87
  }
Línea 92... Línea 88...
92
 
88
 
Línea -... Línea 89...
-
 
89
  const closeModal = () => setModalToShow(null)
-
 
90
 
-
 
91
  useEffect(() => {
-
 
92
    setIsAdded(!RequestConnectionUrl)
-
 
93
    setConnectionUrl(RequestConnectionUrl || CancelConnectionUrl)
-
 
94
    setSettedOverview(overview)
-
 
95
    setProfileImg(image)
-
 
96
    setCoverImg(cover)
93
  const closeModal = () => setModalToShow(null)
97
  }, [RequestConnectionUrl, CancelConnectionUrl, overview, image, cover])
94
 
98
 
95
  return (
99
  return (
96
    <>
100
    <>
97
      <section className="profile__user-card">
101
      <section className="profile__user-card">