Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 743 Rev 956
Línea 1... Línea 1...
1
import React, { useState, useEffect } from 'react'
1
import React, { useState, useEffect } from 'react'
2
import { useParams } from 'react-router-dom'
2
import { useParams } from 'react-router-dom'
3
import { useSelector } from 'react-redux'
3
import { useSelector } from 'react-redux'
4
import { getBackendVars } from '../../services/backendVars'
4
import { getBackendVars } from '../../services/backendVars'
-
 
5
import { Container, Grid } from '@mui/material'
-
 
6
 
5
import ProfileCard from '../../components/linkedin/profile/ProfileCard'
7
import ProfileCard from '../../components/linkedin/profile/ProfileCard'
6
import ProfileWidget from '../../components/linkedin/profile/ProfileWidget'
8
import ProfileWidget from '../../components/linkedin/profile/ProfileWidget'
7
import ExperienceCard from '../../components/linkedin/profile/cards/ExperienceCard'
9
import ExperienceCard from '../../components/linkedin/profile/cards/ExperienceCard'
8
import EducationCard from '../../components/linkedin/profile/cards/EducationCard'
10
import EducationCard from '../../components/linkedin/profile/cards/EducationCard'
9
import EmptySection from '../../components/UI/EmptySection'
11
import EmptySection from '../../components/UI/EmptySection'
10
import ItemsList from '../../components/linkedin/profile/cards/ItemsList'
12
import TagsList from '../../components/UI/TagsList'
11
import '../../styles/profile/profile.scss'
-
 
12
import ExperienceModal from '../../components/experiences/ExperienceModal'
13
import ExperienceModal from '../../components/experiences/ExperienceModal'
13
import EducationModal from '../../components/educations/EducationModal'
14
import EducationModal from '../../components/educations/EducationModal'
14
import SkillsModal from '../../components/skills/SkillsModal'
15
import SkillsModal from '../../components/skills/SkillsModal'
15
import LanguagesModal from '../../components/languages/LanguagesModal'
16
import LanguagesModal from '../../components/languages/LanguagesModal'
16
import AptitudesModal from '../../components/aptitudes/AptitudesModal'
17
import AptitudesModal from '../../components/aptitudes/AptitudesModal'
17
import HobbiesModal from '../../components/hobbies-and-interests/HobbiesModal'
18
import HobbiesModal from '../../components/hobbies-and-interests/HobbiesModal'
18
import LocationModal from '../../components/location/LocationModal'
19
import LocationModal from '../../components/location/LocationModal'
Línea -... Línea 20...
-
 
20
 
-
 
21
import '../../styles/profile/profile.scss'
19
 
22
 
20
const View = () => {
23
const View = () => {
21
  const [profile, setProfile] = useState({})
24
  const [profile, setProfile] = useState({})
22
  const [experiences, setExperiences] = useState([])
25
  const [experiences, setExperiences] = useState([])
23
  const [educations, setEducations] = useState([])
26
  const [educations, setEducations] = useState([])
Línea 153... Línea 156...
153
      })
156
      })
154
  }, [])
157
  }, [])
Línea 155... Línea 158...
155
 
158
 
156
  return (
159
  return (
157
    <>
160
    <>
158
      <main className='w-100'>
161
      <Container as='main'>
159
        <div className='container'>
162
        <Grid container spacing={2}>
160
          <div className='main d-flex flex-column' style={{ gap: '.5rem' }}>
163
          <Grid item xs={12} display='flex' direction='column' gap={2}>
161
            <ProfileCard
164
            <ProfileCard
162
              {...profile}
165
              {...profile}
163
              sizes={{
166
              sizes={{
164
                image: profile.image_size_profile,
167
                image: profile.image_size_profile,
165
                cover: profile.image_size_cover
168
                cover: profile.image_size_cover
166
              }}
169
              }}
167
              uuid={profile.user_uuid}
170
              uuid={profile.user_uuid}
168
              image={profile.image}
171
              image={profile.image}
169
              cover={profile.cover}
172
              cover={profile.cover}
-
 
173
            />
170
            />
174
 
171
            <ProfileWidget
175
            <ProfileWidget
172
              title={labels.experience}
176
              title={labels.experience}
173
              onEdit={() => setIsEdit(!isEdit)}
177
              onEdit={() => setIsEdit(!isEdit)}
174
              onAdd={handleAdd}
178
              onAdd={handleAdd}
Línea 188... Línea 192...
188
                ))
192
                ))
189
              ) : (
193
              ) : (
190
                <EmptySection align='left' message={labels.empty} />
194
                <EmptySection align='left' message={labels.empty} />
191
              )}
