fix(header): update responsive breakpoints (2-row below 470px, 1-row above 470px, desktop nav at 1224px/xl)
- Show 2-row layout below 470px width, and automatically switch to single-row layout for viewports 470px and wider - Shift desktop navigation menu items display breakpoint from 1024px (lg) to 1280px (xl / ~1224px) to prevent action button overflow on medium laptop screens
This commit is contained in:
1 parent
6618a81f33
commit
587407c39a
1 file changed
+11
-11
@@ -104,14 +104,14 @@ export default function Header({
|
||||
</div>
|
||||
|
||||
<header className="sticky top-0 z-50 bg-white/95 backdrop-blur-md border-b border-medical-gray-100 shadow-sm">
|
||||
<div className="max-w-7xl mx-auto py-2 md:py-0 md:h-24 flex flex-col md:flex-row md:items-center justify-between gap-2 md:gap-4 px-3 sm:px-6 lg:px-8" dir="rtl">
|
||||
{/* Row 1 on Mobile: Toggle + Logo */}
|
||||
<div className="flex items-center justify-between md:justify-start gap-2 w-full md:w-auto">
|
||||
<div className="max-w-7xl mx-auto py-2 min-[470px]:py-0 min-[470px]:h-24 flex flex-col min-[470px]:flex-row min-[470px]:items-center justify-between gap-2 min-[470px]:gap-4 px-3 sm:px-6 lg:px-8" dir="rtl">
|
||||
{/* Logo & Mobile Toggle Area */}
|
||||
<div className="flex items-center justify-between min-[470px]:justify-start gap-2 w-full min-[470px]:w-auto">
|
||||
<div className="flex items-center gap-2">
|
||||
{/* Mobile Menu Toggle */}
|
||||
{/* Mobile Menu Toggle (visible below 1224px / xl) */}
|
||||
<button
|
||||
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
|
||||
className="lg:hidden p-2 rounded-xl text-medical-gray-600 hover:bg-medical-gray-50 transition-all flex-shrink-0"
|
||||
className="xl:hidden p-2 rounded-xl text-medical-gray-600 hover:bg-medical-gray-50 transition-all flex-shrink-0"
|
||||
aria-label="منو"
|
||||
>
|
||||
{isMobileMenuOpen ? <X className="w-6 h-6" /> : <Menu className="w-6 h-6" />}
|
||||
@@ -139,14 +139,14 @@ export default function Header({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Navigation Items */}
|
||||
<nav className="hidden lg:flex items-center gap-1 flex-grow justify-center h-full">
|
||||
{/* Navigation Items (Visible only from 1224px / xl) */}
|
||||
<nav className="hidden xl:flex items-center gap-1 flex-grow justify-center h-full">
|
||||
<div
|
||||
className="relative h-full flex items-center group"
|
||||
onMouseEnter={() => setIsMegaMenuOpen(true)}
|
||||
onMouseLeave={() => setIsMegaMenuOpen(false)}
|
||||
>
|
||||
<button className={`flex items-center justify-center gap-1.5 px-4 py-3 rounded-xl text-sm font-black transition-all whitespace-nowrap focus-visible:ring-4 focus-visible:ring-canina-blue/30 focus-visible:outline-none min-h-[48px] ${isMegaMenuOpen ? 'bg-medical-gray-50 text-canina-blue' : 'text-medical-gray-600 hover:bg-medical-gray-50 hover:text-canina-blue'} font-vazir`}>
|
||||
<button className={`flex items-center justify-center gap-1.5 px-3 xl:px-4 py-3 rounded-xl text-xs xl:text-sm font-black transition-all whitespace-nowrap focus-visible:ring-4 focus-visible:ring-canina-blue/30 focus-visible:outline-none min-h-[48px] ${isMegaMenuOpen ? 'bg-medical-gray-50 text-canina-blue' : 'text-medical-gray-600 hover:bg-medical-gray-50 hover:text-canina-blue'} font-vazir`}>
|
||||
{getText('nav_solutions', "دسته بندی درمانی")}
|
||||
<ChevronDown className={`w-4 h-4 transition-transform duration-300 ${isMegaMenuOpen ? 'rotate-180' : ''}`} />
|
||||
</button>
|
||||
@@ -212,7 +212,7 @@ export default function Header({
|
||||
<Link
|
||||
key={item.id}
|
||||
href={item.href}
|
||||
className={`px-4 py-3 rounded-xl text-sm font-black transition-all font-vazir whitespace-nowrap focus-visible:ring-4 focus-visible:ring-canina-blue/30 focus-visible:outline-none min-h-[48px] flex items-center justify-center ${currentView === item.id ? 'bg-canina-blue/5 text-canina-blue' : 'text-medical-gray-600 hover:bg-medical-gray-50 hover:text-canina-blue'}`}
|
||||
className={`px-3 xl:px-4 py-3 rounded-xl text-xs xl:text-sm font-black transition-all font-vazir whitespace-nowrap focus-visible:ring-4 focus-visible:ring-canina-blue/30 focus-visible:outline-none min-h-[48px] flex items-center justify-center ${currentView === item.id ? 'bg-canina-blue/5 text-canina-blue' : 'text-medical-gray-600 hover:bg-medical-gray-50 hover:text-canina-blue'}`}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
@@ -427,7 +427,7 @@ export default function Header({
|
||||
animate={{ opacity: 0.5 }}
|
||||
exit={{ opacity: 0 }}
|
||||
onClick={() => setIsMobileMenuOpen(false)}
|
||||
className="fixed inset-0 bg-black z-40 lg:hidden"
|
||||
className="fixed inset-0 bg-black z-40 xl:hidden"
|
||||
/>
|
||||
{/* Drawer */}
|
||||
<motion.div
|
||||
@@ -435,7 +435,7 @@ export default function Header({
|
||||
animate={{ x: 0 }}
|
||||
exit={{ x: "100%" }}
|
||||
transition={{ type: "spring", damping: 25, stiffness: 200 }}
|
||||
className="fixed top-0 right-0 bottom-0 w-80 max-w-[85vw] bg-white z-50 shadow-2xl p-6 flex flex-col gap-6 overflow-y-auto lg:hidden"
|
||||
className="fixed top-0 right-0 bottom-0 w-80 max-w-[85vw] bg-white z-50 shadow-2xl p-6 flex flex-col gap-6 overflow-y-auto xl:hidden"
|
||||
dir="rtl"
|
||||
>
|
||||
<div className="flex items-center justify-between border-b border-medical-gray-100 pb-4">
|
||||
|
||||
Reference in new issue
Block a user