Rev 3692 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
import React, { useEffect, useState } from 'react';import { useParams } from 'react-router-dom';import { useDispatch, useSelector } from 'react-redux';import { getBackendVars } from '../../services/backendVars';import ProfileInfo from '../../components/ProfileInfo';import Cover from '../../components/UI/cover/Cover';import Skills from '../../components/profile/skills/SkillsCard';import Location from '../../components/location/Location';import Overview from '../../components/overview/Overview';import Aptitudes from '../../components/profile/aptitudes/AptitudesCard';import Languages from '../../components/profile/languages/LanguagesCard';import Educations from '../../components/educations/Educations';import Experiences from '../../components/experiences/Experiences';import SuggestWidget from '../../components/widgets/default/SuggestWidget';import HobbiesAndInterests from '../../components/profile/hobbies/HobbiesCard.jsx';import { addNotification } from '@app/redux/notification/notification.actions';const ProfileView = () => {const [profile, setProfile] = useState(null);const labels = useSelector(({ intl }) => intl.labels);const { uuid } = useParams();const dispatch = useDispatch();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(([value, label]) => {return { label, value };});});setProfile(vars);}).catch((error) => {dispatch(addNotification({ style: 'danger', msg: error.message }));});}, []);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} edit /><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} /><HobbiesAndInterests hobbiesAndInterest={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;