Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3816 Rev 5070
Línea -... Línea 1...
-
 
1
/* eslint-disable camelcase */
1
/* eslint-disable react/prop-types */
2
/* eslint-disable react/prop-types */
2
import React, { useState } from "react";
3
import React, { useState } from 'react'
3
import { addNotification } from "../redux/notification/notification.actions";
4
import { addNotification } from '../redux/notification/notification.actions'
4
import ConfirmationBox from "../shared/confirmation-box/ConfirmationBox";
5
import ConfirmationBox from '../shared/confirmation-box/ConfirmationBox'
5
import Spinner from "../shared/loading-spinner/Spinner";
6
import Spinner from '../shared/loading-spinner/Spinner'
6
import { axios } from "../utils";
7
import { axios } from '../utils'
7
import styled from 'styled-components'
8
import styled from 'styled-components'
Línea 8... Línea 9...
8
 
9
 
9
const StyledSpinnerContainer = styled.div`
10
const StyledSpinnerContainer = styled.div`
10
  position: absolute;
11
  position: absolute;
Línea 15... Línea 16...
15
  background: rgba(255, 255, 255, 0.4);
16
  background: rgba(255, 255, 255, 0.4);
16
  display: flex;
17
  display: flex;
17
  justify-content: center;
18
  justify-content: center;
18
  align-items: center;
19
  align-items: center;
19
  z-index: 300;
20
  z-index: 300;
