Rev 6704 | Rev 6706 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React, { useEffect, useState, useRef } from 'react'import SuggestWidget from '../../../widgets/default/SuggestWidget'import useOutsideClick from '../../../../hooks/useOutsideClick'import ProfileInfo from '../../../widgets/default/ProfileWidget'const ResponsiveNavbar = ({show,image,name,description,visits,country,connections,linkAdmin,linkImpersonate,}) => {const [shouldRender, setShouldRender] = useState(show)const responsiveNavbar = useRef()useOutsideClick(responsiveNavbar, () => setShouldRender(false))useEffect(() => {setShouldRender(show)}, [show])return (<navclassName={`responsiveNavbar ${shouldRender ? 'slideIn' : 'slideOut'} p-0`}ref={responsiveNavbar}><ProfileInfoconnections={connections}country={country}description={description}visits={visits}image={image}linkAdmin={linkAdmin}linkImpersonate={linkImpersonate}name={name}/><SuggestWidget title="Mis Grupos:" url="/helpers/my-groups" /><SuggestWidget title="Grupos:" url="/helpers/groups-suggestion" /></nav>)}export default ResponsiveNavbar