Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5475 | Rev 5480 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
5475 stevensc 1
import React, { useEffect } from 'react'
5473 stevensc 2
import parse from 'html-react-parser'
3
import { useDispatch } from 'react-redux'
4
import { setIntlLabels } from '../../../../redux/intl/intl.action'
5475 stevensc 5
 
5473 stevensc 6
import EmptySection from '../../../../shared/empty-section/EmptySection'
7
import SuggestWidget from '../../../../shared/helpers/my-groups-helper/SuggestWidget'
8
import ProfileInfo from '../../../components/ProfileInfo'
9
import Overview from '../../../components/overview/Overview'
5475 stevensc 10
import Experiences from '../../../components/experiences/Experiences'
5478 stevensc 11
import Educations from '../../../components/educations/Educations'
5473 stevensc 12
 
13
const View = ({
14
  userIdEncrypted,
15
  cover,
16
  overview,
17
  userExperiences,
18
  userEducations,
19
  formatted_address,
20
  months,
21
  userLanguages,
22
  userSkills,
23
  userAptitudes,
24
  userHobbiesAndInterests,
25
  CancelConnectionUrl,
26
  RequestConnectionUrl,
27
  profileId,
28
  labels,
29
  ...profileProps
30
}) => {
31
  const dispatch = useDispatch()
32
 
33
  useEffect(() => {
34
    dispatch(setIntlLabels(labels))
35
  }, [])
36
 
37
  return (
38
    <>
39
      <section className="cover-sec">
40
        <img
41
          id="user-cover-img"
42
          src={`/storage/type/user-cover/code/${userIdEncrypted}/${
43
            cover ? `filename/${cover}` : ''
44
          }`}
45
          alt=""
46
        />
47
      </section>
48
      <main className="main-section-data container px-0">
49
        <ProfileInfo
50
          {...profileProps}
51
          id={userIdEncrypted}
52
          cancelUrl={CancelConnectionUrl}
53
          connectUrl={RequestConnectionUrl}
54
        />
55
        <section className="feed-section">
56
          <Overview overview={overview} userId={userIdEncrypted} />
5475 stevensc 57
          <Experiences
58
            userId={userIdEncrypted}
59
            experiences={userExperiences}
60
            months={months}
61
          />
5478 stevensc 62
          <Educations educations={userEducations} userId={userIdEncrypted} />
5473 stevensc 63
          <div className="user-profile-extended-ov">
64
            <h3>{labels.EDUCATION}</h3>
65
            {!userEducations.length ? (
66
              <EmptySection align="left" message={labels.EMPTY} />
67
            ) : (
68
              <span id="education-records">
69
                {userEducations.map(
70
                  (
71
                    {
72
                      degree,
73
                      university,
74
                      from_year,
75
                      to_year,
76
                      field_of_study,
77
                      formatted_address,
78
                      description,
79
                    },
80
                    id
81
                  ) => (
82
                    <div key={id}>
83
                      {id >= 1 && <hr />}
84
                      <p>{degree}</p>
85
                      <p>{university}</p>
86
                      <p>{`${from_year} - ${to_year || 'Actual'}`}</p>
87
                      {field_of_study && <p>{field_of_study}</p>}
88
                      <p>{formatted_address}</p>
89
                      {description && <p>{parse(description)}</p>}
90
                    </div>
91
                  )
92
                )}
93
              </span>
94
            )}
95
          </div>
96
          <div className="user-profile-extended-ov">
97
            <h3>{labels.LOCATION}</h3>
98
            {!formatted_address ? (
99
              <EmptySection align="left" message={labels.EMPTY} />
100
            ) : (
101
              <p id="location-formatted_address">{formatted_address}</p>
102
            )}
103
          </div>
104
          <div className="user-profile-extended-ov">
105
            <h3>{labels.LANGUAGES}</h3>
106
            {!userLanguages.length ? (
107
              <EmptySection align="left" message={labels.EMPTY} />
108
            ) : (
109
              <ul id="list-languages">
110
                {userLanguages.map(({ name, value }) => (
111
                  <li key={value}>
112
                    <a href="#" title="">
113
                      {name}
114
                    </a>
115
                  </li>
116
                ))}
117
              </ul>
118
            )}
119
          </div>
120
          <div className="user-profile-extended-ov">
121
            <h3>{labels.SKILLS}</h3>
122
            {!userSkills.length ? (
123
              <EmptySection align="left" message={labels.EMPTY} />
124
            ) : (
125
              <ul id="list-skills">
126
                {userSkills.map(({ name, value }) => (
127
                  <li key={value}>
128
                    <a href="#" title="">
129
                      {name}
130
                    </a>
131
                  </li>
132
                ))}
133
              </ul>
134
            )}
135
          </div>
136
          <div className="user-profile-extended-ov">
137
            <h3>{labels.APTITUDES}</h3>
138
            {!userAptitudes.length ? (
139
              <EmptySection align="left" message={labels.EMPTY} />
140
            ) : (
141
              <ul id="list-skills">
142
                {userAptitudes.map(({ name, value }) => (
143
                  <li key={value}>
144
                    <a href="#" title="">
145
                      {name}
146
                    </a>
147
                  </li>
148
                ))}
149
              </ul>
150
            )}
151
          </div>
152
          <div className="user-profile-extended-ov">
153
            <h3>{labels.HOBBIES_AND_INTERESTS}</h3>
154
            {!userHobbiesAndInterests.length ? (
155
              <EmptySection align="left" message={labels.EMPTY} />
156
            ) : (
157
              <ul id="list-skills">
158
                {userHobbiesAndInterests.map(({ name, value }) => (
159
                  <li key={value}>
160
                    <a href="#" title="">
161
                      {name}
162
                    </a>
163
                  </li>
164
                ))}
165
              </ul>
166
            )}
167
          </div>
168
        </section>
169
        <SuggestWidget
170
          url={`/helpers/people-viewed-profile/${profileId}`}
171
          btnLabelAccept="Ver perfil"
172
          title="Quien ha visitado esta perfil"
173
        />
174
      </main>
175
    </>
176
  )
177
}
178
 
179
export default View