20
`;
21
`
21
const Profile = (props) => {
22
const Profile = ({
22
  // props destructuring
-
 
23
  const {
-
 
24
    image,
23
  image,
25
    name,
24
  name,
26
    email,
25
  email,
27
    network,
26
  network,
28
    status,
27
  status,
29
    link_view,
28
  link_view,
30
    link_edit,
29
  link_edit,
31
    link_delete,
30
  link_delete,
32
    link_cancel,
31
  link_cancel,
33
    link_block,
32
  link_block,
34
    link_reject,
33
  link_reject,
35
    link_accept,
34
  link_accept,
36
    link_inmail,
35
  link_inmail,
37
    link_request,
36
  link_request,
38
    link_unblock,
37
  link_unblock,
39
    link_unfollow,
38
  link_unfollow,
40
    link_approve,
39
  link_approve,
41
    link_leave,
40
  link_leave,
42
    link_admin,
41
  link_admin,
43
    link_impersonate,
42
  link_impersonate,
44
    fetchCallback,
43
  fetchCallback,
45
    isTopData = false,
44
  isTopData = false,
46
    btnAcceptTitle = 'Ver perfil',
45
  btnAcceptTitle = 'Ver perfil',
47
    btnCancelTitle = 'Borrar perfil',
46
  btnCancelTitle = 'Borrar perfil',
48
    btnEditTitle = 'Editar perfil'
47
  btnEditTitle = 'Editar perfil'
49
  } = props;
-
 
50
 
-
 
51
  const getImpersonateUrl = async (url = '') => {
-
 
52
    try {
48
}) => {
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
  }
-
 
59
 
-
 
60
  // states
-
 
61
  const [showConfirmationBox, setShowConfirmationBox] = useState(false);
49
  const [showConfirmationBox, setShowConfirmationBox] = useState(false)
62
  const [showCancelConfirmationBox, setShowCancelConfirmationBox] = useState(false);
50
  const [showCancelConfirmationBox, setShowCancelConfirmationBox] = useState(false)
63
  const [showBlockConfirmationBox, setShowBlockConfirmationBox] = useState(false);
51
  const [showBlockConfirmationBox, setShowBlockConfirmationBox] = useState(false)
64
  const [showRejectConfirmationBox, setShowRejectConfirmationBox] = useState(false);
52
  const [showRejectConfirmationBox, setShowRejectConfirmationBox] = useState(false)
65
  const [showApproveConfirmationBox, setShowApproveConfirmationBox] = useState(false);
53
  const [showApproveConfirmationBox, setShowApproveConfirmationBox] = useState(false)
66
  const [showRequestConfirmationBox, setShowRequestConfirmationBox] = useState(false);
54
  const [showRequestConfirmationBox, setShowRequestConfirmationBox] = useState(false)
67
  const [showUnblockConfirmationBox, setShowUnblockConfirmationBox] = useState(false);
55
  const [showUnblockConfirmationBox, setShowUnblockConfirmationBox] = useState(false)
68
  const [showLeaveConfirmationBox, setShowLeaveConfirmationBox] = useState(false);
56
  const [showLeaveConfirmationBox, setShowLeaveConfirmationBox] = useState(false)
69
 
-
 
70
  const [loading, setLoading] = useState(false)
57
  const [loading, setLoading] = useState(false)
-
 
58
 
71
  const handleShowConfirmationBox = (show = !showConfirmationBox) => {
59
  const handleShowConfirmationBox = (show = !showConfirmationBox) => {
72
    setShowConfirmationBox(show);
60
    setShowConfirmationBox(show)
73
  };
61
  }
74
  const handleCancelConfirmationBox = (show = !showConfirmationBox) => {
62
  const handleCancelConfirmationBox = (show = !showConfirmationBox) => {
75
    setShowCancelConfirmationBox(show);
63
    setShowCancelConfirmationBox(show)
76
  };
64
  }
77
  const handleBlockConfirmationBox = (show = !showConfirmationBox) => {
65
  const handleBlockConfirmationBox = (show = !showConfirmationBox) => {
78
    setShowBlockConfirmationBox(show);
66
    setShowBlockConfirmationBox(show)
79
  };
67
  }
80
  const handleRejectConfirmationBox = (show = !showConfirmationBox) => {
68
  const handleRejectConfirmationBox = (show = !showConfirmationBox) => {
81
    setShowRejectConfirmationBox(show);
69
    setShowRejectConfirmationBox(show)
82
  };
70
  }
83
  const handleApproveConfirmationBox = (show = !showConfirmationBox) => {
71
  const handleApproveConfirmationBox = (show = !showConfirmationBox) => {
84
    setShowApproveConfirmationBox(show);
72
    setShowApproveConfirmationBox(show)
85
  };
73
  }
86
  const handleRequestConfirmationBox = (show = !showConfirmationBox) => {
74
  const handleRequestConfirmationBox = (show = !showConfirmationBox) => {
87
    setShowRequestConfirmationBox(show);
75
    setShowRequestConfirmationBox(show)
88
  };
76
  }
89
  const handleUnblockConfirmationBox = (show = !showConfirmationBox) => {
77
  const handleUnblockConfirmationBox = (show = !showConfirmationBox) => {
90
    setShowUnblockConfirmationBox(show);
78
    setShowUnblockConfirmationBox(show)
91
  };
79
  }
92
  const handleLeaveConfirmationBox = (show = !showConfirmationBox) => {
80
  const handleLeaveConfirmationBox = (show = !showConfirmationBox) => {
93
    setShowLeaveConfirmationBox(show);
81
    setShowLeaveConfirmationBox(show)
-
 
82
  }
-
 
83
 
-
 
84
  const getImpersonateUrl = async (url = '') => {
-
 
85
    try {
-
 
86
      const { data } = await axios.get(url)
-
 
87
      if (data.success) window.location.href = data.data
-
 
88
    } catch (error) {
-
 
89
      console.log('>>: error > ', error)
-
 
90
    }
94
  };
91
  }
Línea 95... Línea 92...
95
 
92
 
96
  const handleCancelApply = (url = link_delete) => {
93
  const handleCancelApply = (url = link_delete) => {
97
    setLoading(true);
94
    setLoading(true)
98
    axios.post(url)
95
    axios.post(url)
99
      .then(({ data }) => {
96
      .then(({ data }) => {
100
        if (!data.success) {
97
        if (!data.success) {
101
          const errorMsg =
98
          const errorMsg =
102
            typeof data.data === "string"
99
            typeof data.data === 'string'
103
              ? data.data
100
              ? data.data
104
              : "Ha ocurrido un error, Por favor intente más tarde";
101
              : 'Ha ocurrido un error, Por favor intente más tarde'
105
          addNotification({
102
          addNotification({
106
            style: "danger",
103
            style: 'danger',
107
            msg: errorMsg,
104
            msg: errorMsg
108
          });
105
          })
109
        }
106
        }
110
        const msg = data.data;
107
        const msg = data.data
111
        addNotification({
108
        addNotification({
112
          style: "success",
109
          style: 'success',
113
          msg: msg,
110
          msg
114
        });
111
        })
115
        if (fetchCallback) fetchCallback();
112
        if (fetchCallback) fetchCallback()
116
      })
113
      })
117
      .catch((error) => console.log('>>: error > ', error))
114
      .catch((error) => console.log('>>: error > ', error))
118
      .finally(() => setLoading(false))
115
      .finally(() => setLoading(false))
Línea 119... Línea 116...
119
  };
116
  }
120
 
117
 
121
  const handleUnfollow = async (link_unfollow) => {
118
  const handleUnfollow = async (link_unfollow) => {
122
    setLoading(true);
119
    setLoading(true)
123
    await axios.post(link_unfollow)
120
    await axios.post(link_unfollow)
Línea 124... Línea 121...
124
      .then(({ data }) => {
121
      .then(({ data }) => {
125
        if (data.success) fetchCallback()
122
        if (data.success) fetchCallback()
126
 
123
 
127
        typeof data.data === 'string' &&
124
        typeof data.data === 'string' &&
128
          addNotification({
125
          addNotification({
129
            style: "danger",
126
            style: 'danger',
130
            msg: data.data
127
            msg: data.data
131
          })
128
          })
Línea 132... Línea 129...
132
      })
129
      })
133
    setLoading(false);
130
    setLoading(false)
134
  };
131
  }
135
 
132
 
Línea 143... Línea 140...
143
  }
140
  }
Línea 144... Línea 141...
144
 
141
 
145
  return (
142
  return (
146
    <div className='profile_info'>
143
    <div className='profile_info'>
147
      <div className={`${image ? 'd-flex' : 'd-block'} position-relative`}>
144
      <div className={`${image ? 'd-flex' : 'd-block'} position-relative`}>
148
        {!!image &&
145
        {image &&
149
          <div className='profile_info_header_imgContainer'>
146
          <div className='profile_info_header_imgContainer'>
150
            <img src={image} className="object-fit-contain" style={{ maxHeight: '100px' }} alt="group image" />
147
            <img src={image} className="object-fit-contain" style={{ maxHeight: '100px' }} alt="group image" />
151
          </div>
148
          </div>
152
        }
-
 
153
        <div
149
        }
154
          className={`${image ? 'col-8 d-flex flex-column align-items-start' : 'col-12'} ${isTopData ? 'justify-content-end' : 'justify-content-center'}`}>
150
        <div className={`${image ? 'col-8 d-flex flex-column align-items-start' : 'col-12'} ${isTopData ? 'justify-content-end' : 'justify-content-center'}`}>
155
          <h3 className={`${status ? '' : "w-100 text-left"} ${isTopData ? 'mb-2' : ''} w-100`}>
151
          <h3 className={`${status ? '' : 'w-100 text-left'} ${isTopData ? 'mb-2' : ''} w-100`}>
156
            {name}
152
            {name}
157
          </h3>
153
          </h3>
158
          {(isTopData && email) &&
154
          {(isTopData && email) &&
159
            <h4 className={`${status ? '' : "w-100 text-left"} ${isTopData ? 'mb-2' : ''} w-100`}>
155
            <h4 className={`${status ? '' : 'w-100 text-left'} ${isTopData ? 'mb-2' : ''} w-100`}>
160
              {email}
156
              {email}
161
            </h4>
157
            </h4>
162
          }
158
          }
163
          {network &&
159
          {network &&
164
            <h4 className={`${status ? '' : "w-100 text-left"} ${isTopData ? 'mb-2' : ''} w-100`}>
160
            <h4 className={`${status ? '' : 'w-100 text-left'} ${isTopData ? 'mb-2' : ''} w-100`}>
165
              {network}
161
              {network}
166
            </h4>
162
            </h4>
167
          }
-
 
168
          {
163
          }
169
            isTopData
-
 
170
            &&
164
          {isTopData &&
171
            <ul>
165
            <ul>
172
              {link_view &&
166
              {link_view &&
173
                <li>
167
                <li>
174
                  <a
168
                  <a
Línea 185... Línea 179...
185
                  <a
179
                  <a
186
                    href={link_inmail}
180
                    href={link_inmail}
187
                    data-link={link_inmail}
181
                    data-link={link_inmail}
188
                    className="btn btn-primary"
182
                    className="btn btn-primary"
189
                  >
183
                  >
190
                    Mensaje
184
                    {LABELS.MESSAGE}
191
                  </a>
185
                  </a>
192
                </li>
186
                </li>
193
              }
187
              }
194
            </ul>
188
            </ul>
195
          }
189
          }
Línea 229... Línea 223...
229
              </a>
223
              </a>
230
            </li>
224
            </li>
231
          )
225
          )
232
        }
