diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index f680730ba..d8540f61b 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -15,68 +15,41 @@ import Nav from './nav.jsx'; const Navbar = ({ children, brew, pageName, editor, title, currentPage, props })=>{ const isMac = navigator.platform.toUpperCase().includes('MAC'); const mod = isMac ? '⌘' : 'Ctrl'; - const isBrew = !!brew && (brew.shareId || pageName === 'homePage' || pageName === 'newPage'); - const account = global.account; const navSlots = React.Children.toArray(children).reduce((slots, child)=>{ if(!React.isValidElement(child)) return slots; const content = child.props.children; + //To create new items inside the dropdowns call them with Navbar.[DropdownName] if(child.type === Navbar.File) slots.file = content; else if(child.type === Navbar.Edit) slots.edit = content; else if(child.type === Navbar.Go) slots.go = content; else if(child.type === Navbar.Help) slots.help = content; + //create a new dropdown with Navbar.Menu else if(child.type === Navbar.Menu) slots.menu = content; return slots; }, {}); - const renderDownloadLink = ()=>{ - if(!brew?.shareId) return Get txt; - let shareLink = brew.shareId; - if(brew.googleId && !brew.stubbed) { - shareLink = brew.googleId + shareLink; + const renderFile = ()=>{ + let shareLink = brew?.shareId; + if(brew?.googleId && !brew?.stubbed) { + shareLink = brew?.googleId + shareLink; } - return ( - - Get txt - - ); - }; - - const renderEditLink = ()=>{ - const editLink = brew?.googleId && !brew?.stubbed ? brew?.googleId + brew?.editId : brew?.editId; - return ( - - edit this brew - - ); - }; - - const renderFile = ()=>{ return ( File} icon={null} key={'file'}> -
- - {renderDownloadLink()} -
Clone File - {/* - - Delete File +
+
+ + + Get txt - - Publish File - - - Transfer File - - */}
{navSlots.file}
@@ -104,19 +77,6 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props }) {navSlots.edit} - {/* -
- editor?.cut()} kbd={mod + ' + x'} disabled={!editor}> - cut - - editor?.copy()} kbd={mod + ' + c'} disabled={!editor}> - copy - - editor?.paste()} kbd={mod + ' + v'} disabled={!editor}> - paste - -
- */} ); }; @@ -124,8 +84,6 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props }) const renderGo = ()=>{ return ( Go} icon={null} key={'go'}> - {renderEditLink()} -
Patreon @@ -137,6 +95,7 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props }) Changelog
+ {navSlots.go} Recent Brews} icon={null} key={'recent'}> @@ -145,6 +104,13 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props }) ); }; + const renderHelp = ()=>{ + Help} icon={null} key={'help'}> + + {navSlots.help} + ; + }; + return (