@codesinger0/shared-components 1.1.47 → 1.1.49
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 +27 -4
- package/package.json +1 -1
package/dist/components/Menu.jsx
CHANGED
|
@@ -66,7 +66,7 @@ const Menu = ({
|
|
|
66
66
|
<div className="w-full">
|
|
67
67
|
|
|
68
68
|
{/* Top section - Logo and Children content */}
|
|
69
|
-
<div className="w-full flex items-center pt-4 px-6">
|
|
69
|
+
{children && (<div className="w-full flex items-center pt-4 px-6">
|
|
70
70
|
{/* Logo - takes only required space */}
|
|
71
71
|
<Link to="/" className={`flex-shrink-0 ${logoClassName}`}>
|
|
72
72
|
<div className="relative w-24 h-12 lg:w-32 lg:h-16 overflow-hidden flex items-center justify-center">
|
|
@@ -91,11 +91,10 @@ const Menu = ({
|
|
|
91
91
|
|
|
92
92
|
{/* Children - grows to fill available space */}
|
|
93
93
|
<div className="flex-grow">
|
|
94
|
-
{children
|
|
95
|
-
{ children }
|
|
96
|
-
)}
|
|
94
|
+
{children}
|
|
97
95
|
</div>
|
|
98
96
|
</div>
|
|
97
|
+
)}
|
|
99
98
|
|
|
100
99
|
{/* Bottom section - Menu navigation bar */}
|
|
101
100
|
<div className="w-full px-6 pb-2 flex justify-between items-center">
|
|
@@ -119,6 +118,30 @@ const Menu = ({
|
|
|
119
118
|
)
|
|
120
119
|
))}
|
|
121
120
|
</div>
|
|
121
|
+
|
|
122
|
+
{/* Render logo here if no children */}
|
|
123
|
+
{!children && (
|
|
124
|
+
<Link to="/" className={`flex-shrink-0 ${logoClassName}`}>
|
|
125
|
+
<div className="relative w-24 h-12 lg:w-32 lg:h-16 overflow-hidden flex items-center justify-center">
|
|
126
|
+
<img
|
|
127
|
+
src={businessInfo.logo}
|
|
128
|
+
alt={businessInfo.name}
|
|
129
|
+
className="relative z-10 w-full h-full object-contain"
|
|
130
|
+
onError={(e) => {
|
|
131
|
+
e.target.style.display = 'none';
|
|
132
|
+
e.target.nextElementSibling.style.display = 'flex';
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
{/* Fallback text */}
|
|
136
|
+
<div
|
|
137
|
+
className="relative z-10 w-full h-full flex items-center justify-center text-primary text-xs font-bold"
|
|
138
|
+
style={{ display: 'none' }}
|
|
139
|
+
>
|
|
140
|
+
{businessInfo.name?.slice(0, 2) || ''}
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</Link>
|
|
144
|
+
)}
|
|
122
145
|
</div>
|
|
123
146
|
</div>
|
|
124
147
|
</nav>
|