226
        }
233
        {
227
        {
234
          link_approve
228
          link_approve &&
235
          &&
-
 
236
          <li>
229
          <li>
237
            <a
230
            <a
238
              href="#"
231
              href="#"
239
              className="btn btn-tertiary"
232
              className="btn btn-tertiary"
240
              onClick={(e) => {
233
              onClick={(e) => {
241
                e.preventDefault();
234
                e.preventDefault()
242
                handleApproveConfirmationBox();
235
                handleApproveConfirmationBox()
243
              }}
236
              }}
244
            >
237
            >
245
              Aprobar
238
            {LABELS.APPROVE}
246
            </a>
239
            </a>
247
          </li>
240
          </li>
248
        }
241
        }
249
        {
242
        {
250
          link_accept
243
          link_accept &&
251
          &&
-
 
252
          <li>
244
          <li>
253
            <a
245
            <a
254
              href="#"
246
              href="#"
255
              className="btn btn-tertiary"
247
              className="btn btn-tertiary"
256
              onClick={(e) => {
248
              onClick={(e) => {
257
                e.preventDefault();
249
                e.preventDefault()
258
                handleApproveConfirmationBox();
250
                handleApproveConfirmationBox()
259
              }}
251
              }}
260
            >
252
            >
261
              Aceptar
253
              {LABEL.ACCEPT}
262
            </a>
254
            </a>
263
          </li>
255
          </li>
264
        }
256
        }
