Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5890 Rev 5891
Línea 1... Línea 1...
1
import React, { useEffect, useState } from 'react'
1
import React, { useState } from 'react'
2
import EmptySection from '../../../../../shared/empty-section/EmptySection'
2
import EmptySection from '../../../../../shared/empty-section/EmptySection'
3
import EducationCard from '../../../../pages/view/templates/linkedin/components/cards/EducationCard'
3
import EducationCard from '../../../../pages/view/templates/linkedin/components/cards/EducationCard'
4
import ExperienceCard from '../../../../pages/view/templates/linkedin/components/cards/ExperienceCard'
4
import ExperienceCard from '../../../../pages/view/templates/linkedin/components/cards/ExperienceCard'
5
import ItemsList from '../../../../pages/view/templates/linkedin/components/cards/ItemsList'
5
import ItemsList from '../../../../pages/view/templates/linkedin/components/cards/ItemsList'
6
import ProfileCard from '../../../../pages/view/templates/linkedin/components/ProfileCard'
6
import ProfileCard from '../../../../pages/view/templates/linkedin/components/ProfileCard'
Línea 26... Línea 26...
26
    formatted_address,
26
    formatted_address,
27
  } = userInfo
27
  } = userInfo
Línea 28... Línea 28...
28
 
28
 
29
  const [experiences, setExperiences] = useState(userExperiences)
29
  const [experiences, setExperiences] = useState(userExperiences)
30
  const [educations, setEducations] = useState(userEducations)
30
  const [educations, setEducations] = useState(userEducations)
31
  const [languages, setLanguages] = useState([])
31
  const [languages, setLanguages] = useState(userLanguages)
32
  const [skills, setSkills] = useState([])
32
  const [skills, setSkills] = useState(userSkills)
33
  const [aptitudes, setAptitudes] = useState([])
33
  const [aptitudes, setAptitudes] = useState(userAptitudes)
-
 
34
  const [hobbiesAndInterests, setHobbiesAndInterests] = useState(
-
 
35
    userHobbiesAndInterests
34
  const [hobbiesAndInterests, setHobbiesAndInterests] = useState([])
36
  )
Línea 35... Línea 37...
35
  const [address, setAddress] = useState(formatted_address)
37
  const [address, setAddress] = useState(formatted_address)
36
 
38
 
37
  const [modalShow, setModalShow] = useState(null)
39
  const [modalShow, setModalShow] = useState(null)
Línea 83... Línea 85...
83
    Habilidades: (
85
    Habilidades: (
84
      <SkillsModal
86
      <SkillsModal
85
        closeModal={closeModal}
87
        closeModal={closeModal}
86
        setSkills={(newSkills) => setSkills(newSkills)}
88
        setSkills={(newSkills) => setSkills(newSkills)}
87
        show={modalShow === 'Habilidades'}
89
        show={modalShow === 'Habilidades'}
88
        skillsOptions={Object.entries(options.skills).map(([key, value]) => ({
90
        skillsOptions={options.skills}
89
          value: key,
-
 
90
          name: value,
-
 
91
        }))}
-
 
92
        userIdEncrypted={userInfo.userProfileIdEncrypted}
91
        userIdEncrypted={userInfo.userProfileIdEncrypted}
93
        userSkillsArray={skills}
92
        userSkillsArray={skills}
94
      />
93
      />
95
    ),
94
    ),
96
    Idiomas: (
95
    Idiomas: (
97
      <LanguagesModal
96
      <LanguagesModal
98
        show={modalShow === 'Idiomas'}
97
        show={modalShow === 'Idiomas'}
99
        closeModal={closeModal}
98
        closeModal={closeModal}
100
        userIdEncrypted={userInfo.userProfileIdEncrypted}
99
        userIdEncrypted={userInfo.userProfileIdEncrypted}
101
        languagesOptions={Object.entries(options.languages).map(
100
        languagesOptions={options.languages}
102
          ([key, value]) => ({ value: key, name: value })
-
 
103
        )}
-
 
104
        userLanguages={languages}
101
        userLanguages={languages}
105
        setLanguages={(newLanguages) => setLanguages(newLanguages)}
102
        setLanguages={(newLanguages) => setLanguages(newLanguages)}
106
      />
103
      />
107
    ),
104
    ),
