AutorÃa | Ultima modificación | Ver Log |
import React, { useEffect, useState } from 'react'import { useParams } from 'react-router-dom'import { useSelector } from 'react-redux'import { getBackendVars } from '../../services/backendVars'import ProfileInfo from '../../components/ProfileInfo'import Cover from '../../components/cover/Cover'import Skills from '../../components/skills/Skills'import Location from '../../components/location/Location'import Overview from '../../components/overview/Overview'import Aptitudes from '../../components/aptitudes/Aptitudes'import Languages from '../../components/languages/Languages'import Educations from '../../components/educations/Educations'import Experiences from '../../components/experiences/Experiences'import SuggestWidget from '../../components/widgets/default/SuggestWidget'import HobbiesAndInterests from '../../components/hobbies-and-interests/HobbiesAndInterests'const ProfileView = () => {const [profile, setProfile] = useState(null)const labels = useSelector(({ intl }) => intl.labels)const { uuid } = useParams()useEffect(() => {getBackendVars(`/profile/view/${uuid}`).then((vars) => {const adapters = ['user_hobbies_and_interests','user_skills','user_aptitudes','user_languages',]adapters.forEach((adapter) => {vars[adapter] = Object.entries(vars[adapter]).map(([key, value]) => {return { name: value, value: key }})})setProfile(vars)}).catch((err) => {console.log(`Error: ${err}`)throw new Error(err)})}, [])return (<><Cover cover={profile?.cover} /><main className="main-section-data container px-0"><ProfileInfo{...profile}fullName={profile?.full_name}linkInmail={profile?.link_inmail}showContact={profile?.show_contact}id={profile?.user_uuid}cancelUrl={profile?.link_cancel}connectUrl={profile?.link_request}isEdit/><section className="feed-section"><Overview overview={profile?.overview} isEdit /><Experiences experiences={profile?.user_experiences} /><Educations educations={profile?.user_educations} /><Location address={profile?.formatted_address} /><Languages languages={profile?.user_languages} /><Skills skills={profile?.user_skills} /><Aptitudes aptitudes={profile?.user_aptitudes} /><HobbiesAndInterestshobbiesAndInterest={profile?.user_hobbies_and_interests}/></section><SuggestWidgeturl={`/helpers/people-viewed-profile/${profile?.user_profile_id}`}btnLabelAccept={labels.view_profile}title={labels.who_has_seen_this_profile}/></main></>)}export default ProfileView