Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 517 Rev 2296
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState } from 'react'
2
import { axios } from '../utils'
2
import { Link } from 'react-router-dom'
3
import { addNotification } from '../redux/notification/notification.actions'
-
 
4
import { useDispatch, useSelector } from 'react-redux'
3
import { useDispatch, useSelector } from 'react-redux'
5
import { Facebook, Instagram, Twitter } from '@mui/icons-material'
4
import { Facebook, Instagram, Twitter } from '@mui/icons-material'
-
 
5
 
-
 
6
import { axios } from '../utils'
-
 
7
import { addNotification } from '../redux/notification/notification.actions'
-
 
8
 
6
import ConfirmModal from '../../shared/confirm-modal/ConfirmModal'
9
import ConfirmModal from '../../shared/confirm-modal/ConfirmModal'
7
import SocialNetworks from '../../shared/social-networks/SocialNetwors'
10
import SocialNetworks from '../../shared/social-networks/SocialNetwors'
8
import { Link } from 'react-router-dom'
-
 
Línea 9... Línea 11...
9
 
11
 
10
const ProfileInfo = ({
12
const ProfileInfo = ({
11
  id,
13
  id,
12
  image,
14
  image,
Línea 18... Línea 20...
18
  showContact,
20
  showContact,
19
  fullName,
21
  fullName,
20
  linkInmail,
22
  linkInmail,
21
  connectUrl,
23
  connectUrl,
22
  cancelUrl,
24
  cancelUrl,
23
  isEdit,
25
  isEdit
24
}) => {
26
}) => {
25
  const [isAdded, setIsAdded] = useState(!connectUrl)
27
  const [isAdded, setIsAdded] = useState(!connectUrl)
26
  const [connectionUrl, setConnectionUrl] = useState(connectUrl || cancelUrl)
28
  const [connectionUrl, setConnectionUrl] = useState(connectUrl || cancelUrl)
27
  const [showConfirmModal, setShowConfirmModal] = useState(false)
29
  const [showConfirmModal, setShowConfirmModal] = useState(false)
28
  const labels = useSelector(({ intl }) => intl.labels)
30
  const labels = useSelector(({ intl }) => intl.labels)
Línea 55... Línea 57...
55
    setShowConfirmModal(!showConfirmModal)
57
    setShowConfirmModal(!showConfirmModal)
56
  }
58
  }
Línea 57... Línea 59...
57
 
59
 
58
  return (
60
  return (
59
    <>
61
    <>
60
      <div className="profile-info">
62
      <div className='profile-info'>
61
        <img id="user-profile-img" src={image} alt="profile-image" />
63
        <img id='user-profile-img' src={image} alt='profile-image' />
62
        <h3>{fullName}</h3>
64
        <h3>{fullName}</h3>
63
        <div className="row">
65
        <div className='row'>
64
          {facebook && (
66
          {facebook && (
65
            <a href={facebook} target="_blank" rel="noreferrer">
67
            <a href={facebook} target='_blank' rel='noreferrer'>
66
              <Facebook />
68
              <Facebook />
67
            </a>
69
            </a>
68
          )}
70
          )}
69
          {twitter && (
71
          {twitter && (
70
            <a href={twitter} target="_blank" rel="noreferrer">
72
            <a href={twitter} target='_blank' rel='noreferrer'>
71
              <Twitter />
73
              <Twitter />
72
            </a>
74
            </a>
73
          )}
75
          )}
74
          {instagram && (
76
          {instagram && (
75
            <a href={instagram} target="_blank" rel="noreferrer">
77
            <a href={instagram} target='_blank' rel='noreferrer'>
76
              <Instagram />
78
              <Instagram />
77
            </a>
79
            </a>
78
          )}
80
          )}
79
        </div>
81
        </div>
80
        <div className="row">
82
        <div className='row'>
81
          {following && (
83
          {following && (
82
            <span>
84
            <span>
83
              <b>{following}</b>
85
              <b>{following}</b>
84
              <br />
86
              <br />
Línea 91... Línea 93...
91
              <br />
93
              <br />
92
              Seguidores
94
              Seguidores
93
            </span>
95
            </span>
94
          )}
96
          )}
95
        </div>
97
        </div>
96
        <div className="row ">
98
        <div className='row '>
97
          {showContact && (
99
          {showContact && (
98
            <>
100
            <>
99
              <button
101
              <button
100
                className={`btn btn-${isAdded ? 'secondary' : 'primary'}`}
102
                className={`btn btn-${isAdded ? 'secondary' : 'primary'}`}
101
                onClick={() =>
103
                onClick={() =>
102
                  isAdded ? toggleConfirmationModal() : connect()
104
                  isAdded ? toggleConfirmationModal() : connect()
103
                }
105
                }
104
              >
106
              >
105
                {isAdded ? labels.cancel : labels.add}
107
                {isAdded ? labels.cancel : labels.add}
106
              </button>
108
              </button>
107
              <Link to={linkInmail} className="btn btn-tertiary">
109
              <Link to={linkInmail} className='btn btn-tertiary'>
108
                {labels.message}
110
                {labels.message}
109
              </Link>
111
              </Link>
110
            </>
112
            </>
111
          )}
113
          )}
112
        </div>
114
        </div>
113
        {isEdit && (
115
        {isEdit && (
114
          <SocialNetworks
116
          <SocialNetworks
115
            type="profile"
117
            type='profile'
116
            profileId={id}
118
            profileId={id}
117
            facebook={facebook}
119
            facebook={facebook}
118
            instagram={instagram}
120
            instagram={instagram}
119
            twitter={twitter}
121
            twitter={twitter}
120
          />
122
          />