@@ -46,10 +46,7 @@ function PapersCarousel({
46
46
47
47
handleResize ( ) ;
48
48
window . addEventListener ( "resize" , handleResize ) ;
49
-
50
- return ( ) => {
51
- window . removeEventListener ( "resize" , handleResize ) ;
52
- } ;
49
+ return ( ) => window . removeEventListener ( "resize" , handleResize ) ;
53
50
} , [ ] ) ;
54
51
55
52
const chunkedPapers = chunkArray ( displayPapers , chunkSize ) ;
@@ -90,12 +87,28 @@ function PapersCarousel({
90
87
{ carouselType === "users" ? "Your Papers" : "Upcoming Papers" }
91
88
</ p >
92
89
93
- < div className = "grid grid-cols-2 grid-rows-2 gap-4 md:grid-cols-4 lg:auto-rows-fr" >
94
- { Array . from ( { length : 8 } ) . map ( ( _ , index ) => (
95
- < div key = { index } className = "space-y-4 p-2" >
96
- < Skeleton className = "h-4 w-[70%]" />
97
- < Skeleton className = "h-4 w-[50%]" />
98
- < Skeleton className = "h-20 w-full rounded-lg" />
90
+ < div
91
+ className = { `${
92
+ carouselType === "users"
93
+ ? "grid grid-cols-4"
94
+ : "grid grid-cols-2 grid-rows-2 md:grid-cols-4"
95
+ } gap-4 lg:auto-rows-fr`}
96
+ >
97
+ { Array . from ( { length : chunkSize } ) . map ( ( _ , index ) => (
98
+ < div
99
+ key = { index }
100
+ className = "h-full rounded-sm border-2 border-[#734DFF] bg-[#FFFFFF] shadow-lg dark:border-[#36266D] dark:bg-[#171720]"
101
+ >
102
+ < div className = "border-b-2 border-[#453D60] p-2" >
103
+ < Skeleton className = "h-8 w-24 rounded-md" />
104
+ </ div >
105
+ < div className = "flex flex-col justify-between p-4" >
106
+ < Skeleton className = "mb-4 h-8 w-40 rounded-md" />
107
+ < div className = "flex gap-2" >
108
+ < Skeleton className = "h-7 w-16 rounded-full" />
109
+ < Skeleton className = "h-7 w-16 rounded-full" />
110
+ </ div >
111
+ </ div >
99
112
</ div >
100
113
) ) }
101
114
</ div >
@@ -111,12 +124,9 @@ function PapersCarousel({
111
124
{ carouselType === "users" ? "Your Papers" : "Upcoming Papers" }
112
125
</ p >
113
126
114
- < div className = "" >
127
+ < div >
115
128
< Carousel
116
- opts = { {
117
- align : "start" ,
118
- loop : true ,
119
- } }
129
+ opts = { { align : "start" , loop : true } }
120
130
plugins = { plugins }
121
131
className = "w-full"
122
132
>
@@ -125,23 +135,21 @@ function PapersCarousel({
125
135
< CarouselNext className = "relative" />
126
136
</ div >
127
137
< CarouselContent >
128
- { chunkedPapers . map ( ( paperGroup , index ) => {
129
- return (
130
- < CarouselItem
131
- key = { `carousel-item-${ index } ` }
132
- className = "grid grid-cols-2 grid-rows-2 gap-4 md:grid-cols-4 lg:auto-rows-fr"
133
- >
134
- { paperGroup . map ( ( paper , subIndex ) => (
135
- < div key = { subIndex } className = "h-full" >
136
- < UpcomingPaper
137
- subject = { paper . subject }
138
- slots = { paper . slots }
139
- />
140
- </ div >
141
- ) ) }
142
- </ CarouselItem >
143
- ) ;
144
- } ) }
138
+ { chunkedPapers . map ( ( paperGroup , index ) => (
139
+ < CarouselItem
140
+ key = { `carousel-item-${ index } ` }
141
+ className = "grid grid-cols-2 grid-rows-2 gap-4 md:grid-cols-4 lg:auto-rows-fr"
142
+ >
143
+ { paperGroup . map ( ( paper , subIndex ) => (
144
+ < div key = { subIndex } className = "h-full" >
145
+ < UpcomingPaper
146
+ subject = { paper . subject }
147
+ slots = { paper . slots }
148
+ />
149
+ </ div >
150
+ ) ) }
151
+ </ CarouselItem >
152
+ ) ) }
145
153
</ CarouselContent >
146
154
</ Carousel >
147
155
</ div >
0 commit comments