265
        {
257
        {
266
          link_reject &&
258
          link_reject &&
267
          <li>
259
          <li>
268
            <a
260
            <a
269
              href="#"
261
              href="#"
270
              className="btn btn-primary"
262
              className="btn btn-primary"
271
              onClick={(e) => {
263
              onClick={(e) => {
272
                e.preventDefault();
264
                e.preventDefault()
273
                handleRejectConfirmationBox();
265
                handleRejectConfirmationBox()
274
              }}
266
              }}
275
            >
267
            >
276
              Rechazar
268
              {LABELS.REJECT}
277
            </a>
269
            </a>
278
          </li>
270
          </li>
279
        }
271
        }
280
        {
272
        {
281
          link_delete &&
273
          link_delete &&
282
          <li>
274
          <li>
283
            <a
275
            <a
284
              href="#"
276
              href="#"
285
              className="btn btn-primary"
277
              className="btn btn-primary"
286
              onClick={(e) => {
278
              onClick={(e) => {
287
                e.preventDefault();
279
                e.preventDefault()
288
                handleShowConfirmationBox();
280
                handleShowConfirmationBox()
289
              }}
281
              }}
290
            >
282
            >
291
              {btnCancelTitle}
283
              {btnCancelTitle}
292
            </a>
284
            </a>
293
          </li>
285
          </li>
294
        }
286
        }
295
        {
287
        {
296
          link_inmail && !isTopData
288
          link_inmail && !isTopData &&
297
          &&
-
 
298
          <li>
289
          <li>
299
            <a
290
            <a
300
              href={link_inmail}
291
              href={link_inmail}
301
              data-link={link_inmail}
292
              data-link={link_inmail}
302
              title=""
293
              title=""
303
              className="btn btn-primary"
294
              className="btn btn-primary"
304
            >
295
            >
305
              Mensaje
296
              {LABELS.MESSAGE}
306
            </a>
297
            </a>
307
          </li>
298
          </li>
308
        }
299
        }
