Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6831 Rev 6873
Línea 8... Línea 8...
8
 
8
 
9
import ImageModal from '../../modals/ImageModal'
9
import ImageModal from '../../modals/ImageModal'
10
import CoverModal from '../../cover/CoverModal'
10
import CoverModal from '../../cover/CoverModal'
11
import OverviewModal from '../../overview/OverviewModal'
11
import OverviewModal from '../../overview/OverviewModal'
-
 
12
import ConfirmModal from '../../modals/ConfirmModal'
Línea 12... Línea 13...
12
import ConfirmModal from '../../modals/ConfirmModal'
13
import { useLocation } from 'react-router-dom'
13
 
14
 
14
const ProfileCard = ({
15
const ProfileCard = ({
15
  full_name: fullName = '',
16
  full_name: fullName = '',
Línea 38... Línea 39...
38
  const [modalToShow, setModalToShow] = useState(null)
39
  const [modalToShow, setModalToShow] = useState(null)
39
  const [settedOverview, setSettedOverview] = useState('')
40
  const [settedOverview, setSettedOverview] = useState('')
40
  const [profileImg, setProfileImg] = useState('')
41
  const [profileImg, setProfileImg] = useState('')
41
  const [coverImg, setCoverImg] = useState('')
42
  const [coverImg, setCoverImg] = useState('')
42
  const [isModalShow, setIsModalShow] = useState(false)
43
  const [isModalShow, setIsModalShow] = useState(false)
-
 
44
  const [isEdit, setIsEdit] = useState(false)
43
  const labels = useSelector(({ intl }) => intl.labels)
45
  const labels = useSelector(({ intl }) => intl.labels)
-
 
46
  const { pathname } = useLocation()
44
  const dispatch = useDispatch()
47
  const dispatch = useDispatch()
Línea 45... Línea -...
45
 
-
 
46
  const PATH = window.location.pathname
-
 
47
 
48
 
48
  const displayModal = () => {
49
  const displayModal = () => {
49
    setIsModalShow(!isModalShow)
50
    setIsModalShow(!isModalShow)
Línea 50... Línea 51...
50
  }
51
  }
Línea 101... Línea 102...
101
    } else {
102
    } else {
102
      setConnectionUrl(RequestConnectionUrl || CancelConnectionUrl)
103
      setConnectionUrl(RequestConnectionUrl || CancelConnectionUrl)
103
    }
104
    }
104
  }, [RequestConnectionUrl, CancelConnectionUrl, overview, image, cover])
105
  }, [RequestConnectionUrl, CancelConnectionUrl, overview, image, cover])
Línea -... Línea 106...
-
 
106
 
-
 
107
  useEffect(() => {
-
 
108
    setIsEdit(pathname.includes('edit'))
-
 
109
  }, [pathname])
105
 
110
 
106
  return (
111
  return (
107
    <>
112
    <>
108
      <section className="profile__user-card">
113
      <section className="profile__user-card">
109
        <div className="cover__image-container">
114
        <div className="cover__image-container">
110
          <img alt="Background Image" src={coverImg} />
115
          <img alt="Background Image" src={coverImg} />
111
          {PATH.includes('edit') && (
116
          {isEdit && (
112
            <button
117
            <button
113
              className="button-icon cover__edit-btn"
118
              className="button-icon cover__edit-btn"
114
              onClick={() => setModalToShow('cover')}
119
              onClick={() => setModalToShow('cover')}
115
            >
120
            >
Línea 119... Línea 124...
119
        </div>
124
        </div>
120
        <section className="px-4 pb-4">
125
        <section className="px-4 pb-4">
121
          <div className="card__image-options">
126
          <div className="card__image-options">
122
            <img
127
            <img
123
              alt="Profile Image"
128
              alt="Profile Image"
124
              className={`img ${PATH.includes('edit') && 'cursor-pointer'}`}
129
              className={`img ${isEdit && 'cursor-pointer'}`}
125
              src={profileImg}
130
              src={profileImg}
126
              onClick={() => PATH.includes('edit') && setModalToShow('image')}
131
              onClick={() => isEdit && setModalToShow('image')}
127
            />
132
            />
128
            {PATH.includes('edit') && (
133
            {isEdit && (
129
              <button
134
              <button
130
                className="button-icon"
135
                className="button-icon"
131
                onClick={() => setModalToShow('overview')}
136
                onClick={() => setModalToShow('overview')}
132
              >
137
              >
133
                <EditIcon />
138
                <EditIcon />