Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /home/claqxcrl/anfangola.com/wp-content/plugins/blockspare/admin/components/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/claqxcrl/anfangola.com/wp-content/plugins/blockspare/admin/components/MobileMenu.js
import React, {useState, useEffect } from 'react'
import { mobileMenu, menuClose } from '../data/icons'

const MobileMenu = ({ current, activeNavHandler }) => {
    const [active, setActive] = useState(false)
    const menuHandler = () => {
        setActive(!active)
    }
    const menuActiveItemHandler = (i) => {
        activeNavHandler(i)
        setActive(false)
    }
    useEffect(() => {
        if(active) {
            document.body.style.overflow = "hidden";
        }
        return () => (document.body.style.overflow = "scroll");
    },[active]);
    return (
        <>
            <div className='mobile-menu-icon' onClick={menuHandler}>
                {mobileMenu}
            </div>
            {active && (
                <div className="mobile-menu-content">
                    <div className="mobile-menu-close" onClick={() => setActive(false)}>
                        {menuClose}
                    </div>
                    <nav className="navigation-items-mobile">
                        {navs.map((item, i) => (
                            <a key={i} className={`navigation-item ${current === i ? "active" : " "}`} onClick={() => menuActiveItemHandler(i)}>{item.title}</a>
                        ))}
                    </nav>
                </div>
            )}
        </>
    )
}

export default MobileMenu


const navs = [
    {
        title: "Welcome",
    },
    // {
    //     title: "Blocks",
    // },
    {
        title: "Designs"
    },
    // {
    //     title: "Settings",
    // },
    // {
    //     title: "Colors"
    // },
    // {
    //     title: "Typography"
    // }
]

ZeroDay Forums Mini