309
        {
300
        {
310
          link_admin &&
301
          link_admin &&
Línea 313... Línea 304...
313
              onClick={() => getManageUrl()}
304
              onClick={() => getManageUrl()}
314
              data-link={link_admin}
305
              data-link={link_admin}
315
              title="Administrar empresa"
306
              title="Administrar empresa"
316
              className="btn btn-primary"
307
              className="btn btn-primary"
317
            >
308
            >
318
              Administrar
309
              {LABELS.ADMINISTRATE}
319
            </a>
310
            </a>
320
          </li>
311
          </li>
321
        }
312
        }
322
        {
313
        {
323
          link_unfollow
314
          link_unfollow &&
324
          &&
-
 
325
          <li>
315
          <li>
326
            <a
316
            <a
327
              onClick={() => handleUnfollow(link_unfollow)}
317
              onClick={() => handleUnfollow(link_unfollow)}
328
              data-link={link_unfollow}
318
              data-link={link_unfollow}
329
              title="Administrar empresa"
319
              title="Administrar empresa"
330
              className="btn btn-primary"
320
              className="btn btn-primary"
331
            >
321
            >
332
              Dejar de seguir
322
              {LABELS.UNFOLLOW}
333
            </a>
323
            </a>
334
          </li>
324
          </li>
335
        }
325
        }
Línea 336... Línea 326...
336
 
326
 
Línea 339... Línea 329...
339
          <li>
329
          <li>
340
            <a
330
            <a
341
              href="#"
331
              href="#"
342
              className="btn btn-primary"
332
              className="btn btn-primary"
343
              onClick={(e) => {
333
              onClick={(e) => {
344
                e.preventDefault();
334
                e.preventDefault()
345
                handleBlockConfirmationBox();
335
                handleBlockConfirmationBox()
346
              }}
336
              }}
347
            >
337
            >
348
              Bloquear
338
              {LABELS.BLOCK}
349
            </a>
339
            </a>
350
          </li>
340
          </li>
351
        }
341
        }
352
        {
342
        {
353
          link_unblock && (
343
          link_unblock && (
354
            <li>
344
            <li>
355
              <a
345
              <a
356
                href="#"
346
                href="#"
357
                className="btn btn-tertiary"
347
                className="btn btn-tertiary"
358
                onClick={(e) => {
348
                onClick={(e) => {
359
                  e.preventDefault();
349
                  e.preventDefault()
360
                  handleUnblockConfirmationBox();
350
                  handleUnblockConfirmationBox()
361
                }}
351
                }}
362
              >
352
              >
363
                Desbloquear
353
                {LABELS.UNBLOCK}
364
              </a>
354
              </a>
365
            </li>
355
            </li>
366
          )
356
          )
367
        }
357
        }
368
        {
358
        {
369
          link_request
359
          link_request &&
370
          &&
-
 
371
          <li>
360
          <li>
372
            <a
361
            <a
373
              href="#"
362
              href="#"
374
              className="btn btn-tertiary"
363
              className="btn btn-tertiary"
375
              onClick={(e) => {
364
              onClick={(e) => {
376
                e.preventDefault();
365
                e.preventDefault()
377
                handleRequestConfirmationBox();
366
                handleRequestConfirmationBox()
378
              }}
367
              }}
379
            >
368
            >
380
              Conectar
369
              {LABELS.CONECT}
381
            </a>
370
            </a>
382
          </li>
371
          </li>
383
        }
372
        }
384
        {
373
        {
385
          link_cancel
374
          link_cancel &&
386
          &&
-
 
387
          <li>
375
          <li>
388
            <a
376
            <a
389
              href="#"
377
              href="#"
390
              className="btn btn-primary"
378
              className="btn btn-primary"
391
              onClick={(e) => {
379
              onClick={(e) => {
392
                e.preventDefault();
380
                e.preventDefault()
393
                handleCancelConfirmationBox();
381
                handleCancelConfirmationBox()
394
              }}
382
              }}
395
            >
383
            >
396
              Cancelar
384
              {LABELS.CANCEL}
397
            </a>
385
            </a>
398
          </li>
386
          </li>
399
        }
387
        }
