Skip to content

Commit 92414aa

Browse files
fixes some position of elements in header (#528)
* fixes some position of elements in header * checking for tests * for passing checks
1 parent 7a3c38f commit 92414aa

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/sections/Header.tsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Header: React.FC = () => {
1010
const [isScrolled, setIsScrolled] = useState(false);
1111
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
1212
const [activeDropdown, setActiveDropdown] = useState<string | null>(null);
13-
13+
//
1414
// Handle scroll effect
1515
useEffect(() => {
1616
const handleScroll = () => setIsScrolled(window.scrollY > 20);
@@ -72,9 +72,9 @@ const Header: React.FC = () => {
7272
/>
7373
</Link>
7474

75-
{/* Mobile menu toggle button */}
75+
{/* Mobile menu toggle button (visible below lg) */}
7676
<button
77-
className="md:hidden relative w-10 h-10 focus:outline-none z-50"
77+
className="lg:hidden relative w-10 h-10 focus:outline-none z-50"
7878
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
7979
aria-label="Toggle menu"
8080
aria-expanded={isMobileMenuOpen}
@@ -102,8 +102,8 @@ const Header: React.FC = () => {
102102
</div>
103103
</button>
104104

105-
{/* Desktop Navigation */}
106-
<nav className="hidden md:flex md:items-center md:space-x-4 lg:space-x-8">
105+
{/* Desktop Navigation (visible from lg and up) */}
106+
<nav className="hidden lg:flex lg:items-center lg:space-x-4">
107107
{/* Dropdown menus */}
108108
{Object.entries(navigationData.dropdowns).map(
109109
([key, dropdown]) => (
@@ -124,27 +124,29 @@ const Header: React.FC = () => {
124124
<Link
125125
key={link.label}
126126
to={link.path}
127-
className="px-2 lg:px-3 py-2 text-gray-700 dark:text-gray-200 hover:text-blue-600 font-medium rounded-md
128-
transition-all duration-200 hover:bg-gray-50 dark:hover:bg-gray-800 text-sm lg:text-base"
127+
className="px-2 lg:px-2 py-2 text-gray-700 dark:text-gray-200 hover:text-blue-600 font-medium rounded-md
128+
transition-all duration-200 hover:bg-gray-50 dark:hover:bg-gray-800 text-sm lg:text-sm whitespace-nowrap"
129129
onClick={handleNavigation}
130130
>
131131
{link.label}
132132
</Link>
133133
))}
134134

135-
<DarkModeToggle />
135+
<div className="flex items-center gap-3">
136+
<DarkModeToggle />
136137

137-
{/* CTA Button */}
138-
<Link
139-
to="/try-sugar"
140-
className="inline-flex items-center px-4 lg:px-6 py-2 lg:py-2.5 rounded-full font-semibold text-white
141-
bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800
142-
transition-all duration-300 transform hover:scale-105 hover:shadow-lg
143-
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 text-sm lg:text-base"
144-
onClick={handleNavigation}
145-
>
146-
TRY NOW
147-
</Link>
138+
{/* CTA Button (slightly reduced padding at lg so it fits tighter layouts) */}
139+
<Link
140+
to="/try-sugar"
141+
className="inline-flex items-center px-3 lg:px-4 py-2 rounded-full font-semibold text-white
142+
bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800
143+
transition-all duration-300 transform hover:scale-105 hover:shadow-lg
144+
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 text-sm"
145+
onClick={handleNavigation}
146+
>
147+
TRY NOW
148+
</Link>
149+
</div>
148150
</nav>
149151
</div>
150152
</div>

0 commit comments

Comments
 (0)