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