Skip to content

Commit 70a585b

Browse files
authored
Merge pull request #405 from CodebilityDev/kris/theme-and-table-fix
Theme bug fix and Compact table fix
2 parents 8855dae + a60d800 commit 70a585b

14 files changed

Lines changed: 937 additions & 509 deletions

File tree

‎apps/codebility/app/api/codev/[codevId]/points/route.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export async function GET(
77
) {
88
try {
99
const { codevId } = await params;
10-
10+
1111
if (!codevId) {
1212
return NextResponse.json(
1313
{ error: "Codev ID is required" },
@@ -16,7 +16,7 @@ export async function GET(
1616
}
1717

1818
const supabase = await createClientServerComponent();
19-
19+
2020
// Fetch skill points with skill category details
2121
const { data: skillPoints, error: skillError } = await supabase
2222
.from("codev_points")
@@ -35,17 +35,17 @@ export async function GET(
3535
.single();
3636

3737
let attendancePoints = 0;
38-
38+
3939
// If no attendance points record exists, calculate from attendance table
4040
if (attendanceError && attendanceError.code === 'PGRST116') {
4141
const { data: attendanceCount } = await supabase
4242
.from("attendance")
4343
.select("*", { count: 'exact', head: true })
4444
.eq("codev_id", codevId)
4545
.in("status", ["present", "late"]);
46-
46+
4747
attendancePoints = (attendanceCount?.count || 0) * 2;
48-
48+
4949
// Create attendance_points record if there are attendance records
5050
if (attendancePoints > 0) {
5151
const { data: newRecord } = await supabase
@@ -57,7 +57,7 @@ export async function GET(
5757
})
5858
.select()
5959
.single();
60-
60+
6161
if (newRecord) {
6262
attendancePoints = newRecord.points;
6363
}
@@ -72,7 +72,7 @@ export async function GET(
7272
const totalSkillPoints = skillPoints?.reduce((sum, record) => sum + (record.points || 0), 0) || 0;
7373
const totalPoints = totalSkillPoints + attendancePoints;
7474

75-
return NextResponse.json({
75+
return NextResponse.json({
7676
skillPoints: skillPoints || [],
7777
attendancePoints,
7878
totalSkillPoints,

‎apps/codebility/app/home/applicants/_components/_table/applicantDataTable.tsx‎

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -177,25 +177,26 @@ function ApplicantDataTableComponent<TData extends NewApplicantType, TValue>({
177177
{/* Table header */}
178178
<TableHeader>
179179
{table.getHeaderGroups().map((headerGroup) => (
180-
<TableRow
180+
<TableRow
181+
181182
key={headerGroup.id}
182183
className="border-b border-gray-200 bg-gray-50 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-800"
183184
>
184185
{headerGroup.headers.map((header) => {
185186
return (
186-
<TableHead
187-
key={header.id}
188-
className={cn(
189-
"h-12 whitespace-nowrap px-0 py-0",
190-
(header.column.columnDef.meta as any)?.className,
191-
)}
192-
>
193-
{header.isPlaceholder
187+
<TableHead
188+
key={header.id}
189+
className={cn(
190+
"h-12 whitespace-nowrap px-0 py-0",
191+
(header.column.columnDef.meta as any)?.className,
192+
)}
193+
>
194+
{header.isPlaceholder
194195
? null
195196
: flexRender(
196-
header.column.columnDef.header,
197-
header.getContext(),
198-
)}
197+
header.column.columnDef.header,
198+
header.getContext(),
199+
)}
199200
</TableHead>
200201
);
201202
})}
@@ -212,14 +213,15 @@ function ApplicantDataTableComponent<TData extends NewApplicantType, TValue>({
212213
"border-b border-gray-100 transition-colors hover:bg-gray-50/50 dark:border-gray-800 dark:hover:bg-gray-800/50",
213214
row.getIsSelected() && "bg-blue-50 dark:bg-blue-900/20",
214215
row.original.application_status === "testing" &&
215-
row.original.applicant?.fork_url &&
216-
"bg-green-50 hover:bg-green-100/50 dark:bg-green-900/20 dark:hover:bg-green-900/30",
216+
row.original.applicant?.fork_url &&
217+
"bg-green-50 hover:bg-green-100/50 dark:bg-green-900/20 dark:hover:bg-green-900/30",
217218
row.original.application_status === "testing" &&
218-
toBeFailed(
219-
row.original.applicant?.test_taken,
220-
row.original.applicant?.fork_url,
221-
) &&
222-
"bg-red-50 hover:bg-red-100/50 dark:bg-red-900/20 dark:hover:bg-red-900/30",
219+
toBeFailed(
220+
row.original.applicant?.test_taken,
221+
row.original.applicant?.fork_url,
222+
) &&
223+
"bg-red-50 hover:bg-red-100/50 dark:bg-red-900/20 dark:hover:bg-red-900/30",
224+
223225
)}
224226
>
225227
{row.getVisibleCells().map((cell) => (

‎apps/codebility/app/home/applicants/_components/_table/applicantMobileTable.tsx‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ function ApplicantMobileTable<TData extends NewApplicantType>({
4242
{/* Table header */}
4343
<TableHeader>
4444
{table.getHeaderGroups().map((headerGroup) => (
45-
<TableRow
46-
key={headerGroup.id}
45+
<TableRow
46+
key={headerGroup.id}
47+
4748
className="border-b border-gray-200 bg-gray-50 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-800"
4849
>
4950
{headerGroup.headers
@@ -59,9 +60,9 @@ function ApplicantMobileTable<TData extends NewApplicantType>({
5960
{header.isPlaceholder
6061
? null
6162
: flexRender(
62-
header.column.columnDef.header,
63-
header.getContext(),
64-
)}
63+
header.column.columnDef.header,
64+
header.getContext(),
65+
)}
6566
</TableHead>
6667
))}
6768
</TableRow>
@@ -78,16 +79,16 @@ function ApplicantMobileTable<TData extends NewApplicantType>({
7879
"border-b border-gray-100 transition-colors hover:bg-gray-50/50 dark:border-gray-800 dark:hover:bg-gray-800/50",
7980
row.getIsSelected() && "bg-blue-50 dark:bg-blue-900/20",
8081
(row.original as NewApplicantType).application_status ===
81-
"testing" &&
82-
(row.original as NewApplicantType).applicant?.fork_url &&
83-
"bg-green-50 hover:bg-green-100/50 dark:bg-green-900/20 dark:hover:bg-green-900/30",
82+
"testing" &&
83+
(row.original as NewApplicantType).applicant?.fork_url &&
84+
"bg-green-50 hover:bg-green-100/50 dark:bg-green-900/20 dark:hover:bg-green-900/30",
8485
(row.original as NewApplicantType).application_status ===
85-
"testing" &&
86-
toBeFailed(
87-
(row.original as NewApplicantType).applicant?.test_taken,
88-
(row.original as NewApplicantType).applicant?.fork_url,
89-
) &&
90-
"bg-red-50 hover:bg-red-100/50 dark:bg-red-900/20 dark:hover:bg-red-900/30",
86+
"testing" &&
87+
toBeFailed(
88+
(row.original as NewApplicantType).applicant?.test_taken,
89+
(row.original as NewApplicantType).applicant?.fork_url,
90+
) &&
91+
"bg-red-50 hover:bg-red-100/50 dark:bg-red-900/20 dark:hover:bg-red-900/30",
9192
)}
9293
>
9394
{row

‎apps/codebility/app/home/hire/_components/ApplicationDetailsModal.tsx‎

Lines changed: 36 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ export default function ApplicationDetailsModal({
7474

7575
return (
7676
<Dialog open={isOpen} onOpenChange={onClose}>
77-
<DialogContent className="max-h-[90vh] max-w-4xl overflow-y-auto overflow-x-hidden bg-gray-900 border-gray-800">
77+
<DialogContent className="max-h-[90vh] max-w-4xl overflow-y-auto overflow-x-hidden border bg-card">
7878
<DialogHeader>
79-
<DialogTitle className="text-2xl font-light text-white">
79+
<DialogTitle className="text-2xl font-light text-foreground">
8080
Application Details
8181
</DialogTitle>
8282
</DialogHeader>
@@ -85,11 +85,11 @@ export default function ApplicationDetailsModal({
8585
{/* Applicant Header */}
8686
<div className="flex items-start justify-between">
8787
<div>
88-
<h2 className="text-xl font-medium text-white">
88+
<h2 className="text-xl font-medium text-foreground">
8989
{application.first_name} {application.last_name}
9090
</h2>
91-
<p className="text-gray-400">{application.job_title || 'Position'}</p>
92-
<div className="mt-2 flex items-center gap-4 text-sm text-gray-400">
91+
<p className="text-muted-foreground">{application.job_title || 'Position'}</p>
92+
<div className="mt-2 flex items-center gap-4 text-sm text-muted-foreground">
9393
<span className="flex items-center gap-1">
9494
<Calendar className="h-4 w-4" />
9595
Applied {new Date(application.applied_at).toLocaleDateString()}
@@ -108,32 +108,32 @@ export default function ApplicationDetailsModal({
108108
value={status}
109109
onValueChange={handleStatusChange}
110110
>
111-
<SelectTrigger className="w-[140px] bg-gray-800 border-gray-700 text-white">
112-
<SelectValue className="text-white" />
111+
<SelectTrigger className="w-[140px] border bg-accent/70 text-foreground">
112+
<SelectValue className="text-foreground" />
113113
</SelectTrigger>
114-
<SelectContent className="bg-gray-800 border-gray-700 text-white">
115-
<SelectItem value="pending" className="text-gray-300 hover:text-white">Pending</SelectItem>
116-
<SelectItem value="reviewing" className="text-gray-300 hover:text-white">Reviewing</SelectItem>
117-
<SelectItem value="shortlisted" className="text-gray-300 hover:text-white">Shortlisted</SelectItem>
118-
<SelectItem value="rejected" className="text-gray-300 hover:text-white">Rejected</SelectItem>
119-
<SelectItem value="hired" className="text-gray-300 hover:text-white">Hired</SelectItem>
114+
<SelectContent className="border bg-accent/70 text-foreground">
115+
<SelectItem value="pending" className="text-muted-foreground hover:text-foreground">Pending</SelectItem>
116+
<SelectItem value="reviewing" className="text-muted-foreground hover:text-foreground">Reviewing</SelectItem>
117+
<SelectItem value="shortlisted" className="text-muted-foreground hover:text-foreground">Shortlisted</SelectItem>
118+
<SelectItem value="rejected" className="text-muted-foreground hover:text-foreground">Rejected</SelectItem>
119+
<SelectItem value="hired" className="text-muted-foreground hover:text-foreground">Hired</SelectItem>
120120
</SelectContent>
121121
</Select>
122122
</div>
123123
</div>
124124

125125
{/* Contact Information */}
126-
<div className="rounded-lg border border-gray-800 p-4">
127-
<h3 className="mb-3 text-lg font-medium text-white">Contact Information</h3>
126+
<div className="rounded-lg border bg-accent/50 p-4">
127+
<h3 className="mb-3 text-lg font-medium text-foreground">Contact Information</h3>
128128
<div className="grid gap-3">
129129
<a
130130
href={`mailto:${application.email}`}
131-
className="flex items-center gap-2 text-gray-400 hover:text-white transition-colors"
131+
className="flex items-center gap-2 text-muted-foreground hover:text-muted-foreground/50 transition-colors"
132132
>
133133
<Mail className="h-4 w-4" />
134134
{application.email}
135135
</a>
136-
<div className="flex items-center gap-2 text-gray-400">
136+
<div className="flex items-center gap-2 text-muted-foreground">
137137
<Phone className="h-4 w-4" />
138138
{application.phone}
139139
</div>
@@ -142,7 +142,7 @@ export default function ApplicationDetailsModal({
142142
href={application.linkedin}
143143
target="_blank"
144144
rel="noopener noreferrer"
145-
className="flex items-center gap-2 text-gray-400 hover:text-white transition-colors"
145+
className="flex items-center gap-2 text-muted-foreground hover:text-muted-foreground/50 transition-colors"
146146
>
147147
<Linkedin className="h-4 w-4" />
148148
LinkedIn Profile
@@ -153,7 +153,7 @@ export default function ApplicationDetailsModal({
153153
href={application.github}
154154
target="_blank"
155155
rel="noopener noreferrer"
156-
className="flex items-center gap-2 text-gray-400 hover:text-white transition-colors"
156+
className="flex items-center gap-2 text-muted-foreground hover:text-muted-foreground/50 transition-colors"
157157
>
158158
<Github className="h-4 w-4" />
159159
GitHub Profile
@@ -164,7 +164,7 @@ export default function ApplicationDetailsModal({
164164
href={application.portfolio}
165165
target="_blank"
166166
rel="noopener noreferrer"
167-
className="flex items-center gap-2 text-gray-400 hover:text-white transition-colors"
167+
className="flex items-center gap-2 text-muted-foreground hover:text-muted-foreground/50 transition-colors"
168168
>
169169
<Globe className="h-4 w-4" />
170170
Portfolio Website
@@ -175,43 +175,47 @@ export default function ApplicationDetailsModal({
175175

176176
{/* Additional Details */}
177177
{application.notes && (
178-
<div className="rounded-lg border border-gray-800 p-4">
179-
<h3 className="mb-3 text-lg font-medium text-white">Additional Information</h3>
180-
<p className="text-gray-300">
178+
<div className="rounded-lg border bg-accent/50 p-4">
179+
<h3 className="mb-3 text-lg font-medium text-foreground">Additional Information</h3>
180+
<p className="text-muted-foreground">
181181
{application.notes}
182182
</p>
183183
</div>
184184
)}
185185

186186
{/* Experience */}
187-
<div className="rounded-lg border border-gray-800 p-4">
188-
<h3 className="mb-3 flex items-center gap-2 text-lg font-medium text-white">
187+
<div className="rounded-lg border bg-accent/50 p-4">
188+
<h3 className="mb-3 flex items-center gap-2 text-lg font-medium text-foreground">
189189
<Briefcase className="h-5 w-5" />
190190
Experience
191191
</h3>
192-
<p className="text-gray-300 whitespace-pre-wrap">
192+
<p className="text-muted-foreground whitespace-pre-wrap">
193193
{application.experience}
194194
</p>
195195
</div>
196196

197197
{/* Cover Letter */}
198-
<div className="rounded-lg border border-gray-800 p-4">
199-
<h3 className="mb-3 flex items-center gap-2 text-lg font-medium text-white">
198+
<div className="rounded-lg border bg-accent/50 p-4">
199+
<h3 className="mb-3 flex items-center gap-2 text-lg font-medium text-foreground">
200200
<FileText className="h-5 w-5 flex-shrink-0" />
201201
Cover Letter
202202
</h3>
203-
<p className="text-gray-300 whitespace-pre-wrap break-words">
203+
<p className="text-muted-foreground whitespace-pre-wrap break-words">
204204
{application.cover_letter}
205205
</p>
206206
</div>
207207

208208
{/* Resume */}
209209
{application.resume_url && (
210-
<div className="rounded-lg border border-gray-800 p-4">
211-
<h3 className="mb-3 text-lg font-medium text-white">Resume</h3>
210+
<div className="rounded-lg border bg-accent/50 p-4">
211+
212+
<h3 className="mb-3 flex items-center gap-2 text-lg font-medium text-foreground">
213+
<FileText className="h-5 w-5 flex-shrink-0" />
214+
Resume
215+
</h3>
212216
<Button
213217
variant="outline"
214-
className="border-gray-700 bg-gray-800 text-white hover:bg-gray-700"
218+
className="border border-foreground bg-card text-foreground hover:bg-muted-foreground/10"
215219
onClick={async () => {
216220
if (application.resume_url) {
217221
// Construct the Supabase storage URL

0 commit comments

Comments
 (0)