Skip to content

Commit e819cef

Browse files
committed
wip
1 parent 37e7c85 commit e819cef

File tree

9 files changed

+297
-262
lines changed

9 files changed

+297
-262
lines changed

apps/registry/app/[username]/ProfileLayout.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MapPin } from 'lucide-react';
99
import { Button } from '@repo/ui/components/ui/button';
1010
import { useResume } from '../providers/ResumeProvider';
1111

12-
export default function Layout({ children, username, session }) {
12+
export default function Layout({ children, username }) {
1313
const router = useRouter();
1414
const pathname = usePathname();
1515
const { resume, loading, error } = useResume();
@@ -65,7 +65,8 @@ export default function Layout({ children, username, session }) {
6565
<div className="flex items-center mb-2 text-sm text-gray-500">
6666
<MapPin className="w-4 h-4 mr-1" />
6767
<span>
68-
{resume.basics.location.city}, {resume.basics.location.region}
68+
{resume.basics.location.city},{' '}
69+
{resume.basics.location.region}
6970
</span>
7071
</div>
7172
)}

apps/registry/app/context/auth.tsx

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,48 @@
1-
'use client'
1+
'use client';
22

3-
import { createContext, useContext, useEffect, useState } from 'react'
4-
import { User } from '@supabase/supabase-js'
5-
import { supabase } from '../lib/supabase'
3+
import { createContext, useContext, useEffect, useState } from 'react';
4+
import { User } from '@supabase/supabase-js';
5+
import { supabase } from '../lib/supabase';
66

77
type AuthContextType = {
8-
user: User | null
9-
loading: boolean
10-
}
8+
user: User | null;
9+
loading: boolean;
10+
};
1111

1212
const AuthContext = createContext<AuthContextType>({
1313
user: null,
1414
loading: true,
15-
})
15+
});
1616

17-
export function AuthProvider({ children }: { children: React.ReactNode }) {
18-
const [user, setUser] = useState<User | null>(null)
19-
const [loading, setLoading] = useState(true)
17+
export function AuthProvider({ children }) {
18+
const [user, setUser] = useState<User | null>(null);
19+
const [loading, setLoading] = useState(true);
2020

2121
useEffect(() => {
2222
// Check active sessions and sets the user
2323
supabase.auth.getSession().then(({ data: { session } }) => {
24-
setUser(session?.user ?? null)
25-
setLoading(false)
26-
})
24+
setUser(session?.user ?? null);
25+
setLoading(false);
26+
});
2727

2828
// Listen for changes on auth state (logged in, signed out, etc.)
29-
const { data: { subscription } } = supabase.auth.onAuthStateChange((_event, session) => {
30-
setUser(session?.user ?? null)
31-
setLoading(false)
32-
})
29+
const {
30+
data: { subscription },
31+
} = supabase.auth.onAuthStateChange((_event, session) => {
32+
setUser(session?.user ?? null);
33+
setLoading(false);
34+
});
3335

34-
return () => subscription.unsubscribe()
35-
}, [])
36+
return () => subscription.unsubscribe();
37+
}, []);
3638

3739
return (
3840
<AuthContext.Provider value={{ user, loading }}>
3941
{children}
4042
</AuthContext.Provider>
41-
)
43+
);
4244
}
4345

4446
export const useAuth = () => {
45-
return useContext(AuthContext)
46-
}
47+
return useContext(AuthContext);
48+
};

apps/registry/app/explore/ClientResumes.js

Lines changed: 91 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
import { useState, useEffect } from 'react';
44
import { useRouter, useSearchParams, usePathname } from 'next/navigation';
55
import Link from 'next/link';
6-
import { Search, MapPin, Briefcase, ExternalLink, LayoutDashboard } from 'lucide-react';
7-
import { Card, CardContent, CardFooter } from "@repo/ui/components/ui/card";
8-
import { Button } from "@repo/ui/components/ui/button";
9-
import { Badge } from "@repo/ui/components/ui/badge";
10-
import { Input } from "@repo/ui/components/ui/input";
6+
import {
7+
Search,
8+
MapPin,
9+
Briefcase,
10+
ExternalLink,
11+
LayoutDashboard,
12+
} from 'lucide-react';
13+
import { Card, CardContent, CardFooter } from '@repo/ui/components/ui/card';
14+
import { Button } from '@repo/ui/components/ui/button';
15+
import { Input } from '@repo/ui/components/ui/input';
1116

