Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3635 Rev 3639
Línea 21... Línea 21...
21
const Profile = (props) => {
21
const Profile = (props) => {
22
  // props destructuring
22
  // props destructuring
23
  const {
23
  const {
24
    image,
24
    image,
25
    name,
25
    name,
-
 
26
	email, 
-
 
27
	network,
26
    status,
28
    status,
27
    link_view,
29
    link_view,
28
    link_edit,
30
    link_edit,
29
    link_delete,
31
    link_delete,
30
    link_cancel,
32
    link_cancel,
Línea 36... Línea 38...
36
    link_unblock,
38
    link_unblock,
37
    link_unfollow,
39
    link_unfollow,
38
    link_approve,
40
    link_approve,
39
    link_leave,
41
    link_leave,
40
    link_admin,
42
    link_admin,
-
 
43
	link_impersonate,
41
    fetchCallback,
44
    fetchCallback,
42
    isTopData = false,
45
    isTopData = false,
43
    btnAcceptTitle = 'Ver perfil',
46
    btnAcceptTitle = 'Ver perfil',
44
    btnCancelTitle = 'Borrar perfil',
47
    btnCancelTitle = 'Borrar perfil',
45
    btnEditTitle = 'Editar perfil'
48
    btnEditTitle = 'Editar perfil'
46
  } = props;
49
  } = props;
Línea -... Línea 50...
-
 
50
 
-
 
51
  const getImpersonateUrl = async (url = '') => {
-
 
52
    try {
-
 
53
      const { data } = await axios.get(url)
-
 
54
      if (data.success) window.location.href = data.data;
-
 
55
    } catch (error) {
-
 
56
      console.log('>>: error > ', error)
-
 
57
    }
-
 
58
  }
47
 
59
 
48
  // states
60
  // states
49
  const [showConfirmationBox, setShowConfirmationBox] = useState(false);
61
  const [showConfirmationBox, setShowConfirmationBox] = useState(false);
50
  const [showCancelConfirmationBox, setShowCancelConfirmationBox] = useState(false);
62
  const [showCancelConfirmationBox, setShowCancelConfirmationBox] = useState(false);
51
  const [showBlockConfirmationBox, setShowBlockConfirmationBox] = useState(false);
63
  const [showBlockConfirmationBox, setShowBlockConfirmationBox] = useState(false);
Línea 142... Línea 154...
142
          className={`${image ? 'col-8 d-flex flex-column align-items-start' : 'col-12'} ${isTopData ? 'justify-content-end' : 'justify-content-center'}`}>
154
          className={`${image ? 'col-8 d-flex flex-column align-items-start' : 'col-12'} ${isTopData ? 'justify-content-end' : 'justify-content-center'}`}>
143
          <h3 className={`${status ? '' : "w-100 text-left"} ${isTopData ? 'mb-2' : ''} w-100`}>
155
          <h3 className={`${status ? '' : "w-100 text-left"} ${isTopData ? 'mb-2' : ''} w-100`}>
144
            {name}
156
            {name}
145
          </h3>
157
          </h3>
146
          {isTopData &&
158
          {isTopData &&
-
 
159
		 {email &&
-
 
160
          <h4 className={`${status ? '' : "w-100 text-left"} ${isTopData ? 'mb-2' : ''} w-100`}>
-
 
161
            {email}
-
 
162
          </h4>
-
 
163
			}
-
 
164
			{network &&
-
 
165
          <h4 className={`${status ? '' : "w-100 text-left"} ${isTopData ? 'mb-2' : ''} w-100`}>
-
 
166
            {network}
-
 
167
          </h4>
-
 
168
			}	
-
 
169
          {
-
 
170
            isTopData
-
 
171
            &&
147
            <ul>
172
            <ul>
148
              {link_view &&
173
              {link_view &&
149
                <li>
174
                <li>
150
                  <a
175
                  <a
151
                    href={link_view}
176
                    href={link_view}
Línea 485... Línea 510...
485
              onAccept={() => handleCancelApply(link_leave)}
510
              onAccept={() => handleCancelApply(link_leave)}
486
            />
511
            />
487
          </div>
512
          </div>
488
        )
513
        )
489
      }
514
      }
-
 
515
        {
-
 
516
          link_impersonate 
-
 
517
          &&
-
 
518
          <li>
-
 
519
            <a
-
 
520
			 href="#" onClick={() => getImpersonateUrl(link_impersonate)} > Personificar </a>
-
 
521
          </li>
-
 
522
        }
490
      {
523
      {
491
        loading &&
524
        loading &&
492
        <StyledSpinnerContainer>
525
        <StyledSpinnerContainer>
493
          <Spinner />
526
          <Spinner />
494
        </StyledSpinnerContainer>
527
        </StyledSpinnerContainer>