400
        {
-
 
401
          link_leave &&
388
        {link_leave &&
402
          <li>
389
          <li>
403
            <a
390
            <a
404
              href="#"
391
              href="#"
405
              className="btn btn-tertiary"
392
              className="btn btn-tertiary"
406
              onClick={(e) => {
393
              onClick={(e) => {
407
                e.preventDefault();
394
                e.preventDefault()
408
                handleLeaveConfirmationBox();
395
                handleLeaveConfirmationBox()
409
              }}
396
              }}
410
            >
397
            >
411
              Abandonar
398
              {LABELS.LEAVE}
412
            </a>
399
            </a>
413
          </li>
400
          </li>
414
        }
401
        }
-
 
402
        {link_impersonate &&
-
 
403
        <li>
-
 
404
          <a href="#" className="btn btn-tertiary" onClick={() => getImpersonateUrl(link_impersonate)} > Personificar </a>
-
 
405
        </li>
-
 
406
      }
415
      </ul>
407
      </ul>
416
      {
408
      {
417
        link_delete &&
409
        link_delete &&
418
        <div style={{ position: "relative" }}>
410
        <div style={{ position: 'relative' }}>
419
          <ConfirmationBox
411
          <ConfirmationBox
420
            show={showConfirmationBox}
412
            show={showConfirmationBox}
421
            onClose={() => handleShowConfirmationBox(false)}
413
            onClose={() => handleShowConfirmationBox(false)}
422
            onAccept={() => handleCancelApply(link_delete)}
414
            onAccept={() => handleCancelApply(link_delete)}
423
          />
415
          />
424
        </div>
416
        </div>
425
      }
417
      }
426
      {
418
      {
427
        link_cancel && (
419
        link_cancel && (
428
          <div style={{ position: "relative" }}>
420
          <div style={{ position: 'relative' }}>
429
            <ConfirmationBox
421
            <ConfirmationBox
430
              show={showCancelConfirmationBox}
422
              show={showCancelConfirmationBox}
431
              onClose={() => handleCancelConfirmationBox(false)}
423
              onClose={() => handleCancelConfirmationBox(false)}
432
              onAccept={() => handleCancelApply(link_cancel)}
424
              onAccept={() => handleCancelApply(link_cancel)}
433
            />
425
            />
434
          </div>
426
          </div>
435
        )
427
        )
436
      }
428
      }
437
      {
429
      {
438
        link_block && (
430
        link_block && (
439
          <div style={{ position: "relative" }}>
431
          <div style={{ position: 'relative' }}>
440
            <ConfirmationBox
432
            <ConfirmationBox
441
              show={showBlockConfirmationBox}
433
              show={showBlockConfirmationBox}
442
              onClose={() => handleBlockConfirmationBox(false)}
434
              onClose={() => handleBlockConfirmationBox(false)}
443
              onAccept={() => handleCancelApply(link_block)}
435
              onAccept={() => handleCancelApply(link_block)}
444
            />
436
            />
445
          </div>
437
          </div>
446
        )
438
        )
447
      }
439
      }
448
      {
440
      {
449
        link_accept && (
441
        link_accept && (
450
          <div style={{ position: "relative" }}>
442
          <div style={{ position: 'relative' }}>
451
            <ConfirmationBox
443
            <ConfirmationBox
452
              show={showApproveConfirmationBox}
444
              show={showApproveConfirmationBox}
453
              onClose={() => handleApproveConfirmationBox(false)}
445
              onClose={() => handleApproveConfirmationBox(false)}
454
              onAccept={() => handleCancelApply(link_accept)}
446
              onAccept={() => handleCancelApply(link_accept)}
455
            />
447
            />
456
          </div>
448
          </div>
457
        )
449
        )
458
      }
450
      }
