feat: add funcionalidade abre e fecha no footer

This commit is contained in:
Mateus Antonio Rodrigues Lopes 2023-01-08 12:08:13 -03:00
parent de0c5f430f
commit c3a67c2fa1

View File

@ -0,0 +1,35 @@
import React, { useState } from 'react'
interface IFooterMenuProps{
title: string;
content1: string;
content2: string;
content3: string;
content4: string;
}
const FooterMenu = (props: IFooterMenuProps) => {
const [isActive, setIsActive] = useState(false)
return (
<div className="footer-menu-item">
<div
className="footer-menu-title"
onClick={() => setIsActive(!isActive)}
>
<div>{props.title}</div>
<div className='close-open-menu'>{isActive ? '-' : '+'}</div>
</div>
{isActive && (
<>
<li className="footer-menu-content">{props.content1}</li>
<li className="footer-menu-content">{props.content2}</li>
<li className="footer-menu-content">{props.content3}</li>
<li className="footer-menu-content">{props.content4}</li>
</>
)}
</div>
)
}
export default FooterMenu