@myrjfa/ui 2.1.9 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ export function AppSidebar({ ...props }) {
35
35
  },
36
36
  {
37
37
  title: "My Opportunities",
38
- url: user ? `/overview/${(_b = user.role) !== null && _b !== void 0 ? _b : "user"}` : "#",
38
+ url: user ? (user.role === "user" ? "/dashboard/user" : `/overview/${(_b = user.role) !== null && _b !== void 0 ? _b : "user"}`) : "#",
39
39
  icon: LayoutDashboardIcon
40
40
  },
41
41
  ...((user === null || user === void 0 ? void 0 : user.role) === "admin" || (user === null || user === void 0 ? void 0 : user.role) === "host"
@@ -66,8 +66,8 @@ export function Navbar({ dark = false }) {
66
66
  return (_jsx("header", { className: `fixed top-0 left-0 z-[100] mx-auto transition-all duration-300 w-full ${navbarBg} ${textColor} ${navbarBorder}`, children: _jsxs("div", { className: "mx-auto flex items-center justify-between gap-10 py-4 px-4 lg:px-8", children: [_jsxs(Link, { href: "/", className: "flex items-center gap-3", children: [_jsxs(Avatar, { className: "ml-2 -mr-4.5", children: [_jsx(AvatarImage, { src: "/images/logoicon.webp" }), _jsxs(AvatarFallback, { children: [(currentUser === null || currentUser === void 0 ? void 0 : currentUser.firstName.charAt(0)) || "D", (currentUser === null || currentUser === void 0 ? void 0 : currentUser.lastName.charAt(0)) || "P"] })] }), _jsx("span", { className: "font-heading text-xl font-bold", children: "rippeaze" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("nav", { className: "hidden md:flex items-center gap-10 justify-end", children: [_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: `flex items-center gap-1 text-sm font-medium cursor-pointer ${navItemColor}`, children: [_jsx(Target, { className: "h-5 w-5" }), _jsx("span", { children: "Opportunities" }), _jsx(ChevronDown, { className: "h-4 w-4" })] }) }), _jsx(PopoverContent, { className: "w-56 p-2 mt-3 bg-white rounded-lg shadow-lg border", align: "start", sideOffset: 5, children: _jsx("div", { className: "flex flex-col", children: opportunityTypeOptions.map((opt) => (_jsxs(Link, { href: `/opportunities?type=${opt.value}`, className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-md flex flex-col", children: [_jsx("span", { className: "font-medium", children: opt.label }), _jsx("span", { className: "text-xs text-gray-500", children: opt.description })] }, opt.value))) }) })] }), _jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: `flex items-center gap-1 text-sm font-medium cursor-pointer ${navItemColor}`, children: [_jsx(Luggage, { className: "h-5 w-5" }), _jsx("span", { children: "Tours" }), _jsx(ChevronDown, { className: "h-4 w-4" })] }) }), _jsx(PopoverContent, { className: "w-64 p-2 mt-3 bg-white rounded-xl shadow-xl border", align: "start", sideOffset: 5, children: _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("p", { className: "text-[10px] font-black uppercase tracking-widest text-gray-400 px-3 pt-1 pb-0.5", children: "Book an Experience" }), _jsxs(Link, { href: "/packages", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Package, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Packages" }), _jsx("p", { className: "text-xs text-gray-400", children: "Curated all-inclusive tours" })] })] }), _jsxs(Link, { href: "/adventures", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Mountain, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Adventures" }), _jsx("p", { className: "text-xs text-gray-400", children: "Treks, rafting & thrills" })] })] }), _jsxs(Link, { href: "/stays", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(BedDouble, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Stays" }), _jsx("p", { className: "text-xs text-gray-400", children: "Hotels, hostels & homestays" })] })] }), _jsxs(Link, { href: "/rentals", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Car, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Rentals" }), _jsx("p", { className: "text-xs text-gray-400", children: "Bikes, cars & gear" })] })] }), _jsxs(Link, { href: "/plan", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Sparkles, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Plan a Trip" }), _jsx("p", { className: "text-xs text-gray-400", children: "AI-powered itinerary builder" })] })] })] }) })] }), _jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { className: `flex items-center gap-1 text-sm font-medium cursor-pointer ${navItemColor}`, children: [_jsx(Compass, { className: "h-5 w-5" }), _jsx("span", { children: "Explore" }), _jsx(ChevronDown, { className: "h-4 w-4" })] }) }), _jsx(PopoverContent, { className: "w-64 p-2 mt-3 bg-white rounded-xl shadow-xl border", align: "start", sideOffset: 5, children: _jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("p", { className: "text-[10px] font-black uppercase tracking-widest text-gray-400 px-3 pt-1 pb-0.5", children: "Discover" }), _jsxs(Link, { href: "/events", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Ticket, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Events" }), _jsx("p", { className: "text-xs text-gray-400", children: "Festivals, workshops & more" })] })] }), _jsxs(Link, { href: "/blogs", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Globe, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Blogs" }), _jsx("p", { className: "text-xs text-gray-400", children: "Travel stories & guides" })] })] }), _jsx("p", { className: "text-[10px] font-black uppercase tracking-widest text-gray-400 px-3 pt-2 pb-0.5", children: "Community" }), _jsxs(Link, { href: "/find-companion", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Users, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Find Companions" }), _jsx("p", { className: "text-xs text-gray-400", children: "Connect with travel buddies" })] })] }), _jsx("p", { className: "text-[10px] font-black uppercase tracking-widest text-gray-400 px-3 pt-2 pb-0.5", children: "Destinations" }), _jsxs(Link, { href: "/places", className: "px-3 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg flex items-center gap-3", children: [_jsx(Globe, { className: "h-4 w-4 text-primary flex-shrink-0" }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold", children: "Explore Places" }), _jsx("p", { className: "text-xs text-gray-400", children: "Countries, cities & landmarks" })] })] })] }) })] }), currentUser ? _jsx(NavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Become a Partner", href: "/contact", className: navItemColor })
67
67
  : _jsx(NavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Register as Business", href: "/auth/register?role=host", className: navItemColor }), isLoggedIn && _jsx(NotificationBell, { navItemColor: navItemColor, userId: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) !== "host" ? currentUser === null || currentUser === void 0 ? void 0 : currentUser.id : undefined, hostId: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "host" ? currentUser === null || currentUser === void 0 ? void 0 : currentUser.id : undefined })] }), _jsx("div", { className: "hidden md:flex items-center gap-2", children: _jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { variant: "link", className: "flex w-full gap-1 cursor-pointer", children: _jsxs(Avatar, { className: "ml-5 mr-4.5", children: [_jsx(AvatarImage, { src: (_a = currentUser === null || currentUser === void 0 ? void 0 : currentUser.profilePic) !== null && _a !== void 0 ? _a : "/images/profile_placeholder.webp" }), _jsxs(AvatarFallback, { children: [(currentUser === null || currentUser === void 0 ? void 0 : currentUser.firstName.charAt(0)) || "D", (currentUser === null || currentUser === void 0 ? void 0 : currentUser.lastName.charAt(0)) || "P"] })] }) }) }), _jsx(PopoverContent, { className: `w-full p-0 mt-3 bg-${dark ? "primary" : "white"} rounded-lg shadow-lg`, align: "end", sideOffset: 5, children: _jsxs("div", { className: "py-2 w-full", children: [_jsxs("div", { className: "px-4 py-3 border-b w-full", children: [_jsx("p", { className: "text-sm font-medium", children: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.username) || "Guest" }), _jsx("p", { className: "text-xs text-gray-500", children: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.email) || "user@example.com" })] }), _jsxs("div", { className: "flex flex-col", children: [isLoggedIn ?
68
68
  _jsxs(Link, { href: `/profile/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || "user"}/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.username) || "Guest"}`, className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsxs(Avatar, { className: "w-4 h-4", children: [_jsx(AvatarImage, { src: (_b = currentUser === null || currentUser === void 0 ? void 0 : currentUser.profilePic) !== null && _b !== void 0 ? _b : "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "U" })] }), "Profile"] }) :
69
- _jsxs(Button, { variant: "ghost", onClick: () => router.push('/auth/login?role=user'), className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2 justify-start", children: [_jsxs(Avatar, { className: "w-4 h-4", children: [_jsx(AvatarImage, { src: "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "U" })] }), "Login As Volunteer"] }), isLoggedIn && _jsxs(Link, { href: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'host' || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'admin' ? `/dashboard/host/overview` : `/overview/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || 'user'}`, className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsx(LayoutDashboardIcon, { className: "h-4 w-4" }), "Dashboard"] }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
70
- _jsxs(Link, { href: "/overview/user#bookings", className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsx(Luggage, { className: "h-4 w-4" }), "My Bookings"] }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
69
+ _jsxs(Button, { variant: "ghost", onClick: () => router.push('/auth/login?role=user'), className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2 justify-start", children: [_jsxs(Avatar, { className: "w-4 h-4", children: [_jsx(AvatarImage, { src: "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "U" })] }), "Login As Volunteer"] }), isLoggedIn && _jsxs(Link, { href: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'host' || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'admin' ? `/dashboard/host/overview` : `/dashboard/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || 'user'}`, className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsx(LayoutDashboardIcon, { className: "h-4 w-4" }), "Dashboard"] }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
70
+ _jsxs(Link, { href: "/dashboard/user#bookings", className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsx(Luggage, { className: "h-4 w-4" }), "My Bookings"] }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
71
71
  _jsxs(Link, { href: "/opportunities/favourites", className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2", children: [_jsx(Heart, { className: "h-4 w-4" }), "Favourites"] }), (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "host" ?
72
72
  _jsxs(Button, { variant: "ghost", onClick: async () => {
73
73
  await logout();
@@ -82,8 +82,8 @@ export function Navbar({ dark = false }) {
82
82
  }, className: "w-full py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 flex items-center gap-2 justify-start", children: [_jsxs(Avatar, { className: "w-4 h-4", children: [_jsx(AvatarImage, { src: "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "H" })] }), "Login As Business"] }), _jsx(Separator, { className: "my-1" }), isLoggedIn && _jsx(Button, { variant: "outline", className: "py-2 mx-2 text-sm text-gray-700 hover:bg-gray-100 justify-center cursor-pointer", onClick: () => {
83
83
  logout();
84
84
  }, children: "Sign out" })] })] }) })] }) })] }), _jsx(MobileNavbar, { children: _jsx("div", { className: `rounded-b-lg py-4 px-4 shadow-xl ${"bg-background"} ${textColor}`, children: _jsxs("nav", { className: "flex flex-col gap-1 pt-2", children: [_jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 py-2 px-2 text-muted-foreground", children: [_jsx(Target, { className: "h-5 w-5" }), _jsx("span", { className: "text-sm font-medium", children: "Opportunities" })] }), _jsx("div", { className: "pl-8 flex flex-col gap-1", children: opportunityTypeOptions.map((opt) => (_jsx(Link, { href: `/opportunities?type=${opt.value}`, className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: opt.label }, opt.value))) })] }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 py-2 px-2 text-muted-foreground", children: [_jsx(Luggage, { className: "h-5 w-5" }), _jsx("span", { className: "text-sm font-medium", children: "Tours" })] }), _jsxs("div", { className: "pl-8 flex flex-col gap-1", children: [_jsx(Link, { href: "/packages", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Packages" }), _jsx(Link, { href: "/adventures", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Adventures" }), _jsx(Link, { href: "/stays", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Stays" }), _jsx(Link, { href: "/rentals", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Rentals" }), _jsx(Link, { href: "/plan", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Plan a Trip \u2728" })] })] }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 py-2 px-2 text-muted-foreground", children: [_jsx(Compass, { className: "h-5 w-5" }), _jsx("span", { className: "text-sm font-medium", children: "Explore" })] }), _jsxs("div", { className: "pl-8 flex flex-col gap-1", children: [_jsx(Link, { href: "/events", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Events" }), _jsx(Link, { href: "/blogs", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Blogs" }), _jsx(Link, { href: "/find-companion", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Find Companions" }), _jsx(Link, { href: "/places", className: "py-1.5 px-2 text-sm text-gray-600 hover:text-foreground hover:bg-gray-100 rounded", children: "Explore Places" })] })] }), currentUser ? _jsx(MobileNavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Become a Partner", href: "/contact" }) :
85
- _jsx(MobileNavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Register as Business", href: "/auth/register?role=host" }), isLoggedIn && _jsx(MobileNotificationBell, {}), isLoggedIn && _jsx(MobileNavItem, { icon: _jsx(LayoutDashboardIcon, { className: "h-5 w-5" }), label: "Dashboard", href: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'host' || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'admin' ? `/dashboard/host/overview` : `/overview/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || 'user'}`, className: "md:hidden" }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
86
- _jsx(MobileNavItem, { icon: _jsx(Luggage, { className: "h-5 w-5" }), label: "My Bookings", href: "/overview/user#bookings", className: "md:hidden" }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
85
+ _jsx(MobileNavItem, { icon: _jsx(Store, { className: "h-5 w-5" }), label: "Register as Business", href: "/auth/register?role=host" }), isLoggedIn && _jsx(MobileNotificationBell, {}), isLoggedIn && _jsx(MobileNavItem, { icon: _jsx(LayoutDashboardIcon, { className: "h-5 w-5" }), label: "Dashboard", href: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'host' || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === 'admin' ? `/dashboard/host/overview` : `/dashboard/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || 'user'}`, className: "md:hidden" }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
86
+ _jsx(MobileNavItem, { icon: _jsx(Luggage, { className: "h-5 w-5" }), label: "My Bookings", href: "/dashboard/user#bookings", className: "md:hidden" }), isLoggedIn && ((currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "user" || (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) == null) &&
87
87
  _jsx(MobileNavItem, { icon: _jsx(Heart, { className: "h-5 w-5" }), label: "Favourites", href: "/opportunities/favourites", className: "md:hidden" }), isLoggedIn ? _jsxs(Link, { href: `/profile/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) || "user"}/${(currentUser === null || currentUser === void 0 ? void 0 : currentUser.username) || "Guest"}`, className: "flex w-full gap-1 cursor-pointer my-2", children: [_jsxs(Avatar, { className: "w-5 h-5 ml-2", children: [_jsx(AvatarImage, { src: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.profilePic) || "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "DP" })] }), _jsx(Label, { htmlFor: "username", className: "cursor-pointer text-muted-foreground hover:text-foreground", children: (currentUser === null || currentUser === void 0 ? void 0 : currentUser.username) || "Guest" })] }) :
88
88
  _jsxs(Link, { href: "/auth/login", className: "flex w-full gap-1 cursor-pointer my-2", children: [_jsxs(Avatar, { className: "w-5 h-5 ml-2", children: [_jsx(AvatarImage, { src: "/images/profile_placeholder.webp" }), _jsx(AvatarFallback, { children: "U" })] }), _jsx(Label, { htmlFor: "username", className: "cursor-pointer text-muted-foreground hover:text-foreground", children: "Login As Volunteer" })] }), (currentUser === null || currentUser === void 0 ? void 0 : currentUser.role) === "host" ?
89
89
  _jsxs(Button, { variant: "ghost", onClick: async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrjfa/ui",
3
- "version": "2.1.9",
3
+ "version": "3.1.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",