Rev 5483 | Rev 5489 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React, { useEffect } from 'react'
import { useDispatch } from 'react-redux'
import { setIntlLabels } from '../../../../redux/intl/intl.action'
import EmptySection from '../../../../shared/empty-section/EmptySection'
import SuggestWidget from '../../../../shared/helpers/my-groups-helper/SuggestWidget'
import ProfileInfo from '../../../components/ProfileInfo'
import Overview from '../../../components/overview/Overview'
import Experiences from '../../../components/experiences/Experiences'
import Educations from '../../../components/educations/Educations'
import Location from '../../../components/location/Location'
import Languages from '../../../components/languages/Languages'
import Skills from '../../../components/skills/Skills'
const View = ({
userIdEncrypted,
cover,
overview,
userExperiences,
userEducations,
formatted_address,
months,
userLanguages,
userSkills,
userAptitudes,
userHobbiesAndInterests,
CancelConnectionUrl,
RequestConnectionUrl,
profileId,
labels,
...profileProps
}) => {
const dispatch = useDispatch()
useEffect(() => {
dispatch(setIntlLabels(labels))
}, [])
return (
<>
<section className="cover-sec">
<img
id="user-cover-img"
src={`/storage/type/user-cover/code/${userIdEncrypted}/${
cover ? `filename/${cover}` : ''
}`}
alt=""
/>
</section>
<main className="main-section-data container px-0">
<ProfileInfo
{...profileProps}
id={userIdEncrypted}
cancelUrl={CancelConnectionUrl}
connectUrl={RequestConnectionUrl}
/>
<section className="feed-section">
<Overview overview={overview} />
<Experiences experiences={userExperiences} months={months} />
<Educations educations={userEducations} />
<Location address={formatted_address} />
<Languages languages={userLanguages} />
<Skills skills={userSkills} />
<div className="user-profile-extended-ov">
<h3>{labels.APTITUDES}</h3>
{!userAptitudes.length ? (
<EmptySection align="left" message={labels.EMPTY} />
) : (
<ul id="list-skills">
{userAptitudes.map(({ name, value }) => (
<li key={value}>
<a href="#" title="">
{name}
</a>
</li>
))}
</ul>
)}
</div>
<div className="user-profile-extended-ov">
<h3>{labels.HOBBIES_AND_INTERESTS}</h3>
{!userHobbiesAndInterests.length ? (
<EmptySection align="left" message={labels.EMPTY} />
) : (
<ul id="list-skills">
{userHobbiesAndInterests.map(({ name, value }) => (
<li key={value}>
<a href="#" title="">
{name}
</a>
</li>
))}
</ul>
)}
</div>
</section>
<SuggestWidget
url={`/helpers/people-viewed-profile/${profileId}`}
btnLabelAccept="Ver perfil"
title="Quien ha visitado esta perfil"
/>
</main>
</>
)
}
export default View