Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3446 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3446 Rev 3719
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useParams } from 'react-router-dom';
2
import { useParams } from 'react-router-dom';
3
import { Grid } from '@mui/material';
3
import { Box } from '@mui/material';
4
 
4
 
5
import { formatObjectToArray } from '@app/utils';
5
import { formatObjectToArray } from '@app/utils';
6
import { useFetch } from '@hooks';
6
import { useFetch } from '@hooks';
7
 
7
 
8
import ProfileCard from '@app/components/profile/ProfileCard';
8
import ProfileCard from '@app/components/profile/ProfileCard';
9
import AptitudesCard from '@app/components/profile/aptitudes/AptitudesCard';
9
import AptitudesCard from '@app/components/profile/aptitudes/AptitudesCard';
10
import LanguagesCard from '@app/components/profile/languages/LanguagesCard';
10
import LanguagesCard from '@app/components/profile/languages/LanguagesCard';
11
import LocationCard from '@app/components/profile/location/LocationCard';
11
import LocationCard from '@app/components/profile/location/LocationCard';
12
import SkillsCard from '@app/components/profile/skills/SkillsCard';
12
import SkillsCard from '@app/components/profile/skills/SkillsCard';
13
import HobbiesCard from '@app/components/profile/hobbies/HobbiesCard';
13
import HobbiesCard from '@app/components/profile/hobbies/HobbiesCard';
14
import EducationsCard from '@app/components/profile/educations/educations-card';
14
import EducationsCard from '@app/components/profile/educations/educations-card';
15
import ExperiencesCard from '@components/profile/experiences/experiences-card';
15
import ExperiencesCard from '@components/profile/experiences/experiences-card';
16
 
16
 
17
const ProfileEditLayout = () => {
17
const ProfileEditLayout = () => {
18
  const { uuid } = useParams();
18
  const { uuid } = useParams();
19
  const { data: profile } = useFetch(`/profile/my-profiles/edit/${uuid}`);
19
  const { data: profile } = useFetch(`/profile/my-profiles/edit/${uuid}`);
20
 
20
 
21
  const {
21
  const {
22
    user_experiences = [],
22
    user_experiences = [],
23
    user_educations = [],
23
    user_educations = [],
24
    formatted_address = '',
24
    formatted_address = '',
25
    user_languages = {},
25
    user_languages = {},
26
    user_skills = {},
26
    user_skills = {},
27
    user_aptitudes = {},
27
    user_aptitudes = {},
28
    user_hobbies_and_interests = {}
28
    user_hobbies_and_interests = {}
29
  } = profile;
29
  } = profile;
30
 
30
 
31
  return (
31
  return (
32
    <Grid container spacing={1}>
-
 
33
      <Grid
-
 
34
        item
-
 
35
        xs={12}
-
 
36
        sx={{
-
 
37
          display: 'flex',
-
 
38
          flexDirection: 'column',
32
    <Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
39
          gap: 1
-
 
40
        }}
-
 
41
      >
-
 
42
        <ProfileCard
33
      <ProfileCard
43
          cover={profile.cover}
34
        cover={profile.cover}
44
          avatar={profile.image}
35
        avatar={profile.image}
45
          name={profile.full_name}
36
        name={profile.full_name}
46
          description={profile.overview}
37
        description={profile.overview}
47
          address={profile.formatted_address}
38
        address={profile.formatted_address}
48
          coverUrl={profile.link_cover_upload}
39
        coverUrl={profile.link_cover_upload}
49
          avatarUrl={profile.link_image_upload}
40
        avatarUrl={profile.link_image_upload}
50
          coverSize={profile.image_size_cover}
41
        coverSize={profile.image_size_cover}
51
          avatarSize={profile.image_size_profile}
42
        avatarSize={profile.image_size_profile}
52
          requestConnection={profile.request_connection}
43
        requestConnection={profile.request_connection}
53
          linkRequest={profile.link_request}
44
        linkRequest={profile.link_request}
54
          linkCancel={profile.link_cancel}
45
        linkCancel={profile.link_cancel}
55
          linkInmail={profile.link_inmail}
46
        linkInmail={profile.link_inmail}
56
          following={profile.following}
47
        following={profile.following}
57
          totalConnections={profile.follower}
48
        totalConnections={profile.follower}
58
          facebook={profile.facebook}
49
        facebook={profile.facebook}
59
          twitter={profile.twitter}
50
        twitter={profile.twitter}
60
          instagram={profile.instagram}
51
        instagram={profile.instagram}
61
          edit
52
        edit
62
        />
53
      />
63
 
54
 
64
        <ExperiencesCard experiences={user_experiences} uuid={uuid} edit />
55
      <ExperiencesCard experiences={user_experiences} uuid={uuid} edit />
65
 
56
 
66
        <EducationsCard educations={user_educations} uuid={uuid} edit />
57
      <EducationsCard educations={user_educations} uuid={uuid} edit />
67
 
58
 
68
        <LocationCard address={formatted_address} uuid={uuid} edit />
59
      <LocationCard address={formatted_address} uuid={uuid} edit />
69
 
60
 
70
        <LanguagesCard languages={formatObjectToArray(user_languages)} uuid={uuid} edit />
61
      <LanguagesCard languages={formatObjectToArray(user_languages)} uuid={uuid} edit />
71
 
62
 
72
        <SkillsCard skills={formatObjectToArray(user_skills)} uuid={uuid} edit />
63
      <SkillsCard skills={formatObjectToArray(user_skills)} uuid={uuid} edit />
73
 
64
 
74
        <AptitudesCard aptitudes={formatObjectToArray(user_aptitudes)} uuid={uuid} edit />
65
      <AptitudesCard aptitudes={formatObjectToArray(user_aptitudes)} uuid={uuid} edit />
75
 
66
 
76
        <HobbiesCard hobbies={formatObjectToArray(user_hobbies_and_interests)} uuid={uuid} edit />
67
      <HobbiesCard hobbies={formatObjectToArray(user_hobbies_and_interests)} uuid={uuid} edit />
77
      </Grid>
-
 
78
    </Grid>
68
    </Box>
79
  );
69
  );
80
};
70
};
81
 
71
 
82
export default ProfileEditLayout;
72
export default ProfileEditLayout;