Skip to content

Commit 80246ab

Browse files
authored
Merge pull request #404 from CodebilityDev/dev
sept updates
2 parents 1d33387 + b05d409 commit 80246ab

112 files changed

Lines changed: 9234 additions & 3579 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.npmrc‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
use-lockfile=true
2+
shared-workspace-lockfile=true
3+

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ const Footer = () => {
5656
return (
5757
<Link key={social.id} href={social.href} target="_blank">
5858
<IconComponent
59-
className={`${
60-
IconComponent === IconFacebookWhite
61-
? "h-[25px] w-[25px]"
62-
: "h-[32px] w-[32px]"
63-
}`}
59+
className={`${IconComponent === IconFacebookWhite
60+
? "h-[25px] w-[25px]"
61+
: "h-[32px] w-[32px]"
62+
}`}
6463
/>
6564
</Link>
6665
);

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ const UserMenu = ({
172172
alt="Avatar"
173173
src={image_url || defaultAvatar}
174174
fill
175+
sizes="52px"
175176
title={`${first_name}'s Avatar`}
176177
className="rounded-full"
177178
/>
@@ -221,7 +222,6 @@ const UserMenu = ({
221222
};
222223

223224
const Navigation = () => {
224-
/* const supabase = createClientClientComponent(); */
225225
const { color } = useChangeBgNavigation();
226226
const pathname = usePathname();
227227
const [openSheet, setOpenSheet] = useState(false);
@@ -239,18 +239,16 @@ const Navigation = () => {
239239

240240
async function fetchUser() {
241241
try {
242-
const {
243-
data: { session },
244-
error: authError,
245-
} = await supabase.auth.getSession();
242+
// FIXED: Use getUser() instead of getSession()
243+
const { data: { user }, error: authError } = await supabase.auth.getUser();
246244

247245
if (authError) {
248-
console.error("Auth error:", authError.message);
246+
console.log("Auth error:", authError.message);
249247
setUserData(null);
250248
return;
251249
}
252250

253-
if (!session) {
251+
if (!user) {
254252
// not logged in → silent
255253
setUserData(null);
256254
return;
@@ -259,7 +257,7 @@ const Navigation = () => {
259257
const { data: userRow, error: fetchError } = await supabase
260258
.from("codev")
261259
.select(`*, applicant (id, codev_id)`)
262-
.eq("id", session.user.id)
260+
.eq("id", user.id)
263261
.single();
264262

265263
console.log("User Row:", userRow);
@@ -334,4 +332,4 @@ const Navigation = () => {
334332
);
335333
};
336334

337-
export default Navigation;
335+
export default Navigation;

‎apps/codebility/app/(marketing)/_components/landing/LandingWorkWithUs.tsx‎

Lines changed: 117 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -5,114 +5,128 @@ import { Button } from "@/components/ui/button";
55
import Container from "../MarketingContainer";
66
import Section from "../MarketingSection";
77

8-
const WorkWithUs = () => {
9-
return (
10-
<Section
11-
id="workwithus"
12-
className="border-light-900/5 bg-light-900/5 relative w-full border-y-4"
13-
>
14-
<Container className="relative z-10 mx-auto max-w-[1100px] px-4 text-white">
15-
<div className="flex flex-col gap-6 md:gap-10">
16-
<h2 className="text-center text-xl md:text-3xl">Work With Us</h2>
8+
// Card data array for DRY principle - Single source of truth for card content
9+
const WORK_WITH_US_CARDS = [
10+
{
11+
id: "portfolio",
12+
title: "Our Portfolio",
13+
image: {
14+
src: "https://codebility-cdn.pages.dev/assets/images/index/projects-large.jpg",
15+
alt: "portfolio projects"
16+
},
17+
description: "Build your own website with us today and ensure a reliable, cutting-edge online presence.",
18+
link: {
19+
href: "/services",
20+
text: "Our Portfolio"
21+
}
22+
},
23+
{
24+
id: "hire-developers",
25+
title: "Hire Developers",
26+
image: {
27+
src: "https://codebility-cdn.pages.dev/assets/images/index/codevs-large.jpg",
28+
alt: "professional developers"
29+
},
30+
description: "Connect with the best developer to meet your needs through our top-rated professionals.",
31+
link: {
32+
href: "/codevs",
33+
text: "Hire a CoDev"
34+
}
35+
},
36+
{
37+
id: "developer-journey",
38+
title: "Developer Journey",
39+
image: {
40+
src: "/assets/images/index/image.png",
41+
alt: "developer learning journey phases"
42+
},
43+
description: "Connect with our developer community and explore exciting career opportunities in tech.",
44+
link: {
45+
href: "/auth/onboarding",
46+
text: "Apply as Codev"
47+
}
48+
}
49+
];
1750

18-
{/* Updated grid layout for 3 cards */}
19-
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 lg:gap-5">
20-
21-
{/* Card 1: Portfolio */}
22-
<div className="border-light-900/5 bg-light-700/10 flex h-full flex-col gap-4 rounded-lg border-2 p-4">
23-
<div className="aspect-[500/359] w-full overflow-hidden rounded-xl">
24-
<Image
25-
src="https://codebility-cdn.pages.dev/assets/images/index/projects-large.jpg"
26-
alt="portfolio projects"
27-
width={500}
28-
height={359}
29-
className="h-full w-full object-cover"
30-
/>
31-
</div>
32-
<p className="flex-1 text-sm leading-relaxed">
33-
Build your own website with us today and ensure a reliable,
34-
cutting-edge online presence.
35-
</p>
36-
<div className="flex md:justify-end">
37-
<div className="w-full md:w-auto">
38-
<Link href="/services">
39-
<Button variant="purple" size="lg" rounded="full">
40-
Our Portfolio
41-
</Button>
42-
</Link>
43-
</div>
44-
</div>
45-
</div>
51+
// Reusable card component following Single Responsibility Principle
52+
const WorkWithUsCard = ({ card }: { card: typeof WORK_WITH_US_CARDS[0] }) => (
53+
<Container className="relative z-10 mx-auto max-w-[600px] px-4 text-white">
54+
<div className="border-light-900/5 bg-light-700/10 flex h-full flex-col gap-4 rounded-lg border-2 p-6 md:p-8">
55+
{/* Image section with consistent aspect ratio */}
56+
<div className="aspect-[500/359] w-full overflow-hidden rounded-xl">
57+
<Image
58+
src={card.image.src}
59+
alt={card.image.alt}
60+
width={500}
61+
height={359}
62+
className="h-full w-full object-cover"
63+
priority={card.id === "portfolio"} // Prioritize first image loading
64+
/>
65+
</div>
66+
67+
{/* Content section with consistent spacing */}
68+
<div className="flex flex-col gap-6">
69+
<p className="text-center text-sm leading-relaxed md:text-base">
70+
{card.description}
71+
</p>
72+
73+
{/* Button section - centered for single section layout */}
74+
<div className="flex justify-center">
75+
<Link href={card.link.href}>
76+
<Button variant="purple" size="lg" rounded="full">
77+
{card.link.text}
78+
</Button>
79+
</Link>
80+
</div>
81+
</div>
82+
</div>
83+
</Container>
84+
);
4685

47-
{/* Card 2: Hire Developers */}
48-
<div className="border-light-900/5 bg-light-700/10 flex h-full flex-col gap-4 rounded-lg border-2 p-4">
49-
<div className="aspect-[500/359] w-full overflow-hidden rounded-xl">
50-
<Image
51-
src="https://codebility-cdn.pages.dev/assets/images/index/codevs-large.jpg"
52-
alt="professional developers"
53-
width={500}
54-
height={359}
55-
className="h-full w-full object-cover"
56-
/>
57-
</div>
58-
<p className="flex-1 text-sm leading-relaxed">
59-
Connect with the best developer to meet your needs through our
60-
top-rated professionals.
61-
</p>
62-
<div className="flex md:justify-end">
63-
<div className="w-full md:w-auto">
64-
<Link href="/codevs">
65-
<Button variant="purple" size="lg" rounded="full">
66-
Hire a CoDev
67-
</Button>
68-
</Link>
69-
</div>
70-
</div>
71-
</div>
86+
// Background decoration component for DRY principle
87+
const BackgroundDecoration = () => (
88+
<div
89+
aria-hidden="true"
90+
className="pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform overflow-hidden blur-3xl"
91+
>
92+
<div
93+
style={{
94+
clipPath: "polygon(22.1% 28.3%, 6% 40.5%, 0.8% 63.5%, 9.3% 84.8%, 23.6% 88.5%, 48.9% 88.8%, 77.2% 88.5%, 92.4% 71.5%, 93.9% 51.5%, 85.9% 36.8%, 70% 29.5%, 46.1% 29%)",
95+
}}
96+
className="relative aspect-[855/678] w-[40rem] bg-gradient-to-r from-[#00738B] via-[#0C3FDB] to-[#9707DD] opacity-20 sm:w-[72.1875rem]"
97+
/>
98+
</div>
99+
);
72100

73-
{/* Card 3: Developer Journey */}
74-
<div className="border-light-900/5 bg-light-700/10 flex h-full flex-col gap-4 rounded-lg border-2 p-4">
75-
<div className="aspect-[500/359] w-full overflow-hidden rounded-xl">
76-
<Image
77-
src="/assets/images/index/image.png"
78-
alt="developer learning journey phases"
79-
width={500}
80-
height={359}
81-
className="h-full w-full object-cover"
82-
/>
83-
</div>
84-
<p className="flex-1 text-sm leading-relaxed">
85-
Connect with our developer community and explore exciting career opportunities in tech.
86-
</p>
87-
<div className="flex md:justify-end">
88-
<div className="w-full md:w-auto">
89-
<Link href="/auth/onboarding">
90-
<Button variant="purple" size="lg" rounded="full">
91-
Apply as Codev
92-
</Button>
93-
</Link>
94-
</div>
95-
</div>
96-
</div>
101+
const WorkWithUs = () => {
102+
return (
103+
<>
104+
{/* Main title section */}
105+
<Section
106+
id="workwithus"
107+
className="border-light-900/5 bg-light-900/5 relative w-full border-t-4"
108+
>
109+
<Container className="relative z-10 mx-auto max-w-[1100px] px-4 text-white">
110+
<h2 className="text-center text-xl md:text-3xl pt-1 pb-0 mb-0 -mb-16">Work With Us</h2>
111+
</Container>
112+
<BackgroundDecoration />
113+
</Section>
97114

115+
{/* Three separate sections - each card gets its own section */}
116+
{WORK_WITH_US_CARDS.map((card, index) => (
117+
<Section
118+
key={card.id}
119+
className={`border-light-900/5 bg-light-900/5 relative w-full ${
120+
index === WORK_WITH_US_CARDS.length - 1 ? 'border-b-4' : ''
121+
}`}
122+
>
123+
<div className="pt-0 pb-0 -mt-20">
124+
<WorkWithUsCard card={card} />
98125
</div>
99-
</div>
100-
</Container>
101-
102-
{/* Background decoration */}
103-
<div
104-
aria-hidden="true"
105-
className="pointer-events-none absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform overflow-hidden blur-3xl"
106-
>
107-
<div
108-
style={{
109-
clipPath:
110-
"polygon(22.1% 28.3%, 6% 40.5%, 0.8% 63.5%, 9.3% 84.8%, 23.6% 88.5%, 48.9% 88.8%, 77.2% 88.5%, 92.4% 71.5%, 93.9% 51.5%, 85.9% 36.8%, 70% 29.5%, 46.1% 29%)",
111-
}}
112-
className="relative aspect-[855/678] w-[40rem] bg-gradient-to-r from-[#00738B] via-[#0C3FDB] to-[#9707DD] opacity-20 sm:w-[72.1875rem]"
113-
/>
114-
</div>
115-
</Section>
126+
<BackgroundDecoration />
127+
</Section>
128+
))}
129+
</>
116130
);
117131
};
118132

‎apps/codebility/app/(marketing)/_components/marketing_modals/MarketingTermsAndConditionModal.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function TermsAndCondition() {
1616
<DialogTitle className="sr-only">Terms and Conditions</DialogTitle>
1717
<div className="flex h-full overflow-hidden rounded-[10px] border border-[#1D1D1E]">
1818
<div className="hidden sm:flex">
19-
<NavBar />
19+
<NavBar />
2020
</div>
2121
<Content />
2222
</div>
@@ -45,9 +45,8 @@ const NavBar: React.FC = () => {
4545
key={index}
4646
href={`#${tab}`}
4747
onClick={() => setActiveTab(index)}
48-
className={`px-2 py-1 text-xs sm:whitespace-nowrap sm:px-[1.2rem] sm:py-[10px] sm:text-base ${
49-
index === activeTab ? "rounded-[10px] bg-[#222222]" : ""
50-
}`}
48+
className={`px-2 py-1 text-xs sm:whitespace-nowrap sm:px-[1.2rem] sm:py-[10px] sm:text-base ${index === activeTab ? "rounded-[10px] bg-[#222222]" : ""
49+
}`}
5150
>
5251
{tab}
5352
</Link>
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
"use server";
2+
import { ModalProviderMarketing } from "@/components/providers/modal-provider-marketing";
3+
24
export default async function MarketingLayout({
35
children,
46
}: {
57
children: React.ReactNode;
68
}) {
79
return (
810
<div>
9-
<main>{children}</main>
11+
<main>
12+
{children}
13+
<ModalProviderMarketing />
14+
</main>
1015
</div>
1116
);
1217
}

‎apps/codebility/app/(marketing)/page.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async function Index() {
1919
<div
2020
className={`bg-black-400 relative flex w-full flex-col overflow-x-hidden overflow-y-hidden `}
2121
>
22-
<Navigation />
22+
<Navigation />
2323
<Hero />
2424
<CodevLandingHero />
2525
<Features />
@@ -30,7 +30,7 @@ export default async function Index() {
3030
<Partners />
3131
<Testimonials />
3232
<Calendly />
33-
<Footer />
33+
<Footer />
3434
</div>
3535
);
3636
}

‎apps/codebility/app/api/nda-document/[id]/route.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
21
import { createClientServerComponent } from "@/utils/supabase/server";
3-
42
import { NextRequest, NextResponse } from "next/server";
53

64
export async function GET(request: NextRequest, props: { params: Promise<{ id: string }> }) {
75
const params = await props.params;
6+
87
try {
98
const supabase = await createClientServerComponent();
109

11-
// Check if user is authenticated
12-
const { data: { session } } = await supabase.auth.getSession();
13-
if (!session) {
10+
// FIXED: Use getUser() instead of getSession()
11+
const { data: { user }, error: authError } = await supabase.auth.getUser();
12+
13+
if (authError || !user) {
1414
return NextResponse.json(
1515
{ error: "Unauthorized" },
1616
{ status: 401 }

0 commit comments

Comments
 (0)