import * as React from 'react'; import AppBar from '@mui/material/AppBar'; import Avatar from '@mui/material/Avatar'; import Box from '@mui/material/Box'; import CssBaseline from '@mui/material/CssBaseline'; import Divider from '@mui/material/Divider'; import Drawer from '@mui/material/Drawer'; import IconButton from '@mui/material/IconButton'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import ListItemButton from '@mui/material/ListItemButton'; import ListItemIcon from '@mui/material/ListItemIcon'; import ListItemText from '@mui/material/ListItemText'; import MenuIcon from '@mui/icons-material/Menu'; import Toolbar from '@mui/material/Toolbar'; import Typography from '@mui/material/Typography'; // import Link from '@mui/material/Link'; import LandingIcon from '@mui/icons-material/Home'; import ProjIcon from '@mui/icons-material/AccountTree'; import ExpIcon from '@mui/icons-material/Work'; import SkilIcon from '@mui/icons-material/Laptop'; import IntsIcon from '@mui/icons-material/SportsEsports'; import ArticleIcon from '@mui/icons-material/Article'; import Landing from './Landing'; // import LoremIpsum from './LoremIpsum'; import Projects from './Projects'; import Career from './Career'; import { handleLinkClick } from '../utils/linkClick'; import UnderConstruction from './UnderConstruction'; const drawerWidth = 240; const menuSections = [ { key: 'landing', display_name: 'Home', appbar_text: 'Hello There!', display_icon: , extLink: false, component: }, { key: 'proj', display_name: 'Projects', appbar_text: 'My Projects', display_icon: , extLink: false, component: }, { key: 'exp', display_name: 'Career', appbar_text: 'My Journey', display_icon: , extLink: false, component: }, { key: 'skil', display_name: 'Skills', appbar_text: 'My Skills', display_icon: , extLink: false, component: }, { key: 'ints', display_name: 'Interests', appbar_text: 'My Interests', display_icon: , extLink: false, component: }, { key: 'resume', display_name: 'Resume', appbar_text: 'My Resume', display_icon: , extLink: true, link: process.env.PUBLIC_URL + "myresume.pdf" }, ]; export default function Menu(props) { const { window } = props; const [mobileOpen, setMobileOpen] = React.useState(false); const [activeSection, setActiveSection] = React.useState(menuSections[0]); const handleDrawerToggle = () => { setMobileOpen(!mobileOpen); }; const handleDrawerSelect = (selectedSectionKey) => { handleDrawerToggle(); const menuSection = menuSections.filter((menuItem) => menuItem.key === selectedSectionKey)[0]; if (menuSection.extLink === true) { handleLinkClick(menuSection.link); return; } setActiveSection(menuSection); } const drawer = (
{/* */} Kaushik Narayan Ravishankar {menuSections.map((menuItem, index) => ( { handleDrawerSelect(menuItem.key); }} key={menuItem.key} disablePadding> {menuItem.display_icon} ))} {/* Made with MUI */}
); const container = window !== undefined ? () => window().document.body : undefined; return ( {activeSection.appbar_text} {drawer} {drawer} {/* content goes here */} {activeSection.component} ); }