Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2911 Rev 2912
Línea 1... Línea 1...
1
import React, { useState, useEffect } from 'react'
1
import React, { useState, useEffect } from 'react'
2
import { Link, useLocation } from 'react-router-dom'
2
import { Link, useLocation } from 'react-router-dom'
3
import { useDispatch, useSelector } from 'react-redux'
3
import { useDispatch, useSelector } from 'react-redux'
4
import { Button, IconButton, Typography } from '@mui/material'
4
import { Button, Typography } from '@mui/material'
5
import { Edit } from '@mui/icons-material'
-
 
Línea 6... Línea 5...
6
 
5
 
7
import { axios, parse } from '@utils'
6
import { axios, parse } from '@utils'
Línea 8... Línea 7...
8
import { addNotification } from '@store/notification/notification.actions'
7
import { addNotification } from '@store/notification/notification.actions'
Línea 44... Línea 43...
44
  const [isEdit, setIsEdit] = useState(false)
43
  const [isEdit, setIsEdit] = useState(false)
45
  const labels = useSelector(({ intl }) => intl.labels)
44
  const labels = useSelector(({ intl }) => intl.labels)
46
  const { pathname } = useLocation()
45
  const { pathname } = useLocation()
47
  const dispatch = useDispatch()
46
  const dispatch = useDispatch()
Línea 48... Línea -...
48
 
-
 
49
  const showConnections = totalConnections && viewTotalConnections
-
 
50
  const showFollowing = following && viewFollowing
-
 
51
 
47
 
52
  const displayModal = () => {
48
  const displayModal = () => {
53
    setIsModalShow(!isModalShow)
49
    setIsModalShow(!isModalShow)
Línea 54... Línea 50...
54
  }
50
  }
Línea 107... Línea 103...
107
    setIsEdit(pathname.includes('edit'))
103
    setIsEdit(pathname.includes('edit'))
108
  }, [pathname])
104
  }, [pathname])
Línea 109... Línea 105...
109
 
105
 
110
  return (
106
  return (
111
    <Widget>
-
 
112
      <Cover
107
    <Widget>
113
        cover={cover}
-
 
114
        sizes={sizes?.cover}
-
 
115
        edit={isEdit}
-
 
116
        editUrl={`/profile/my-profiles/cover/${userProfileId}/operation/upload`}
-
 
117
      />
108
      <Cover cover={cover} />
118
      <Widget.Body>
109
      <Widget.Body>
119
        <Avatar
110
        <Avatar
120
          src={image}
111
          src={image}
121
          alt={fullName}
112
          alt={fullName}
Línea 139... Línea 130...
139
            {labels.personal_info}
130
            {labels.personal_info}
140
          </Typography>
131
          </Typography>
141
        </Row>
132
        </Row>
Línea 142... Línea 133...
142
 
133
 
143
        <Row>
134
        <Row>
144
          {showConnections && (
135
          {viewTotalConnections ? (
145
            <Link to='/connection/my-connections'>
136
            <Link to='/connection/my-connections'>
146
              <Typography variant='body2'>
137
              <Typography variant='body2'>
147
                {`${totalConnections} ${labels.connections}`}
138
                {`${totalConnections} ${labels.connections}`}
148
              </Typography>
139
              </Typography>
149
            </Link>
140
            </Link>
150
          )}
141
          ) : null}
151
          {showFollowing && (
142
          {viewFollowing ? (
152
            <Link onClick={(e) => e.preventDefault()}>
143
            <Link onClick={(e) => e.preventDefault()}>
153
              <Typography variant='body2'>
144
              <Typography variant='body2'>
154
                {`${following} ${labels.following}`}
145
                {`${following} ${labels.following}`}
155
              </Typography>
146
              </Typography>
156
            </Link>
147
            </Link>
157
          )}
148
          ) : null}
Línea 158... Línea 149...
158
        </Row>
149
        </Row>
159
 
150
 
160
        <Row>
151
        <Row>