Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5380 | Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
5374 stevensc 1
/* eslint-disable react/prop-types */
2
import React from 'react'
3
import parser from 'html-react-parser'
4
import { axios } from '../../../utils'
5
 
6
export default function ProfileInfo ({
7
  image,
8
  fullName,
9
  description,
10
  visits,
11
  country,
12
  connections,
13
  headerClasses = '',
14
  imageContainerClasses = '',
15
  linkAdmin,
16
  linkImpersonate
17
}) {
18
  const getAdminUrl = async () => {
19
    try {
20
      const { data } = await axios.get('/backend/signin-admin')
21
      if (data.success) window.open(data.data)
22
    } catch (error) {
23
      console.log('>>: error > ', error)
24
    }
25
  }
26
 
27
  return (
28
        <div className='user_profile-info'>
29
            <div className={'userProfile__header' + ' ' + headerClasses}>
30
                <div className={'userProfile__header__imgContainer' + ' ' + imageContainerClasses}>
31
                    <img src={image} alt="profile-image" />
32
                </div>
33
                <div className={'userProfile__header__nameContainer'}>
34
                    <p className="text-center font-weight-bold">
35
                        {fullName}
36
                    </p>
37
                    {!!description &&
38
                        <p className="text-center p-1 small-text-children">
39
                            {parser(description)}
40
                        </p>
41
                    }
42
                </div>
43
            </div>
44
            <div className='userProfile__headerBackground'></div>
45
            <div className="row">
46
                <div className="col w-100 text-center">
47
                    <p className='userProfile__connectionInfo__infoContainer__title'>
48
                        <i className="fa fa-eye" ></i>
49
                    </p>
50
                    <p className='userProfile__connectionInfo__infoContainer__title'>
51
                        {visits || ''}
52
                    </p>
53
                </div>
54
                <div className="col w-100 text-center">
55
                    <p className='userProfile__connectionInfo__infoContainer__title'>
56
                        <i className="pl-2 fa fa-map px-2"></i>
57
                    </p>
58
                    <p className='userProfile__connectionInfo__infoContainer__title'>
59
                        {country || ''}
60
                    </p>
61
                </div>
62
                <div className="col w-100 text-center">
63
                    <p className='userProfile__connectionInfo__infoContainer__title'>
64
                        <i className="fa fa-share-alt" ></i>
65
                    </p>
66
                    <p className='userProfile__connectionInfo__infoContainer__title'>
67
                        {connections}
68
                    </p>
69
                </div>
70
            </div>
71
            <ul>
72
                {linkAdmin &&
73
                    <li>
74
                        <a href="#" onClick={() => getAdminUrl()} >Administración</a>
75
                    </li>
76
                }
77
                {linkImpersonate &&
78
                    <li>
79
                        <a href="/impersonate">Personificar otro usuario</a>
80
                    </li>
81
                }
82
                <li>
83
                    <a href="/account-settings">Configuración de la cuenta</a>
84
                </li>
85
                <li>
86
                    <a href="/privacy-policy">Política de privacidad</a>
87
                </li>
88
                <li>
89
                    <a href="/cookies">Política de cookies</a>
90
                </li>
91
                <li className='logOutContainer'>
92
                    <a className='logOutContainer__a' href="/signout">
93
                        Cerrar sesión
94
                    </a>
95
                </li>
96
            </ul>
97
        </div>
98
  )
99
}