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', links: [ {to: '/videos', text: 'Newest Videos', exact: true}, {to: '/videos/favorites', text: 'Favorites', exact: true}, {to: '/videos/channel', text: 'Channels', exact: true}, {to: '/videos/manage', text: 'Manage', exact: true}, ] }, {text: 'Inventory', to: '/inventory', exact: true}, {text: 'Archive', to: '/archive', exact: true}, {text: 'Files', to: '/files', exact: true}, { 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 Link(props) { 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 () })} ) }