Skip to content

Commit 0027cce

Browse files
author
raineer
committed
be a codev
1 parent 1408969 commit 0027cce

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎apps/codebility/app/(marketing)/_components/MarketingNavigation.tsx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ import {
3636
SheetTrigger,
3737
} from "@codevs/ui";
3838

39+
// Navigation items for top navbar and mobile drawer
3940
const NAV_ITEMS = [
4041
{ id: "1", title: "Our Services", path: "/services" },
4142
{ id: "2", title: "About Us", path: "/#whychooseus" },
4243
{ id: "3", title: "Book a Call", path: "/bookacall" },
43-
{ id: "4", title: "Hire a CoDevs", path: "/hire-a-codev" },
44+
{ id: "4", title: "Be a Codev", path: "/codevs" }, // ✅ ADDED: New link after Book a Call
45+
{ id: "5", title: "Hire a CoDevs", path: "/hire-a-codev" },
4446
] as const;
4547

48+
// Get menu items based on user application status
4649
const getMenuItems = (
4750
status: string,
4851
role_id: number,
@@ -271,7 +274,7 @@ const Navigation = () => {
271274

272275
async function fetchUser() {
273276
try {
274-
// FIXED: Use getUser() instead of getSession()
277+
// Use getUser() for proper auth check
275278
const { data: { user }, error: authError } = await supabase.auth.getUser();
276279

277280
if (authError) {
@@ -281,7 +284,6 @@ const Navigation = () => {
281284
}
282285

283286
if (!user) {
284-
// not logged in → silent
285287
setUserData(null);
286288
return;
287289
}
@@ -314,8 +316,8 @@ const Navigation = () => {
314316
const handleLogout = async () => {
315317
try {
316318
await signOut();
317-
setUserData(null); // Clear userData after logout
318-
setOpenSheet(false); // Close the mobile drawer (if open)
319+
setUserData(null);
320+
setOpenSheet(false);
319321
} catch (error) {
320322
console.error("Failed to log out:", error);
321323
}

‎apps/codebility/app/(marketing)/_components/MarketingSidenavMenu.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ import { useEffect, useState } from "react";
44
import Link from "next/link";
55
import ScrollToHash from "@/app/(marketing)/_components/landing/LandingScrollToHash";
66

7+
// Navigation links for sidebar - displayed on left side of landing page
78
const links = [
89
{ href: "/services", label: "Our Services" },
910
{ href: "/#whychooseus", label: "About Us" },
1011
{ href: "/bookacall", label: "Book a Call" },
12+
{ href: "/codevs", label: "Be a Codev" }, // ✅ ADDED: New link after Book a Call
1113
{ href: "/hire-a-codev", label: "Hire Codevs" },
1214
{ href: "/careers", label: "Careers" },
1315
];
1416

1517
const SideNavMenu = () => {
1618
const [isScrolling, setIsScrolling] = useState(false);
1719

20+
// Handle scroll animation - shrink links when scrolling
1821
const handleNav = () => {
1922
if (window.scrollY >= 200) {
2023
setIsScrolling(true);
@@ -56,4 +59,4 @@ const SideNavMenu = () => {
5659
);
5760
};
5861

59-
export default SideNavMenu;
62+
export default SideNavMenu;

0 commit comments

Comments
 (0)