2902 |
stevensc |
1 |
import React from 'react'
|
|
|
2 |
import { useParams } from 'react-router-dom'
|
5 |
stevensc |
3 |
import { useSelector } from 'react-redux'
|
2902 |
stevensc |
4 |
import { Grid } from '@mui/material'
|
5 |
stevensc |
5 |
|
2902 |
stevensc |
6 |
import { useFetch } from '@hooks'
|
|
|
7 |
import { formatObjectToArray } from '@utils'
|
5 |
stevensc |
8 |
|
2902 |
stevensc |
9 |
import ProfileCard from '@components/profile/ProfileCard'
|
|
|
10 |
import ExperiencesCard from '@components/profile/experiences/ExperiencesCard'
|
|
|
11 |
import EducationsCard from '@components/profile/educations/EducationsCard'
|
|
|
12 |
import LocationCard from '@components/profile/location/LocationCard'
|
|
|
13 |
import LanguagesCard from '@components/profile/languages/LanguagesCard'
|
|
|
14 |
import SkillsCard from '@components/profile/skills/SkillsCard'
|
|
|
15 |
import AptitudesCard from '@components/profile/aptitudes/AptitudesCard'
|
|
|
16 |
import HobbiesCard from '@components/profile/hobbies/HobbiesCard'
|
|
|
17 |
import SuggestWidget from '@components/widgets/default/SuggestWidget'
|
|
|
18 |
|
5 |
stevensc |
19 |
const ProfileViewPage = () => {
|
2902 |
stevensc |
20 |
const { uuid } = useParams()
|
|
|
21 |
const { data: profile } = useFetch(`/profile/view/${uuid}`)
|
|
|
22 |
const labels = useSelector(({ intl }) => intl.labels)
|
5 |
stevensc |
23 |
|
2902 |
stevensc |
24 |
return (
|
|
|
25 |
<Grid container spacing={2}>
|
2907 |
stevensc |
26 |
<Grid item container xs={12} md={8} spacing={2}>
|
2902 |
stevensc |
27 |
<ProfileCard {...profile} />
|
|
|
28 |
|
|
|
29 |
<ExperiencesCard experiences={profile?.user_experiences} uuid={uuid} />
|
|
|
30 |
|
|
|
31 |
<EducationsCard educations={profile?.user_educations} uuid={uuid} />
|
|
|
32 |
|
|
|
33 |
<LocationCard address={profile?.formatted_address} uuid={uuid} />
|
|
|
34 |
|
|
|
35 |
<LanguagesCard
|
|
|
36 |
languages={formatObjectToArray(profile?.user_languages)}
|
|
|
37 |
uuid={uuid}
|
|
|
38 |
/>
|
|
|
39 |
|
|
|
40 |
<SkillsCard
|
|
|
41 |
skills={formatObjectToArray(profile?.user_skills)}
|
|
|
42 |
uuid={uuid}
|
|
|
43 |
/>
|
|
|
44 |
|
|
|
45 |
<AptitudesCard
|
|
|
46 |
aptitudes={formatObjectToArray(profile?.user_aptitudes)}
|
|
|
47 |
uuid={uuid}
|
|
|
48 |
/>
|
|
|
49 |
|
|
|
50 |
<HobbiesCard
|
|
|
51 |
hobbies={formatObjectToArray(profile?.user_hobbies_and_interests)}
|
|
|
52 |
uuid={uuid}
|
|
|
53 |
/>
|
|
|
54 |
</Grid>
|
|
|
55 |
|
|
|
56 |
<Grid item xs={12} md={4}>
|
|
|
57 |
{profile?.user_profile_id && (
|
|
|
58 |
<SuggestWidget
|
|
|
59 |
url={`/helpers/people-viewed-profile/${profile?.user_profile_id}`}
|
|
|
60 |
title={labels.who_has_seen_this_profile}
|
|
|
61 |
/>
|
|
|
62 |
)}
|
|
|
63 |
</Grid>
|
|
|
64 |
</Grid>
|
|
|
65 |
)
|
5 |
stevensc |
66 |
}
|
|
|
67 |
|
|
|
68 |
export default ProfileViewPage
|