@@ -7,49 +7,53 @@ import { SectionTitle, useSectionData } from "@hooks/useSectionData";
77import { motion , Variants } from "framer-motion" ;
88
99const containerVariants : Variants = {
10- hidden : { } ,
11- visible : {
12- transition : { staggerChildren : 0.3 } ,
13- } ,
10+ hidden : { } ,
11+ visible : {
12+ transition : { staggerChildren : 0.3 } ,
13+ } ,
1414} ;
1515
1616const cardVariants : Variants = {
17- hidden : { opacity : 0 , y : 40 } ,
18- visible : {
19- opacity : 1 ,
20- y : 0 ,
21- transition : { duration : 0.6 , ease : [ 0.25 , 0.1 , 0.25 , 1.0 ] } ,
22- } ,
23- exit : { opacity : 0 , y : 40 } ,
17+ hidden : { opacity : 0 , y : 40 } ,
18+ visible : {
19+ opacity : 1 ,
20+ y : 0 ,
21+ transition : { duration : 0.6 , ease : [ 0.25 , 0.1 , 0.25 , 1.0 ] } ,
22+ } ,
23+ exit : { opacity : 0 , y : 40 } ,
2424} ;
2525
2626export default function Experience ( ) {
27- const title = "Experience" ;
28- const data = useSectionData ( title ) ;
29-
30- return (
31- < section className = "flex flex-col w-screen text-center items-center p-10 gap-10" >
32- < SectionTitle title = { title } />
33-
34- { /* Experience Grid */ }
35- < AnimatedSection >
36- < motion . div
37- className = "grid grid-cols-1 xl:grid-cols-2 gap-6 w-full max-w-6xl mx-auto justify-items-center"
38- variants = { containerVariants }
39- initial = "hidden"
40- whileInView = "visible"
41- exit = "exit"
42- viewport = { { once : false , amount : 0.3 } } >
43- { data . map ( ( value , index ) => (
44- < motion . div
45- key = { index }
46- variants = { cardVariants }
47- className = "w-full flex justify-center" >
48- < Card { ...value } />
49- </ motion . div >
50- ) ) }
51- </ motion . div >
52- </ AnimatedSection >
53- </ section >
54- ) ;
27+ const title = "Experience" ;
28+ const data = useSectionData ( title ) ;
29+
30+ if ( ! data || data . length === 0 ) return null ;
31+
32+ return (
33+ < section className = "flex flex-col w-screen text-center items-center p-10 gap-10" >
34+ < SectionTitle title = { title } />
35+
36+ { /* Experience Grid */ }
37+ < AnimatedSection >
38+ < motion . div
39+ className = "grid grid-cols-1 xl:grid-cols-2 gap-6 w-full max-w-6xl mx-auto justify-items-center"
40+ variants = { containerVariants }
41+ initial = "hidden"
42+ whileInView = "visible"
43+ exit = "exit"
44+ viewport = { { once : false , amount : 0.3 } }
45+ >
46+ { data . map ( ( value , index ) => (
47+ < motion . div
48+ key = { index }
49+ variants = { cardVariants }
50+ className = "w-full flex justify-center"
51+ >
52+ < Card { ...value } />
53+ </ motion . div >
54+ ) ) }
55+ </ motion . div >
56+ </ AnimatedSection >
57+ </ section >
58+ ) ;
5559}
0 commit comments