import React from "react"; import {NavLink} from "react-router-dom"; import {Dropdown, Menu, Responsive} from "semantic-ui-react"; const responsiveWidth = 500; const links = [ {text: 'Videos', to: '/videos'}, {text: 'Inventory', to: '/inventory'}, {text: 'Archive', to: '/archive'}, {text: 'Files', to: '/files'}, { text: 'Apps', links: [ {to: '/apps/otp', text: 'One Time Pad', exact: true}, ] }, ]; const admin = {to: '/admin', text: 'Admin', exact: true}; const rightLinks = [admin,]; const collapsedLinks = links.concat([admin,]); function DropdownLinks(props) { return ( {props.link.links.map((l) => { return ( ) })} ) } function MenuLink(props) { // Wrapper around NavLink to handle Navlink/Dropdown change. let classes = 'item'; if (props.link.header) { classes = `${classes} header`; } if (!props.link.links) { return ( {props.link.text} ) } else { return ( ) } } export function NavBar() { return ( {/*Always show WROLPi home button*/} {/*Show the links in a menu when on desktop*/} {links.map((link) => { return ( ) })} {rightLinks.map((link) => { return () })} {/*Show the menu items in a dropdown when on mobile*/} {collapsedLinks.map((link) => { return () })} ) }