diff --git a/client/homebrew/navbar/error-navitem.less b/client/homebrew/navbar/error-navitem.less index 8aeeae212..5882c04c5 100644 --- a/client/homebrew/navbar/error-navitem.less +++ b/client/homebrew/navbar/error-navitem.less @@ -1,69 +1,30 @@ @import '@sharedStyles/core.less'; -@keyframes glideDown { - 0% { - opacity : 0;transform : translate(-50% + 3px, 0px);} - 100% { - opacity : 1;transform : translate(-50% + 3px, 10px);} -} - - .navItem.error { position : relative; background-color : @red; } .errorContainer { - position : absolute; - top : 100%; - left : 50%; - z-index : 1000; width : 140px; - padding : 3px; + padding : 5px !important; font-size : 10px; - font-weight : 800; + line-height: 1.5em; color : white; - text-align : center; text-transform : uppercase; - background-color : #333333; - border : 3px solid #444444; - border-radius : 5px; - transform : translate(-50% + 3px, 10px); - animation-name : glideDown; - animation-duration : 0.4s; + flex-direction: column; + outline:1px solid red; + border:1px solid red; + border-width: 1px 3px; + border-radius:5px; .lowercase { text-transform : none; } a { color : @teal; } - &::before { - position : absolute; - top : -23px; - left : 53px; - width : 0px; - height : 0px; - content : ''; - border-top : 10px solid transparent; - border-right : 10px solid transparent; - border-bottom : 10px solid #444444; - border-left : 10px solid transparent; - } - &::after { - position : absolute; - top : -19px; - left : 53px; - width : 0px; - height : 0px; - content : ''; - border-top : 10px solid transparent; - border-right : 10px solid transparent; - border-bottom : 10px solid #333333; - border-left : 10px solid transparent; - } .deny { display : inline-block; width : 48%; padding : 5px; margin : 1px; - background-color : #333333; - border-left : 1px solid #666666; + background:@orange; .animate(background-color); &:hover { background-color : red; } } @@ -73,7 +34,7 @@ padding : 5px; margin : 1px; color : white; - background-color : #333333; + background:@orange; .animate(background-color); &:hover { background-color : teal; } } diff --git a/client/homebrew/navbar/nav.jsx b/client/homebrew/navbar/nav.jsx index 5815a0692..92b928ffa 100644 --- a/client/homebrew/navbar/nav.jsx +++ b/client/homebrew/navbar/nav.jsx @@ -25,7 +25,7 @@ const Nav = { ; }, - item : ({ icon, kbd,href, newTab, onClick, color, children, className, disabled, ...props })=>{ + item : ({ icon, kbd,href, newTab, onClick, color, children, className, disabled, noDismiss, ...props })=>{ const classes = cx('navItem', color, className); if(disabled) { return @@ -36,57 +36,18 @@ const Nav = { {icon && } ; } else { - return ; } }, - - dropdown : function dropdown(props) { - props = Object.assign({}, props, { - trigger : 'hover click' - }); - - const myRef = useRef(null); - const [showDropdown, setShowDropdown] = useState(false); - - useEffect(()=>{ - document.addEventListener('click', handleClickOutside); - return ()=>{ - document.removeEventListener('click', handleClickOutside); - }; - }, []); - - function handleClickOutside(e) { - // Close dropdown when clicked outside - if(!myRef.current?.contains(e.target)) { - handleDropdown(false); - } - } - - function handleDropdown(show) { - setShowDropdown(show ?? !showDropdown); - } - - const dropdownChildren = React.Children.map(props.children, (child, i)=>{ - if(i < 1) return; - return child; - }); - - return ( -
handleDropdown(true) : undefined } - onMouseLeave = { props.trigger.includes('hover') ? ()=>handleDropdown(false) : undefined } - onClick = { props.trigger.includes('click') ? ()=>handleDropdown(true) : undefined } - > - {props.children[0] || props.children /*children is not an array when only one child*/} - {showDropdown &&
{dropdownChildren}
} -
- ); - } + header: ({span, className, children, ...props})=>{ + return
  • + {children} +
  • ; + }, }; diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index 17e18e444..eb96cb826 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -146,7 +146,7 @@ const Navbar = ({ children, brew, pageName, editor, title, currentPage, props }) ); }; - + console.log(navSlots); return (