108
    Aptitudes: (
105
    Aptitudes: (
109
      <AptitudesModal
106
      <AptitudesModal
110
        show={modalShow === 'Aptitudes'}
107
        show={modalShow === 'Aptitudes'}
111
        closeModal={closeModal}
108
        closeModal={closeModal}
112
        userIdEncrypted={userInfo.userProfileIdEncrypted}
109
        userIdEncrypted={userInfo.userProfileIdEncrypted}
113
        aptitudesOptions={Object.entries(options.aptitudes).map(
110
        aptitudesOptions={options.aptitudes}
114
          ([key, value]) => ({ value: key, name: value })
-
 
115
        )}
-
 
116
        userAptitudes={aptitudes}
111
        userAptitudes={aptitudes}
117
        setAptitudes={(newAptitudes) => setAptitudes(newAptitudes)}
112
        setAptitudes={(newAptitudes) => setAptitudes(newAptitudes)}
118
      />
113
      />
119
    ),
114
    ),
120
    'Hobbies e Intereses': (
115
    'Hobbies e Intereses': (
121
      <HobbiesModal
116
      <HobbiesModal
122
        show={modalShow === 'Hobbies e Intereses'}
117
        show={modalShow === 'Hobbies e Intereses'}
123
        closeModal={closeModal}
118
        closeModal={closeModal}
124
        userIdEncrypted={userInfo.userProfileIdEncrypted}
119
        userIdEncrypted={userInfo.userProfileIdEncrypted}
125
        hobbiesAndInterestsOptions={Object.entries(
120
        hobbiesAndInterestsOptions={options.hobbiesAndInterests}
126
          options.hobbiesAndInterests
-
 
127
        ).map(([key, value]) => ({ value: key, name: value }))}
-
 
128
        userHobbiesAndInterests={hobbiesAndInterests}
121
        userHobbiesAndInterests={hobbiesAndInterests}
129
        setUserHobbiesAndInterests={(newHobbiesAndInterests) =>
122
        setUserHobbiesAndInterests={(newHobbiesAndInterests) =>
130
          setHobbiesAndInterests(newHobbiesAndInterests)
123
          setHobbiesAndInterests(newHobbiesAndInterests)
131
        }
124
        }
132
      />
125
      />
Línea 139... Línea 132...
139
        userIdEncrypted={userInfo.userProfileIdEncrypted}
132
        userIdEncrypted={userInfo.userProfileIdEncrypted}
140
      />
133
      />
141
    ),
134
    ),
142
  }
135
  }
Línea -... Línea 136...
-
 
136
 
-
 
