import { Button, IconButton, Modal as ModalMui } from '@mui/material' import { Link, matchPath, Outlet, useLocation, useNavigate } from 'react-router-dom' import styles from './style.module.scss' import { appPublicRoutes } from '../../routes' function useRouteMatch(patterns: readonly string[]) { const { pathname } = useLocation() for (let i = 0; i < patterns.length; i += 1) { const pattern = patterns[i] const possibleMatch = matchPath(pattern, pathname) if (possibleMatch !== null) { return possibleMatch } } return null } export const Modal = () => { const navigate = useNavigate() const tabs = [ { to: appPublicRoutes.login, title: 'Login', label: 'Login' }, { to: appPublicRoutes.register, title: 'Register', label: 'Register' }, { to: appPublicRoutes.nostr, title: 'Login', sx: { padding: '10px' }, label: ( nostr logo ) } ] const routeMatch = useRouteMatch(tabs.map((t) => t.to)) const activeTab = routeMatch?.pattern?.path const handleClose = () => { navigate(appPublicRoutes.landingPage) } return (
{/* Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. */}
    {tabs.map((t) => { return (
  • ) })}
) }