195
              )}
192
            </ProfileWidget>
196
            </ProfileWidget>
-
 
197
 
193
            <ProfileWidget
198
            <ProfileWidget
194
              title={labels.education}
199
              title={labels.education}
195
              onEdit={() => setIsEdit(!isEdit)}
200
              onEdit={() => setIsEdit(!isEdit)}
196
              onAdd={handleAdd}
201
              onAdd={handleAdd}
197
              addUrl={`/profile/my-profiles/education/${profile?.user_profile_uuid}/operation/add`}
202
              addUrl={`/profile/my-profiles/education/${profile?.user_profile_uuid}/operation/add`}
Línea 202... Línea 207...
202
                ))
207
                ))
203
              ) : (
208
              ) : (
204
                <EmptySection align='left' message={labels.empty} />
209
                <EmptySection align='left' message={labels.empty} />
205
              )}
210
              )}
206
            </ProfileWidget>
211
            </ProfileWidget>
-
 
212
 
207
            <ProfileWidget
213
            <ProfileWidget
208
              title={labels.location}
214
              title={labels.location}
209
              onEdit={() => setModalShow('Ubicación')}
215
              onEdit={() => setModalShow('Ubicación')}
210
              justEdit
216
              justEdit
211
            >
217
            >
212
              <div className='card__items'>
218
              <div className='card__items'>
213
                <p>{address}</p>
219
                <p>{address}</p>
214
              </div>
220
              </div>
215
            </ProfileWidget>
221
            </ProfileWidget>
-
 
222
 
216
            <ProfileWidget
223
            <ProfileWidget
217
              title={labels.languages}
224
              title={labels.languages}
218
              onEdit={() => setModalShow('Idiomas')}
225
              onEdit={() => setModalShow('Idiomas')}
219
              justEdit
226
              justEdit
220
            >
227
            >
221
              {languages.length ? (
-
 
222
                <ItemsList value={languages} />
228
              <TagsList tags={languages} />
223
              ) : (
-
 
224
                <EmptySection align='left' message={labels.empty} />
-
 
225
              )}
-
 
226
            </ProfileWidget>
229
            </ProfileWidget>
-
 
230
 
227
            <ProfileWidget
231
            <ProfileWidget
228
              title={labels.skills}
232
              title={labels.skills}
229
              onEdit={() => setModalShow('Habilidades')}
233
              onEdit={() => setModalShow('Habilidades')}
230
              justEdit
234
              justEdit
231
            >
235
            >
232
              {skills.length ? (
-
 
233
                <ItemsList value={skills} />
236
              <TagsList tags={skills} />
234
              ) : (
-
 
235
                <EmptySection align='left' message={labels.empty} />
-
 
236
              )}
-
 
237
            </ProfileWidget>
237
            </ProfileWidget>
-
 
238
 
238
            <ProfileWidget
239
            <ProfileWidget
239
              title={labels.aptitudes}
240
              title={labels.aptitudes}
240
              onEdit={() => setModalShow('Aptitudes')}
241
              onEdit={() => setModalShow('Aptitudes')}
241
              justEdit
242
              justEdit
242
            >
243
            >
243
              {aptitudes.length ? (
-
 
244
                <ItemsList value={aptitudes} />
244
              <TagsList tags={aptitudes} />
245
              ) : (
-
 
246
                <EmptySection align='left' message={labels.empty} />
-
 
247
              )}
-
 
248
            </ProfileWidget>
245
            </ProfileWidget>
-
 
246
 
249
            <ProfileWidget
247
            <ProfileWidget
250
              title={labels.hobbies_and_interests}
248
              title={labels.hobbies_and_interests}
251
              onEdit={() => setModalShow('Hobbies e Intereses')}
249
              onEdit={() => setModalShow('Hobbies e Intereses')}
252
              justEdit
250
              justEdit
253
            >
251
            >
254
              {hobbiesAndInterests.length ? (
-
 
255
                <ItemsList value={hobbiesAndInterests} />
252
              <TagsList tags={hobbiesAndInterests} />
256
              ) : (
-
 
257
                <EmptySection align='left' message={labels.empty} />
-
 
258
              )}
-
 
259
            </ProfileWidget>
253
            </ProfileWidget>
260
          </div>
254
          </Grid>
261
        </div>
255
        </Grid>
262
      </main>
256
      </Container>
263
      {renderModal[modalShow]}
257
      {renderModal[modalShow]}
264
    </>
258
    </>
265
  )
259
  )
266
}
260
}