Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3691 | | Comparar con el anterior | Ultima modificación | Ver Log |

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