@codesinger0/shared-components 1.1.45 → 1.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Menu.jsx +32 -32
- package/package.json +1 -1
package/dist/components/Menu.jsx
CHANGED
|
@@ -60,27 +60,51 @@ const Menu = ({
|
|
|
60
60
|
onMenuItemClick(item);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
// Desktop Menu Component
|
|
64
63
|
const DesktopMenu = () => (
|
|
65
64
|
<nav className="sticky top-0 z-50 bg-menu border-b-2 border-primary">
|
|
66
65
|
{/* Parent container with two vertically stacked sections */}
|
|
67
66
|
<div className="w-full">
|
|
68
67
|
|
|
69
|
-
{/* Top section - Children content
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
{/* Top section - Logo and Children content */}
|
|
69
|
+
<div className="w-full flex items-center pt-4 px-6">
|
|
70
|
+
{/* Logo - takes only required space */}
|
|
71
|
+
<Link to="/" className={`flex-shrink-0 ${logoClassName}`}>
|
|
72
|
+
<div className="relative w-24 h-12 lg:w-32 lg:h-16 overflow-hidden flex items-center justify-center">
|
|
73
|
+
<img
|
|
74
|
+
src={businessInfo.logo}
|
|
75
|
+
alt={businessInfo.name}
|
|
76
|
+
className="relative z-10 w-full h-full object-contain"
|
|
77
|
+
onError={(e) => {
|
|
78
|
+
e.target.style.display = 'none';
|
|
79
|
+
e.target.nextElementSibling.style.display = 'flex';
|
|
80
|
+
}}
|
|
81
|
+
/>
|
|
82
|
+
{/* Fallback text */}
|
|
83
|
+
<div
|
|
84
|
+
className="relative z-10 w-full h-full flex items-center justify-center text-primary text-xs font-bold"
|
|
85
|
+
style={{ display: 'none' }}
|
|
86
|
+
>
|
|
87
|
+
{businessInfo.name?.slice(0, 2) || ''}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</Link>
|
|
91
|
+
|
|
92
|
+
{/* Children - grows to fill available space */}
|
|
93
|
+
<div className="flex-grow">
|
|
94
|
+
{children && (
|
|
95
|
+
{ children }
|
|
96
|
+
)}
|
|
73
97
|
</div>
|
|
74
|
-
|
|
98
|
+
</div>
|
|
75
99
|
|
|
76
100
|
{/* Bottom section - Menu navigation bar */}
|
|
77
|
-
<div className="w-full px-6
|
|
101
|
+
<div className="w-full px-6 pb-2 flex justify-between items-center">
|
|
78
102
|
{/* Left side - Auth buttons */}
|
|
79
103
|
<div className="flex items-center">
|
|
80
104
|
{AuthButtonsComponent && <AuthButtonsComponent />}
|
|
81
105
|
</div>
|
|
82
106
|
|
|
83
|
-
{/*
|
|
107
|
+
{/* Right side - Menu items */}
|
|
84
108
|
<div className="flex items-center space-x-6 space-x-reverse" dir="rtl">
|
|
85
109
|
{navigationItems.map((item, index) => (
|
|
86
110
|
item.adminRoute && !isAdmin ? null : (
|
|
@@ -95,30 +119,6 @@ const Menu = ({
|
|
|
95
119
|
)
|
|
96
120
|
))}
|
|
97
121
|
</div>
|
|
98
|
-
|
|
99
|
-
{/* Right side - Logo */}
|
|
100
|
-
<Link to="/" className={`text-primary font-bold text-xl ml-8 ${logoClassName}`}>
|
|
101
|
-
<div className="text-primary font-bold text-xl ml-8">
|
|
102
|
-
<div className="relative w-24 h-12 lg:w-32 lg:h-16 overflow-hidden flex items-center justify-center">
|
|
103
|
-
<img
|
|
104
|
-
src={businessInfo.logo}
|
|
105
|
-
alt={businessInfo.name}
|
|
106
|
-
className="relative z-10 w-full h-full object-contain"
|
|
107
|
-
onError={(e) => {
|
|
108
|
-
e.target.style.display = 'none';
|
|
109
|
-
e.target.nextElementSibling.style.display = 'flex';
|
|
110
|
-
}}
|
|
111
|
-
/>
|
|
112
|
-
{/* Fallback text */}
|
|
113
|
-
<div
|
|
114
|
-
className="relative z-10 w-full h-full flex items-center justify-center text-primary text-xs font-bold"
|
|
115
|
-
style={{ display: 'none' }}
|
|
116
|
-
>
|
|
117
|
-
{businessInfo.name?.slice(0, 2) || ''}
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
</Link>
|
|
122
122
|
</div>
|
|
123
123
|
</div>
|
|
124
124
|
</nav>
|