Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,359 changes: 2,092 additions & 1,267 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/components/Header/HeaderRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@ import { useLocation } from 'react-router-dom';
import { connect } from 'react-redux';
import { getWeeklySummaries } from '~/actions/weeklySummaries';
import { Header } from './Header';
import KitchenHeader from '../KitchenInterfaces/KitchenHeader';
import { getHeaderData } from '../../actions/authActions';
import { getAllRoles } from '../../actions/role';
import hasPermission from '../../utils/permissions';

export function HeaderRenderer(props) {
const location = useLocation();
const isCommunityPortal = location.pathname.startsWith('/communityportal');
const isKitchenInterface = location.pathname.startsWith('/kitchenandinventory');
const isEducationEvaluation = location.pathname.startsWith('/educationportal/evaluation-results');

// Hide header for education portal evaluation results page
if (isEducationEvaluation) {
return null;
}

if (isKitchenInterface) {
return <KitchenHeader />;
}

// eslint-disable-next-line react/jsx-props-no-spreading
return isCommunityPortal ? <CPHeader {...props} /> : <Header {...props}/>;
}
Expand Down
74 changes: 74 additions & 0 deletions src/components/KitchenInterfaces/KitchenHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React, { useState } from 'react';
import { NavLink } from 'react-router-dom';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faBars, faTimes } from '@fortawesome/free-solid-svg-icons';
import styles from './KitchenHeader.module.css';

const KitchenHeader = () => {
const [isMenuOpen, setIsMenuOpen] = useState(false);

const NAV_ITEMS = [
{ name: 'Dashboard', path: '/kitchenandinventory/dashboard' },
{ name: 'Production', path: '/kitchenandinventory/production', isDropdown: true },
{ name: 'Processing', path: '/kitchenandinventory/processing' },
{ name: 'Recipes', path: '/kitchenandinventory/recipes' },
{ name: 'Inventory', path: '/kitchenandinventory/inventory' },
{ name: 'Orders', path: '/kitchenandinventory/orders' },
{ name: 'Reports', path: '/kitchenandinventory/reports' },
{ name: 'Food Bars', path: '/kitchenandinventory/foodbars' },
];

const toggleMenu = () => setIsMenuOpen(!isMenuOpen);

return (
<header className={styles.headerContainer}>
<div className={styles.brandSection}>
<div className={styles.brandTextContainer}>
<span className={styles.brandTitle}>Transition Kitchen</span>
<span className={styles.brandSubtitle}>One Community Global</span>
</div>
</div>

<button className={styles.menuToggle} onClick={toggleMenu} aria-label="Toggle navigation">
<FontAwesomeIcon icon={isMenuOpen ? faTimes : faBars} />
</button>

<nav className={`${styles.navContainer} ${isMenuOpen ? styles.navOpen : ''}`}>
{NAV_ITEMS.map(item => (
<NavLink
key={item.name}
to={item.path}
className={styles.navItem}
activeClassName={styles.activeLink}
onClick={() => setIsMenuOpen(false)} // Close menu on click
isActive={match => {
if (!match) return false;
return true;
}}
>
{item.name}
{item.isDropdown && <span className={styles.dropdownArrow}>▼</span>}
</NavLink>
))}
</nav>

{/* Overlay for mobile when menu is open */}
{isMenuOpen && (
<div
className={styles.overlay}
onClick={() => setIsMenuOpen(false)}
onKeyDown={e => {
if (e.key === 'Enter' || e.key === ' ') {
setIsMenuOpen(false);
}
}}
role="button"
tabIndex={0}
aria-label="Close menu"
/>
)}
</header>
);
};

export default KitchenHeader;
167 changes: 167 additions & 0 deletions src/components/KitchenInterfaces/KitchenHeader.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
.headerContainer {
background-color: #ffffff;
border-bottom: 1px solid #e0e0e0;
padding: 0 32px;
height: 64px;
display: flex;
align-items: center;
justify-content: space-between;
font-family: 'Inter', sans-serif;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
position: sticky;
top: 0;
z-index: 1000;
}

/* Left side: Logo & Brand */
.brandSection {
display: flex;
align-items: center;
gap: 12px;
}

.logoImage {
height: 40px;
width: auto;
border-radius: 8px; /* Slight rounding if square */
}

.brandTextContainer {
display: flex;
flex-direction: column;
white-space: nowrap;
}

.brandTitle {
font-size: 16px;
font-weight: 600;
color: #333;
line-height: 1.2;
}

.brandSubtitle {
font-size: 11px;
color: #888;
text-transform: uppercase;
letter-spacing: 0.5px;
}

/* Center-Right: Navigation */
.navContainer {
display: flex;
gap: 8px;
align-items: center;
}

.navItem {
text-decoration: none;
color: #555;
font-size: 14px;
font-weight: 500;
padding: 8px 16px;
border-radius: 20px;
transition: all 0.2s ease;
white-space: nowrap;
}

.navItem:hover {
background-color: #f5f5f5;
color: #333;
text-decoration: none;
}

/* Active State */
.activeLink {
background-color: #e6f4ea; /* Light green background */
color: #2e7d32; /* Darker green text */
font-weight: 600;
}
.activeLink:hover {
background-color: #dcedc8;
color: #1b5e20;
}

/* Dropdown Arrow Indicator (simple css triangle or unicode) */
.dropdownArrow {
font-size: 10px;
margin-left: 4px;
color: #777;
}

/* Mobile Menu Button */
.menuToggle {
display: none;
background: none;
border: none;
font-size: 24px;
color: #333;
cursor: pointer;
}

/* Background Overlay */
.overlay {
display: none;
}


/* Responsive Adjustments */
@media (max-width: 900px) {
.headerContainer {
padding: 0 16px;
height: 64px; /* Fixed height again */
flex-wrap: nowrap; /* Prevent wrap */
padding-bottom: 0;
padding-top: 0;
}

.brandTextContainer {
white-space: nowrap;
}

.menuToggle {
display: block;
}

.navContainer {
position: absolute;
top: 64px;
left: 0;
width: 100%;
background-color: white;
flex-direction: column;
padding: 16px 0;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
transform: translateY(-150%);
transition: transform 0.3s ease-in-out;
z-index: 999;
align-items: flex-start;
}

.navOpen {
transform: translateY(0);
}

.navItem {
width: 100%;
padding: 12px 24px;
border-radius: 0;
}

/* Overlay */
.overlay {
display: block;
position: fixed;
top: 64px;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.3);
z-index: 998;
}

/* Prevent horizontal scrolling on container overrides */
.navContainer::-webkit-scrollbar {
display: none;
}
}

Loading