Skip to content

Commit 33ad07d

Browse files
committed
fix: use single loading animation and fix checkbox column spacing
- Removed random animation selection, now uses only the main PageLoadingAnimation - Fixed checkbox column taking too much space in applicants table: - Set checkbox column width to w-10 (40px) - Added min-width to applicant name column (min-w-[200px]) - Set position column width to w-32 - Reduced checkbox sizes to h-3 w-3 - Adjusted checkbox margin from mt-8 to mt-6 This ensures the applicant name and position columns have adequate space while keeping the checkbox column compact.
1 parent ad25d85 commit 33ad07d

2 files changed

Lines changed: 10 additions & 23 deletions

File tree

‎apps/codebility/app/home/_components/PageTransitionWrapper.tsx‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,17 @@ import { useEffect, useState, useMemo } from "react";
44
import { usePathname } from "next/navigation";
55
import { motion, AnimatePresence } from "framer-motion";
66
import PageLoadingAnimation from "./PageLoadingAnimation";
7-
import {
8-
CubeLoadingAnimation,
9-
DNALoadingAnimation,
10-
WaveLoadingAnimation,
11-
PulseLoadingAnimation
12-
} from "./PageLoadingVariants";
137

148
interface PageTransitionWrapperProps {
159
children: React.ReactNode;
1610
}
1711

18-
const loadingAnimations = [
19-
PageLoadingAnimation,
20-
CubeLoadingAnimation,
21-
DNALoadingAnimation,
22-
WaveLoadingAnimation,
23-
PulseLoadingAnimation,
24-
];
25-
2612
export default function PageTransitionWrapper({ children }: PageTransitionWrapperProps) {
2713
const pathname = usePathname();
2814
const [isLoading, setIsLoading] = useState(true);
2915
const [displayedPathname, setDisplayedPathname] = useState(pathname);
3016
const [animationEnabled, setAnimationEnabled] = useState(true);
3117
const [animationDuration, setAnimationDuration] = useState(800);
32-
33-
// Randomly select a loading animation
34-
const LoadingComponent = useMemo(() => {
35-
const randomIndex = Math.floor(Math.random() * loadingAnimations.length);
36-
return loadingAnimations[randomIndex];
37-
}, [pathname]); // Change animation when route changes
3818

3919
// Load user preferences
4020
useEffect(() => {
@@ -98,7 +78,7 @@ export default function PageTransitionWrapper({ children }: PageTransitionWrappe
9878
transition: { duration: 0.3, ease: "easeOut" }
9979
}}
10080
>
101-
<LoadingComponent />
81+
<PageLoadingAnimation />
10282
</motion.div>
10383
)}
10484
</AnimatePresence>

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,29 @@ export const applicantsColumns: ColumnDef<NewApplicantType>[] = [
2828
}
2929
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
3030
aria-label="Select all"
31+
className="h-3 w-3"
3132
/>
3233
),
3334
cell: ({ row }) => (
3435
<Checkbox
3536
checked={row.getIsSelected()}
3637
onCheckedChange={(value) => row.toggleSelected(!!value)}
3738
aria-label="Select row"
38-
className="mx-0 mt-8 px-0 xl:mt-0"
39+
className="mx-0 mt-6 px-0 xl:mt-0 h-3 w-3"
3940
/>
4041
),
4142
enableSorting: false,
4243
enableHiding: false,
4344
meta: {
44-
className: "align-top xl:align-middle",
45+
className: "align-top xl:align-middle w-10",
4546
},
4647
},
4748
{
4849
id: "applicant",
4950
accessorKey: "first_name",
51+
meta: {
52+
className: "min-w-[200px]",
53+
},
5054
header: ({ column }) => {
5155
return (
5256
<Button
@@ -92,6 +96,9 @@ export const applicantsColumns: ColumnDef<NewApplicantType>[] = [
9296
</div>
9397
);
9498
},
99+
meta: {
100+
className: "w-32",
101+
},
95102
},
96103
{
97104
accessorKey: "years_of_experience",

0 commit comments

Comments
 (0)