diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index 34f6d1b8d..9a53658b5 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -11,24 +11,22 @@ import Account from './account.navitem.jsx'; const { both: RecentNavItem } = RecentNavItems; import Nav from './nav.jsx'; -const Navbar = ({ account, brew, title, props }) => { +const Navbar = ({ account, brew, title = '', props }) => { const version = global.version || '0.0.0'; - - const isMac = navigator.platform.toUpperCase().includes("MAC"); - const mod = isMac ? "⌘" : "Ctrl"; + const isMac = navigator.platform.toUpperCase().includes('MAC'); + const mod = isMac ? '⌘' : 'Ctrl'; const renderTitle = () => { - //if vault const cleanTitle = title.replace(/^\/+|\/+$/g, ''); if (!brew.shareId) return {cleanTitle || 'Home'}; return ( - + {brew.title} ); }; - const renderEdit = () => { + const renderEditLink = () => { if (!brew.editId) return null; const editLink = brew.googleId && !brew.stubbed ? brew.googleId + brew.editId : brew.editId; @@ -40,60 +38,72 @@ const Navbar = ({ account, brew, title, props }) => { ); }; + const renderFile = () => { + return ( + File>} icon={null} key={'file'}> + + Save document + + + Get txt + + + + Delete File + Publish File + Transfer File + + + ); + }; + + const renderEdit = () => { + return ( + Edit>} icon={null} key={'edit'}> + + + Undo + + Redo + cut + copy + paste + Find / Replace + + + ); + }; + + const renderGo = () => { + return ( + Go>} icon={null} key={'go'}> + + + Patreon + + + Vault + + + Changelog + + + Recent Brews>} icon={null} key={'recent'}> + + + + ); + }; + return ( Home - File>} icon={null} key={'file'}> - - Save document - - - Get txt - - - - Delete File - Publish File - Transfer File - - - Edit>} icon={null} key={'edit'}> - - Undo - Redo - cut - copy - paste - Find / Replace - - - Go>} icon={null} key={'go'}> - - - Patreon - - - Vault - - - Changelog - - - - - brews - - - account - - - Recent Brews>} icon={null} key={'recent'}> - - - + {renderFile()} + {renderEdit()} + {renderGo()} Help>} icon={null} key={'help'}> diff --git a/client/homebrew/navbar/navbar.less b/client/homebrew/navbar/navbar.less index 5597d7746..a83d5faf2 100644 --- a/client/homebrew/navbar/navbar.less +++ b/client/homebrew/navbar/navbar.less @@ -229,8 +229,13 @@ } .navItem, .menu-wrapper { + --activeTriggerColor: #666; + + &:has(ul):not(:has(ul button:not(:disabled))) { + color:grey; //faux disabled if all buttons are disabled + } &:hover { - background: #555; + background: #484848; } &:has(> i, > kbd) { display: flex; @@ -298,7 +303,6 @@ } .navItem { - height: 2em; &.header { justify-content: center; @@ -328,9 +332,14 @@ text-transform: capitalize; padding-bottom: 5px; - .nav-section:not(:last-child, + .header) { + .navItem { + min-height:2.2em; + } + + .nav-section:not(:last-child, :has(+ .header)) { border-bottom: 1px solid; - margin-bottom: 10px; + padding-bottom:5px; + margin-bottom: 5px; } li { diff --git a/client/homebrew/navbar/print.navitem.jsx b/client/homebrew/navbar/print.navitem.jsx index ff2d75d67..32dce6989 100644 --- a/client/homebrew/navbar/print.navitem.jsx +++ b/client/homebrew/navbar/print.navitem.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import Nav from './nav.jsx'; import { printCurrentBrew } from '@shared/helpers.js'; -export default function(){ +export default function({disabled}){ const [printing, setPrinting] = useState(false); // listen for print cycle events to display "loading" message since it can take some time. @@ -19,7 +19,7 @@ export default function(){ const handlePrintPrepFinished = ()=>{ setPrinting(false); }; - return + return {printing ? 'loading' : 'get PDF'} ; };