137
  return (
-
 
138
    <main className="w-100">
-
 
139
      <div className="container">
143
 
140
        <div className="main d-flex flex-column" style={{ gap: '.5rem' }}>
-
 
141
          <ProfileCard
144
  /* useEffect(() => {
142
            {...{
-
 
143
              ...userInfo,
-
 
144
              formatted_address: address,
145
    const adapters = [
145
            }}
146
      {
146
          />
147
        value: userSkills,
147
          <ProfileWidget
-
 
148
            title="Experiencia"
-
 
149
            onEdit={() => setIsEdit(!isEdit)}
-
 
150
            onAdd={handleAdd}
148
        setter: setSkills,
151
            addUrl={`/profile/my-profiles/experience/${userInfo.userProfileIdEncrypted}/operation/add`}
-
 
152
          >
-
 
153
            {experiences.map((experience, index) => {
-
 
154
              return (
-
 
155
                <ExperienceCard
-
 
156
                  key={index}
-
 
157
                  experience={experience}
-
 
158
                  months={userInfo.months}
-
 
159
                  isEdit={isEdit}
-
 
160
                  onEdit={handleEdit}
-
 
161
                  setExperiences={(newExperiences) =>
-
 
162
                    setExperiences(newExperiences)
-
 
163
                  }
-
 
164
                />
-
 
165
              )
-
 
166
            })}
-
 
167
          </ProfileWidget>
-
 
168
          <ProfileWidget
-
 
169
            title="Educación"
-
 
170
            onEdit={() => setIsEdit(!isEdit)}
-
 
171
            onAdd={handleAdd}
149
      },
172
            addUrl={`/profile/my-profiles/education/${userInfo.userProfileIdEncrypted}/operation/add`}
-
 
173
          >
-
 
174
            {educations.map((education, index) => {
150
      {
175
              return (
151
        value: userLanguages,
176
                <EducationCard
-
 
177
                  key={index}
-
 
178
                  education={education}
-
 
179
                  isEdit={isEdit}
-
 
180
                  onEdit={handleEdit}
-
 
181
                  setEducations={(newEducations) =>
-
 
182
                    setEducations(newEducations)
-
 
183
                  }
-
 
184
                />
152
        setter: setLanguages,
185
              )
-
 
186
            })}
-
 
187
          </ProfileWidget>
-
 
188
          <ProfileWidget
-
 
189
            title="Ubicación"
-
 
190
            onEdit={() => setModalShow('Ubicación')}
153
      },
191
            justEdit
-
 
192
          >
-
 
193
            <div className="card__items">
-
 
194
              <p>{address}</p>
-
 
195
            </div>
154
      {
196
          </ProfileWidget>
155
        value: userAptitudes,
197
          <ProfileWidget
-
 
198
            title="Idiomas"
-
 
199
            onEdit={() => setModalShow('Idiomas')}
156
        setter: setAptitudes,
200
            justEdit
-
 
201
          >
-
 
202
            {!languages.length ? (
-
 
203
              <EmptySection align="left" message="Sin información" />
-
 
204
            ) : (
157
      },
205
              <ItemsList value={languages} />
158
      {
206
            )}
-
 
207
          </ProfileWidget>
159
        value: userHobbiesAndInterests,
208
          <ProfileWidget
-
 
209
            title="Habilidades"
-
 
210
            onEdit={() => setModalShow('Habilidades')}
160
        setter: setHobbiesAndInterests,
211
            justEdit
-
 
212
          >
-
 
213
            {!skills.length ? (
-
 
214
              <EmptySection align="left" message="Sin información" />
-
 
215
            ) : (
-
 
216
              <ItemsList value={skills} />
-
 
217
            )}
-
 
218
          </ProfileWidget>
-
 
219
          <ProfileWidget
-
 
220
            title="Aptitudes"
-
 
221
            onEdit={() => setModalShow('Aptitudes')}
161
      },
222
            justEdit
162
    ]
-
 
163
 
223
          >
164
    adapters.map((adapter) => {
224
            {!aptitudes.length ? (
165
      const value = Object.entries(adapter.value).map(([key, value]) => ({
225
              <EmptySection align="left" message="Sin información" />
-
 
226
            ) : (
-
 
227
              <ItemsList value={aptitudes} />
-
 
228
            )}
-
 
229
          </ProfileWidget>
-
 
230
          <ProfileWidget
-
 
231
            title="Pasatiempos e intereses"
166
        value: key,
232
            onEdit={() => setModalShow('Hobbies e Intereses')}
167
        name: value,
233
            justEdit
-
 
234
          >
-
 
235
            {!hobbiesAndInterests.length ? (
-
 
236
              <EmptySection align="left" message="Sin información" />
-
 
237
            ) : (
-
 
238
              <ItemsList value={hobbiesAndInterests} />
168
      }))
239
            )}
-
 
240
          </ProfileWidget>
-
 
241
          {renderModal[modalShow]}
169
      adapter.setter(value)
242
        </div>
170
    })
243
      </div>
171
  }, []) */
244
    </main>
172
 
-
 
173
  return <h1>Hello</h1>
245
  )
Línea 174... Línea 246...
174
}
246
}