Fix: Remove loading state dari Navbar agar menu langsung muncul
This commit is contained in:
@@ -25,7 +25,6 @@ interface UserData {
|
|||||||
|
|
||||||
const Navbar = () => {
|
const Navbar = () => {
|
||||||
const [user, setUser] = useState<UserData | null>(null);
|
const [user, setUser] = useState<UserData | null>(null);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
|
||||||
const [isVisible, setIsVisible] = useState(true);
|
const [isVisible, setIsVisible] = useState(true);
|
||||||
const [lastScrollY, setLastScrollY] = useState(0);
|
const [lastScrollY, setLastScrollY] = useState(0);
|
||||||
const { showSuccess, showError } = useToast ();
|
const { showSuccess, showError } = useToast ();
|
||||||
@@ -68,8 +67,6 @@ const Navbar = () => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error checking session:', error);
|
console.error('Error checking session:', error);
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -95,24 +92,6 @@ const Navbar = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isLoading) {
|
|
||||||
return (
|
|
||||||
<div className="bg-background/95 border-b py-2 sticky top-0 z-30">
|
|
||||||
<div className="container mx-auto px-4 flex justify-between items-center">
|
|
||||||
<div className="flex items-center">
|
|
||||||
<Link href="/" className="flex items-center text-lg font-semibold hover:text-primary transition-colors">
|
|
||||||
<img src="/podif-icon.png" alt="PODIF Logo" className="h-6 w-auto mr-2" />
|
|
||||||
PODIF
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-4">
|
|
||||||
<ThemeToggle />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`bg-background/95 border-b py-2 sticky top-0 z-30 transition-transform duration-300 ${
|
<div className={`bg-background/95 border-b py-2 sticky top-0 z-30 transition-transform duration-300 ${
|
||||||
isVisible ? 'translate-y-0' : '-translate-y-full'
|
isVisible ? 'translate-y-0' : '-translate-y-full'
|
||||||
|
|||||||
Reference in New Issue
Block a user