fix: resolve typescript type narrowing compiler errors in dynamic header actions
This commit is contained in:
parent
a4676224f1
commit
59ba358782
1 changed files with 14 additions and 20 deletions
34
src/App.tsx
34
src/App.tsx
|
|
@ -805,6 +805,7 @@ export default function App() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Dynamic Header */}
|
{/* Dynamic Header */}
|
||||||
|
{currentPage !== 'dashboard' && (
|
||||||
<nav className="w-full top-0 sticky z-50 bg-white border-b border-[#D9C5B2] transition-all duration-300">
|
<nav className="w-full top-0 sticky z-50 bg-white border-b border-[#D9C5B2] transition-all duration-300">
|
||||||
<div className="flex justify-between items-center max-w-7xl mx-auto px-8 py-4">
|
<div className="flex justify-between items-center max-w-7xl mx-auto px-8 py-4">
|
||||||
<button className="font-caslon text-2xl font-bold text-primary bg-transparent border-none cursor-pointer" onClick={() => navigateTo('home')}>
|
<button className="font-caslon text-2xl font-bold text-primary bg-transparent border-none cursor-pointer" onClick={() => navigateTo('home')}>
|
||||||
|
|
@ -819,29 +820,22 @@ export default function App() {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-4 text-sm font-semibold">
|
<div className="flex items-center gap-4 text-sm font-semibold">
|
||||||
{currentPage === 'dashboard' ? (
|
<button
|
||||||
<button className="text-secondary hover:text-primary bg-transparent border-none cursor-pointer" onClick={handleLogout}>
|
className="text-secondary hover:text-primary bg-transparent border-none cursor-pointer"
|
||||||
Logout
|
onClick={() => { setActiveTab('login'); navigateTo('login'); }}
|
||||||
</button>
|
>
|
||||||
) : (
|
Login
|
||||||
<>
|
</button>
|
||||||
<button
|
<button
|
||||||
className="text-secondary hover:text-primary bg-transparent border-none cursor-pointer"
|
className="bg-primary text-white px-4 py-2 rounded font-semibold transition-opacity hover:opacity-90 cursor-pointer"
|
||||||
onClick={() => { setActiveTab('login'); navigateTo('login'); }}
|
onClick={() => { setActiveTab('register'); navigateTo('signup'); }}
|
||||||
>
|
>
|
||||||
Login
|
Get Started
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
className="bg-primary text-white px-4 py-2 rounded font-semibold transition-opacity hover:opacity-90 cursor-pointer"
|
|
||||||
onClick={() => { setActiveTab('register'); navigateTo('signup'); }}
|
|
||||||
>
|
|
||||||
Get Started
|
|
||||||
</button>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
)}
|
||||||
{/* Main Content Area */}
|
{/* Main Content Area */}
|
||||||
{currentPage !== 'dashboard' ? (
|
{currentPage !== 'dashboard' ? (
|
||||||
<main className={`main-content ${currentPage === 'home' ? 'full-width' : ''}`}>
|
<main className={`main-content ${currentPage === 'home' ? 'full-width' : ''}`}>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue