Skip to content

Commit faf77d7

Browse files
authored
Merge pull request #388 from CodebilityDev/miguel/fix-applicant-mobile-2
miguel/fix applicant mobile view
2 parents e7b0111 + 97d43df commit faf77d7

4 files changed

Lines changed: 171 additions & 215 deletions

File tree

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

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@ export const applicantsColumns: ColumnDef<NewApplicantType>[] = [
2828
}
2929
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
3030
aria-label="Select all"
31-
className=""
3231
/>
3332
),
3433
cell: ({ row }) => (
3534
<Checkbox
3635
checked={row.getIsSelected()}
3736
onCheckedChange={(value) => row.toggleSelected(!!value)}
3837
aria-label="Select row"
39-
className="mx-0 mt-8 px-0 xl:mt-2"
38+
className="mx-0 mt-8 px-0 xl:mt-0"
4039
/>
4140
),
4241
enableSorting: false,
4342
enableHiding: false,
43+
meta: {
44+
className: "align-top xl:align-middle",
45+
},
4446
},
4547
{
4648
id: "applicant",
@@ -350,46 +352,46 @@ export const applicantsColumns: ColumnDef<NewApplicantType>[] = [
350352
className: "m-0 px-0",
351353
},
352354
enableHiding: true,
353-
},
355+
},
354356

355-
{
357+
{
356358
id: "reminded",
357359
header: ({ column }) => {
358360
return (
359-
<Button
360-
variant="ghost"
361-
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
362-
className="flex items-center justify-center gap-1 text-xs font-medium text-gray-700 dark:text-gray-200"
363-
>
364-
Reminded
365-
<ArrowUpDown className="ml-2 h-4 w-4" />
366-
</Button>
361+
<Button
362+
variant="ghost"
363+
onClick={() => column.toggleSorting(column.getIsSorted() === "asc")}
364+
className="flex items-center justify-center gap-1 text-xs font-medium text-gray-700 dark:text-gray-200"
365+
>
366+
Reminded
367+
<ArrowUpDown className="ml-2 h-4 w-4" />
368+
</Button>
367369
);
368370
},
369371
cell: ({ row }) => {
370372
const applicant: NewApplicantType = row.original;
371373

372374
return (
373-
<div className="flex items-center justify-center px-2 py-1">
374-
<div className="flex flex-col items-center gap-0.5">
375-
<span className="inline-flex h-5 items-center justify-center rounded-full bg-gray-100 px-1 text-xs font-medium text-gray-800 dark:bg-gray-800 dark:text-gray-100">
376-
{applicant.applicant?.reminded_count ?? 0}
377-
</span>
378-
<span className="text-[10px] text-gray-500 dark:text-gray-400">
379-
{applicant.applicant?.last_reminded_date &&
380-
new Date(
381-
applicant.applicant.last_reminded_date,
382-
).toLocaleDateString()}
383-
</span>
375+
<div className="flex items-center justify-center px-2 py-1">
376+
<div className="flex flex-col items-center gap-0.5">
377+
<span className="inline-flex h-5 items-center justify-center rounded-full bg-gray-100 px-1 text-xs font-medium text-gray-800 dark:bg-gray-800 dark:text-gray-100">
378+
{applicant.applicant?.reminded_count ?? 0}
379+
</span>
380+
<span className="text-[10px] text-gray-500 dark:text-gray-400">
381+
{applicant.applicant?.last_reminded_date &&
382+
new Date(
383+
applicant.applicant.last_reminded_date,
384+
).toLocaleDateString()}
385+
</span>
386+
</div>
384387
</div>
385-
</div>
386388
);
387389
},
388390
meta: {
389391
className: "m-0 px-0",
390392
},
391-
},
392-
{
393+
},
394+
{
393395
id: "actions",
394396
header: "Actions",
395397
cell: ({ row }) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ function ApplicantDataTableComponent<TData extends NewApplicantType, TValue>({
246246
</Table>
247247

248248
{/* Table for smaller screens */}
249-
<div>
249+
<div className="xl:hidden">
250250
<ApplicantMobileTable table={table} />
251251
</div>
252252

0 commit comments

Comments
 (0)