1217
export default function ClientResumes({
1318
initialResumes,
@@ -113,76 +118,87 @@ export default function ClientResumes({
113118

114119
{/* Resume Grid */}
115120
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
116-
{isLoading ? (
117-
// Loading skeletons
118-
Array.from({ length: 6 }).map((_, i) => (
119-
<Card key={i} className="animate-pulse">
120-
<CardContent className="p-6">
121-
<div className="flex items-start gap-4">
122-
<div className="w-16 h-16 bg-gray-200 rounded-full" />
123-
<div className="flex-1">
124-
<div className="h-4 bg-gray-200 rounded w-3/4 mb-2" />
125-
<div className="h-3 bg-gray-200 rounded w-1/2" />
121+
{isLoading
122+
? // Loading skeletons
123+
Array.from({ length: 6 }).map((_, i) => (
124+
<Card key={i} className="animate-pulse">
125+
<CardContent className="p-6">
126+
<div className="flex items-start gap-4">
127+
<div className="w-16 h-16 bg-gray-200 rounded-full" />
128+
<div className="flex-1">
129+
<div className="h-4 bg-gray-200 rounded w-3/4 mb-2" />
130+
<div className="h-3 bg-gray-200 rounded w-1/2" />
131+
</div>
126132
</div>
127-
</div>
128-
</CardContent>
129-
</Card>
130-
))
131-
) : (
132-
initialResumes.map((resume) => (
133-
<Card key={resume.username} className="h-full hover:shadow-lg transition-shadow">
134-
<CardContent className="p-6">
135-
<div className="flex items-start gap-4">
136-
{/* Avatar */}
137-
<img
138-
src={resume.image}
139-
alt={resume.name || resume.username}
140-
className="w-16 h-16 rounded-full object-cover border-2 border-gray-100"
141-
/>
142-
143-
{/* Info */}
144-
<div className="flex-1 min-w-0">
145-
<h3 className="font-semibold text-lg text-gray-900 truncate">
146-
{resume.name || resume.username}
147-
</h3>
148-
149-
{resume.label && (
150-
<p className="text-gray-600 text-sm mb-2 truncate">
151-
<Briefcase className="inline-block w-4 h-4 mr-1 -mt-0.5" />
152-
{resume.label}
153-
</p>
154-
)}
155-
156-
{resume.location?.city && (
157-
<p className="text-gray-500 text-sm flex items-center gap-1">
158-
<MapPin className="w-4 h-4" />
159-
<span className="truncate">
160-
{[resume.location.city, resume.location.region, resume.location.countryCode]
161-
.filter(Boolean)
162-
.join(', ')}
163-
</span>
164-
</p>
165-
)}
133+
</CardContent>
134+
</Card>
135+
))
136+
: initialResumes.map((resume) => (
137+
<Card
138+
key={resume.username}
139+
className="h-full hover:shadow-lg transition-shadow"
140+
>
141+
<CardContent className="p-6">
142+
<div className="flex items-start gap-4">
143+
{/* Avatar */}
144+
<img
145+
src={resume.image}
146+
alt={resume.name || resume.username}
147+
className="w-16 h-16 rounded-full object-cover border-2 border-gray-100"
148+
/>
149+
150+
{/* Info */}
151+
<div className="flex-1 min-w-0">
152+
<h3 className="font-semibold text-lg text-gray-900 truncate">
153+
{resume.name || resume.username}
154+
</h3>
155+
156+
{resume.label && (
157+
<p className="text-gray-600 text-sm mb-2 truncate">
158+
<Briefcase className="inline-block w-4 h-4 mr-1 -mt-0.5" />
159+
{resume.label}
160+
</p>
161+
)}
162+
163+
{resume.location?.city && (
164+
<p className="text-gray-500 text-sm flex items-center gap-1">
165+
<MapPin className="w-4 h-4" />
166+
<span className="truncate">
167+
{[
168+
resume.location.city,
169+
resume.location.region,
170+
resume.location.countryCode,
171+
]
172+
.filter(Boolean)
173+
.join(', ')}
174+
</span>
175+
</p>
176+
)}
177+
</div>
166178
</div>
167-
</div>
168-
</CardContent>
169-
<CardFooter className="px-6 py-4 border-t flex gap-2 justify-end bg-gray-50">
170-
<Button variant="outline" size="sm" asChild>
171-
<Link href={`/${resume.username}`} className="flex items-center gap-1">
172-
<ExternalLink className="w-4 h-4" />
173-
View Resume
174-
</Link>
175-
</Button>
176-
<Button variant="outline" size="sm" asChild>
177-
<Link href={`/${resume.username}/dashboard`} className="flex items-center gap-1">
178-
<LayoutDashboard className="w-4 h-4" />
179-
Dashboard
180-
</Link>
181-
</Button>
182-
</CardFooter>
183-
</Card>
184-
))
185-
)}
179+
</CardContent>
180+
<CardFooter className="px-6 py-4 border-t flex gap-2 justify-end bg-gray-50">
181+
<Button variant="outline" size="sm" asChild>
182+
<Link
183+
href={`/${resume.username}`}
184+
className="flex items-center gap-1"
185+
>
186+
<ExternalLink className="w-4 h-4" />
187+
View Resume
188+
</Link>
189+
</Button>
190+
<Button variant="outline" size="sm" asChild>
191+
<Link
192+
href={`/${resume.username}/dashboard`}
193+
className="flex items-center gap-1"
194+
>
195+
<LayoutDashboard className="w-4 h-4" />
196+
Dashboard
197+
</Link>
198+
</Button>
199+
</CardFooter>
200+
</Card>
201+
))}
186202
</div>
187203

188204
{/* Pagination */}
@@ -195,7 +211,7 @@ export default function ClientResumes({
195211
>
196212
Previous
197213
</Button>
198-
214+
199215
{getPageNumbers().map((pageNum, index) => (
200216
<Button
201217
key={index}
@@ -211,7 +227,7 @@ export default function ClientResumes({
211227
{pageNum}
212228
</Button>
213229
))}
214-
230+
215231
<Button
216232
variant="outline"
217233
onClick={() => handlePageChange(currentPage + 1)}

0 commit comments

Comments
 (0)