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