import variables from 'config/variables'; import { Suspense, lazy, useState, memo } from 'react'; import { MdSettings, MdOutlineShoppingBasket, MdOutlineExtension, MdClose } from 'react-icons/md'; import { motion, AnimatePresence } from 'framer-motion'; import { Button } from 'components/Elements'; import './scss/index.scss'; import { Tooltip } from 'components/Elements'; /*import Settings from '../../../features/misc/views/Settings'; import Addons from '../../../features/misc/views/Addons'; import Marketplace from '../../../features/misc/views/Marketplace';*/ const Settings = lazy(() => import('../../../features/misc/views/Settings')); const Addons = lazy(() => import('../../../features/misc/views/Addons')); const Marketplace = lazy(() => import('../../../features/misc/views/Marketplace')); const renderLoader = () => (
Mue
{variables.getMessage('modals.main.loading')}
); const navbarLogo = ( ); let tabs = [ { id: 'settings', label: 'Settings', icon: }, { id: 'addons', label: 'Addons', icon: }, { id: 'marketplace', label: 'Marketplace', icon: }, ]; function MainModal({ modalClose }) { let [activeTab, setActiveTab] = useState(tabs[0].id); const [direction, setDirection] = useState(1); const variants = { enter: (direction) => ({ x: direction > 0 ? '100%' : '-100%', opacity: 0, overflow: 'none', top: '80px', position: 'absolute', width: '100%', }), center: { x: 0, opacity: 1, overflow: 'none', top: '80px', position: 'absolute', width: '100%', }, exit: (direction) => ({ x: direction < 0 ? '100%' : '-100%', opacity: 0, overflow: 'none', top: '80px', position: 'absolute', width: '100%', }), }; const changeTab = (type) => { const currentIndex = tabs.findIndex((tab) => tab.id === activeTab); const newIndex = tabs.findIndex((tab) => tab.id === type); setDirection(newIndex > currentIndex ? 1 : -1); setActiveTab(type); }; const renderTab = () => { switch (activeTab) { case 'addons': return ; case 'marketplace': return ; default: return ; } }; return ( <>
{navbarLogo}
{tabs.map((tab) => ( ))}
{renderTab()}
); } const MemoizedMainModal = memo(MainModal); export { MemoizedMainModal as default, MemoizedMainModal as MainModal };