459
      {
451
      {
460
        link_approve && (
452
        link_approve && (
461
          <div style={{ position: "relative" }}>
453
          <div style={{ position: 'relative' }}>
462
            <ConfirmationBox
454
            <ConfirmationBox
463
              show={showApproveConfirmationBox}
455
              show={showApproveConfirmationBox}
464
              onClose={() => handleApproveConfirmationBox(false)}
456
              onClose={() => handleApproveConfirmationBox(false)}
465
              onAccept={() => handleCancelApply(link_approve)}
457
              onAccept={() => handleCancelApply(link_approve)}
466
            />
458
            />
467
          </div>
459
          </div>
468
        )
460
        )
469
      }
461
      }
470
      {
462
      {
471
        link_reject && (
463
        link_reject && (
472
          <div style={{ position: "relative" }}>
464
          <div style={{ position: 'relative' }}>
473
            <ConfirmationBox
465
            <ConfirmationBox
474
              show={showRejectConfirmationBox}
466
              show={showRejectConfirmationBox}
475
              onClose={() => handleRejectConfirmationBox(false)}
467
              onClose={() => handleRejectConfirmationBox(false)}
476
              onAccept={() => handleCancelApply(link_reject)}
468
              onAccept={() => handleCancelApply(link_reject)}
477
            />
469
            />
478
          </div>
470
          </div>
479
        )
471
        )
480
      }
472
      }
481
      {
473
      {
482
        link_request && (
474
        link_request && (
483
          <div style={{ position: "relative" }}>
475
          <div style={{ position: 'relative' }}>
484
            <ConfirmationBox
476
            <ConfirmationBox
485
              show={showRequestConfirmationBox}
477
              show={showRequestConfirmationBox}
486
              onClose={() => handleRequestConfirmationBox(false)}
478
              onClose={() => handleRequestConfirmationBox(false)}
487
              onAccept={() => handleCancelApply(link_request)}
479
              onAccept={() => handleCancelApply(link_request)}
488
            />
480
            />
489
          </div>
481
          </div>
490
        )
482
        )
491
      }
483
      }
492
      {
484
      {
493
        link_unblock && (
485
        link_unblock && (
494
          <div style={{ position: "relative" }}>
486
          <div style={{ position: 'relative' }}>
495
            <ConfirmationBox
487
            <ConfirmationBox
496
              show={showUnblockConfirmationBox}
488
              show={showUnblockConfirmationBox}
497
              onClose={() => handleUnblockConfirmationBox(false)}
489
              onClose={() => handleUnblockConfirmationBox(false)}
498
              onAccept={() => handleCancelApply(link_unblock)}
490
              onAccept={() => handleCancelApply(link_unblock)}
499
            />
491
            />
500
          </div>
492
          </div>
501
        )
493
        )
502
      }
494
      }
503
      {
495
      {
504
        link_leave && (
496
        link_leave && (
505
          <div style={{ position: "relative" }}>
497
          <div style={{ position: 'relative' }}>
506
            <ConfirmationBox
498
            <ConfirmationBox
507
              show={showLeaveConfirmationBox}
499
              show={showLeaveConfirmationBox}
508
              onClose={() => handleLeaveConfirmationBox(false)}
500
              onClose={() => handleLeaveConfirmationBox(false)}
509
              onAccept={() => handleCancelApply(link_leave)}
501
              onAccept={() => handleCancelApply(link_leave)}
510
            />
502
            />
511
          </div>
503
          </div>
512
        )
504
        )
513
      }
505
      }
514
      {
-
 
515
        link_impersonate
-
 
516
        &&
-
 
517
        <li>
-
 
518
          <a
-
 
519
            href="#" onClick={() => getImpersonateUrl(link_impersonate)} > Personificar </a>
-
 
520
        </li>
-
 
521
      }
-
 
522
      {
-
 
523
        loading &&
506
      {loading &&
524
        <StyledSpinnerContainer>
507
        <StyledSpinnerContainer>
525
          <Spinner />
508
          <Spinner />
526
        </StyledSpinnerContainer>
509
        </StyledSpinnerContainer>
527
      }
510
      }
528
    </div >
511
    </div>
529
  );
512
  )
530
};
513
}
Línea 531... Línea 514...
531
 
514