@@ -15,32 +15,39 @@ export function HeaderSection({
15
15
setMounted ( true ) ;
16
16
} , [ ] ) ;
17
17
18
+ if ( ! mounted ) {
19
+ return (
20
+ < section className = "space-y-2 sm:space-y-3 md:space-y-4" >
21
+ < h1 className = "text-lg sm:text-xl lg:text-2xl font-bold" > { title } </ h1 >
22
+ < p className = "text-sm sm:text-base text-muted-foreground" > { description } </ p >
23
+ </ section >
24
+ ) ;
25
+ }
26
+
18
27
return (
19
- mounted && (
20
- < motion . section
21
- className = "space-y-2 sm:space-y-3 md:space-y-4"
22
- initial = { { opacity : 0 , y : 20 } }
23
- animate = { { opacity : 1 , y : 0 } }
24
- transition = { { duration : 0.2 , ease : "easeOut" } }
28
+ < motion . section
29
+ className = "space-y-2 sm:space-y-3 md:space-y-4"
30
+ initial = { { opacity : 0 , y : 20 } }
31
+ animate = { { opacity : 1 , y : 0 } }
32
+ transition = { { duration : 0.2 , ease : "easeOut" } }
33
+ >
34
+ < motion . h1
35
+ className = "text-lg sm:text-xl lg:text-2xl font-bold"
36
+ initial = { { opacity : 0 } }
37
+ animate = { { opacity : 1 } }
38
+ transition = { { delay : 0.1 , duration : 0.2 } }
39
+ >
40
+ { title }
41
+ </ motion . h1 >
42
+ < motion . p
43
+ className = "text-sm sm:text-base text-muted-foreground"
44
+ initial = { { opacity : 0 } }
45
+ animate = { { opacity : 1 } }
46
+ transition = { { delay : 0.15 , duration : 0.2 } }
25
47
>
26
- < motion . h1
27
- className = "text-lg sm:text-xl lg:text-2xl font-bold"
28
- initial = { { opacity : 0 } }
29
- animate = { { opacity : 1 } }
30
- transition = { { delay : 0.1 , duration : 0.2 } }
31
- >
32
- { title }
33
- </ motion . h1 >
34
- < motion . p
35
- className = "text-sm sm:text-base text-muted-foreground"
36
- initial = { { opacity : 0 } }
37
- animate = { { opacity : 1 } }
38
- transition = { { delay : 0.15 , duration : 0.2 } }
39
- >
40
- { description }
41
- </ motion . p >
42
- </ motion . section >
43
- )
48
+ { description }
49
+ </ motion . p >
50
+ </ motion . section >
44
51
) ;
45
52
}
46
53
@@ -49,18 +56,26 @@ export function PostGrid({ children }: { children: ReactNode }) {
49
56
useEffect ( ( ) => {
50
57
setMounted ( true ) ;
51
58
} , [ ] ) ;
52
- return (
53
- mounted && (
54
- < motion . section
55
- initial = { { opacity : 0 } }
56
- animate = { { opacity : 1 } }
57
- transition = { { delay : 0.2 , duration : 0.2 } }
58
- >
59
+ if ( ! mounted ) {
60
+ return (
61
+ < section >
59
62
< div className = "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5" >
60
63
{ children }
61
64
</ div >
62
- </ motion . section >
63
- )
65
+ </ section >
66
+ ) ;
67
+ }
68
+
69
+ return (
70
+ < motion . section
71
+ initial = { { opacity : 0 } }
72
+ animate = { { opacity : 1 } }
73
+ transition = { { delay : 0.2 , duration : 0.2 } }
74
+ >
75
+ < div className = "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5" >
76
+ { children }
77
+ </ div >
78
+ </ motion . section >
64
79
) ;
65
80
}
66
81
0 commit comments