Proyectos de Subversion LeadersLinked - SPA

Rev

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

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