Update Navbar component to adjust link behavior based on user authentication and role. Change the home link to redirect authenticated non-admin users to the dashboard, and modify conditional rendering to hide the "book now" link for admin users, enhancing navigation clarity.
This commit is contained in:
parent
117ce09dc7
commit
3da7d99934
@ -80,7 +80,10 @@ export function Navbar() {
|
|||||||
whileHover={{ scale: 1.05 }}
|
whileHover={{ scale: 1.05 }}
|
||||||
whileTap={{ scale: 0.95 }}
|
whileTap={{ scale: 0.95 }}
|
||||||
>
|
>
|
||||||
<Link href="/" className="flex items-center gap-1.5 sm:gap-2">
|
<Link
|
||||||
|
href={isAuthenticated && !isAdmin ? "/user/dashboard" : "/"}
|
||||||
|
className="flex items-center gap-1.5 sm:gap-2"
|
||||||
|
>
|
||||||
<div className="bg-gradient-to-r from-rose-500 to-pink-600 p-1.5 sm:p-2 rounded-lg sm:rounded-xl">
|
<div className="bg-gradient-to-r from-rose-500 to-pink-600 p-1.5 sm:p-2 rounded-lg sm:rounded-xl">
|
||||||
<Heart className="h-4 w-4 sm:h-5 sm:w-5 text-white fill-white" />
|
<Heart className="h-4 w-4 sm:h-5 sm:w-5 text-white fill-white" />
|
||||||
</div>
|
</div>
|
||||||
@ -127,7 +130,7 @@ export function Navbar() {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
{!isUserDashboard && (
|
{!isAdmin && (
|
||||||
<Link
|
<Link
|
||||||
href="/book-now"
|
href="/book-now"
|
||||||
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg hover:opacity-90 ${isDark ? 'text-gray-300 hover:text-white' : 'text-gray-700 hover:text-rose-600'}`}
|
className={`text-sm font-medium transition-colors cursor-pointer px-3 py-2 rounded-lg hover:opacity-90 ${isDark ? 'text-gray-300 hover:text-white' : 'text-gray-700 hover:text-rose-600'}`}
|
||||||
@ -231,7 +234,7 @@ export function Navbar() {
|
|||||||
Sign In
|
Sign In
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{!isUserDashboard && (
|
{!isAdmin && (
|
||||||
<Link
|
<Link
|
||||||
href="/book-now"
|
href="/book-now"
|
||||||
onClick={() => setMobileMenuOpen(false)}
|
onClick={() => setMobileMenuOpen(false)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user